dartiss / transient-cleaner

WordPress plugin to clean expired transients from your options table.
https://wordpress.org/plugins/artiss-transient-cleaner/
GNU General Public License v2.0
4 stars 0 forks source link

Update to core handling #37

Open dartiss opened 1 year ago

dartiss commented 1 year ago

Okay, so bear with me, this is a big one.

Since WP4.9, core has done the housekeeping itself (why the hell didn't anybody tell me?). Here's the code... https://github.com/WordPress/WordPress/blob/e5b8662000b53dfdf734bef83eb2b02facfabb16/wp-includes/option.php#L1028

It hooks into the daily trash collection here: https://github.com/WordPress/WordPress/blob/b8bc65042ab4c57cefc46bbf9eb8d56e00188dee/wp-admin/admin.php#L106. Oh, and it does it on upgrade too. Basically, what my plugin does. Plus it handles some other things better than I do.

So, with this release I want to use what'a already there and add a few extras on from mine. Basically, the ability to run them ad-hoc. To do this, I need to call delete_expired_transients. What I'll loose is the ability to report on when it last ran.

This will also limit the options - the ability to run, plus the ability to optimise afterwards. Also provide the ability to clear all transients too.

dartiss commented 4 months ago

Will move minimum version of WP for this plugin to 4.9 and exclusively use the core function to do the housekeeping.

As a result I will remove certain settings, such as defining when the housekeeping will run.