Skip to content

Cleared image data cron on deactivation - #1207

Merged
pirate-bot merged 1 commit into
developmentfrom
bugfix/1198
Oct 29, 2026
Merged

pirate-bot merged 1 commit into
developmentfrom
bugfix/1198

Conversation

@girishpanchal30

@girishpanchal30 girishpanchal30 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

All Submissions:

Changes proposed in this Pull Request:

Fixed Optimole cron cleanup on deactivation by clearing both active scheduled hooks through Optml_Admin::SYNC_CRON and Optml_Admin::ENRICH_CRON, preventing future hook renames from leaving scheduled events behind. The legacy optml_pull_image_data_init hook is also cleared to support sites upgraded from version 3.x.

Closes #1198

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@girishpanchal30 girishpanchal30 changed the title fix: clear image data cron on deactivation Cleared image data cron on deactivation Oct 28, 2026
@pirate-bot

Copy link
Copy Markdown
Collaborator

Plugin build for d071db4 is ready 🛎️!

@pirate-bot pirate-bot left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approved

Deactivation now clears both recurring Optimole cron hooks and the legacy hook, and the new test fails without the fix.

Validation details
  • Files reviewed: 2/2 changed files.
  • The new test passes at HEAD on PHP 8.3.36 and WordPress 7.1.3: cd /repo; set -o pipefail; timeout 300 vendor/bin/phpunit --do-not-cache-result --filter 'Test_Admin::test_deactivate_cl… printed OK (1 test, 3 assertions) (run R2)
  • With inc/main.php from the base commit, the test fails with optml_pull_image_data is still scheduled. The helper printed no run record.
  • inc/admin.php:89-100 holds the only recurring schedules, and both now use the constants that deactivate() clears.
  • Release 3.14.1 scheduled optml_pull_image_data_init hourly, so the legacy comment is accurate.
Untested areas
  • The real wp plugin deactivate flow was not run. The test calls deactivate() directly.

🤖 Automated review · run code-review-agent_6ae1e670246987.54771842.


🤖 Review agent — review posted ✅ on d071db45 · approved · 0 findings · 5 min

Run code-review-agent_6ae1e670246987.54771842 · trail

@pirate-bot
pirate-bot merged commit 6385721 into development Oct 29, 2026
15 checks passed
@pirate-bot
pirate-bot deleted the bugfix/1198 branch October 29, 2026 02:01
@pirate-bot

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 4.2.18 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Indicate that an issue has been resolved and released in a particular version of the product.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants