Large option _plugin_info_before_update
-
I’m trying to reduce the time spent executing “wp_load_alloptions”. And in the process I noticed that one of the largest autoloaded options on my system is “SimplePluginLogger_plugin_info_before_update”.
Looking at the code I think the intention was that this option should only exist for the a short duration
* Saves info about all installed plugins to an option.
* When we are done logging then we remove the option.But the call to “remove_saved_versions” which deletes the option has been commented out:
// Clear our transient after an update is done
// Removed because something probably changed in core and this was fired earlier than it used to be
// add_action( 'delete_site_transient_update_plugins', array( $this, "remove_saved_versions" ) );Three suggestions:
- Uncomment the add_action – so it is deleted as originally intended
- Change the “update_option” in “save_versions_before_update” to have third parameter autoload=false
- Use a transient rather than an option so it gets deleted automatically after some expiry period
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.