Currently degrades performance!
-
This plugin stores cached data as transients. Transients store their data in the wp_options table.
Transients use the prefix “_transient_” to not collide with site options that have the same option_name. Here is the issue: The maximum length for wordpress option_names are 64 characters. This plugin generates a name that is exactly 57 characters, like this:
_transient_cache-widget-cb184f2e2b0fed054bcb42c16b2052301
So are we all set? No! Because when a transient is saved there is a second option added to the wp_options table that controls the timeout, which looks like this:
_transient_timeout_cache-widget-cb184f2e2b0fed054bcb42c16b2052301
It has the prefix “_transient_timeout_”. If we count the number of characters we reach 65. So actually, the trailing “1” won’t be saved. This is what is saved to the database:
_transient_timeout_cache-widget-cb184f2e2b0fed054bcb42c16b205230
Because of this the transients don’t have the same names any more and they won’t be properly cleaned, but first and foremost the plugin can’t find the saved transients again, so it ends up doing INSERT queries on every pageload because the transients can’t be found due to the missing trailing “1”.
So instead of reducing queries, this plugin increased the page queries from 23 to 70 queries.
This is not some special edge case, this is the default behaviour unless you install a persistent object cache plugin like Memcached or APC.
To fix this, use a shorter prefix, like “cwidget” instead of “cache-widget”.
Here is the ticket related to this issue:
https://core.trac.www.ads-software.com/ticket/15058
- The topic ‘Currently degrades performance!’ is closed to new replies.