WP Manifestindependent plugin directory
manifest / performance / discrete-transients-wordpress-plugin

Discrete Transients API

Discrete Transients plugin puts you in charge of defining your own table where WordPress stores transients

by Martin Adamko · github.com/hackingwp/discrete-transients-wordpress-plugin · website

7stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/hackingwp/discrete-transients-wordpress-plugin/archive/refs/heads/master.zip

Discrete Transients plugin puts you in charge of defining your own table where WordPress stores transients.

If you never heard of Wordpress Transient API, Google it, it's the new kid on the block for the rest of us. If you want your WordPress site(s) to run a bit faster (+ gaining some love from your visitors and Google from page loading speed as a side effect is always nice) but don't need/want dedicated caching setups but, transients are here to save your day.

Even though I fell in love with the Transient API, I realized that the wp_options could go pretty wild when not used correctly.

  • There is no garbage collector in the Transient API keeping forgotten data in table
  • There is a pretty chance of damaging your site when cleaning wp_options table by hand
  • Speed gain can be harmed (maybe lost) as your table gets bigger (I assume)

Any way, having it all in a discrete table can do no harm. And if something goes wrong (I can't think of a single thing right now), just deactivate the plugin ang you are back to using built-in table.

Installation

As with all WordPress plugins, copy all files to WordPress plugins folder

Features

  • Creates new table similar to wp_options table
  • Flush all transients entirely without harm to wp_options via WordPress Admin plugins page link
  • Add define('DISCRETE_TRANSIENT_TABLE', 'my_transients_table'); in wp_config.php for custom table name
  • Add define('DISCRETE_TRANSIENT_LOG_QUERIES', true); in wp_config.php to turn on logging of modified SQL queries

Roadmap

  • Register plugin in official WordPress Plugins repository
  • Add option to flush transients only when already expired

If you like the plugin or just want to say hi find me on twitter.

get lucky

@martin_adamko