Large option _plugin_info_before_update | WordPress.org

[ad_1]

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

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer