-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WP cron option to purge caches on schedule #971
Conversation
…ell as on the general settings page for all caches.
…not scheduling consistently or when settings were modified.
…nto cron-flush
…onfig" and caused the Always Cached to malfunction.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #971 +/- ##
===========================================
- Coverage 0.90% 0.89% -0.01%
- Complexity 19609 19697 +88
===========================================
Files 679 679
Lines 98868 99358 +490
===========================================
Hits 893 893
- Misses 97975 98465 +490 ☔ View full report in Codecov by Sentry. |
…ts. Re-enabled the fix_on_event for all caches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Object Cache does not have disk option "file_generic".
- WP Cron and the database use UTC/GMT, but the UI converts to the site/user locale timezone.
See comments.
…nto cron-flush
…chedule timestamp calculations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users don't have an option to choose a timezone different from the WP site timezone, so there is no "timezone" in user meta. You can just set the variable to wp_timezone()
. If it's only used once in a method, then use wp_timezone()
there.
When I enable the feature and choose a time in the past, I don't see the WP Cron event scheduled if I choose anything other than "weekly".
This PR simply adds a new option on the General settings page and on the advanced setting pages for Page, DB, Minify, and Object caches. This new option is it's own meta box containing an enable checkbox and a time and interval selector to define when the WP cron event should be run and on what interval. These cron events simply call a flush on the relevant cache