Repository navigation
Cleared image data cron on deactivation - #1207
Merged
Merged
Conversation
Collaborator
pirate-bot
approved these changes
Oct 28, 2026
Collaborator
There was a problem hiding this comment.
🟢 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…printedOK (1 test, 3 assertions)(run R2) - With
inc/main.phpfrom the base commit, the test fails withoptml_pull_image_data is still scheduled.The helper printed no run record. inc/admin.php:89-100holds the only recurring schedules, and both now use the constants thatdeactivate()clears.- Release 3.14.1 scheduled
optml_pull_image_data_inithourly, so the legacy comment is accurate.
Untested areas
- The real
wp plugin deactivateflow was not run. The test callsdeactivate()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
Collaborator
|
🎉 This PR is included in version 4.2.18 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
Fixed Optimole cron cleanup on deactivation by clearing both active scheduled hooks through
Optml_Admin::SYNC_CRONandOptml_Admin::ENRICH_CRON, preventing future hook renames from leaving scheduled events behind. The legacyoptml_pull_image_data_inithook is also cleared to support sites upgraded from version 3.x.Closes #1198
Other information: