Giter Club home page Giter Club logo

transient-cleaner's Introduction

Transient Cleaner

Remove expired transients from your options table. The original and best!

This plugin is designed only for WordPress 5.8 or below, as transient cleaning is part of core functionality after that point.

"Transients are a simple and standardized way of storing cached data in the WordPress database temporarily by giving it a custom name and a timeframe after which it will expire and be deleted."

Unfortunately, expired transients only get deleted when you attempt to access them. If you don't access the transient then, even though it's expired, WordPress will not remove it. This is a known "issue" but due to reasons, which are explained in the FAQ, this has not been adequately resolved.

Why is this a problem? Transients are often used by plugins to "cache" data (my own plugins included). Because of this it means that expired data can be left and build up, resulting in a bloated database table.

Meantime, this plugin is the hero that you've been waiting for. Simply activate the plugin, sit back and enjoy a much cleaner, smaller options table. It also adds the additional recommendation that after a database upgrade all transients will be cleared down.

I'd like to thank WordPress Developer Andrew Nacin for his early discussion on this. Also, I'd like to acknowledge the useful article at Everybody Staze for ensuring the proposed solution made sense, and W-Shadow.com for the cleaning code.

Iconography is courtesy of the very talented Janki Rathod ♥️

 

transient-cleaner's People

Contributors

dartiss avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

theperfectwill

transient-cleaner's Issues

Update to core handling

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.

Modify language used for this plugin

  • Drop the user of "housekeep" or "housekeeping". Preferred words are maintenance or cleanup.

  • For the admin message, I refer to disabling the plugin - it should be deactivate

Review code

Go through the remaining code and review it all to see if it's written as I'd expect.

Instead of re-writing this plugin I made the decision to continue as-is. I'd like the code at this stage to be no different to how it would have been if I'd written it from scratch.

Fix PHPCS issues

Fix all PHPCS issues reported for WordPress and VIP rulesets.

WP CRON issue since i've deleted all transient

Hi!

I've deleted the transient from two different website using your plugin.

Since this in both website WP CRON stop running: i think the two things are related because server log shows the WP CRON stop running next transient cleaning

I'm not able to restart WP CRON so i've to use ALTERNATE WP CRON

Can you help me?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.