• Resolved peter8nss

    (@peter8nss)


    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)
  • Plugin Author eskapism

    (@eskapism)

    Thanks for reporting this! It should not be autoloaded, obviously something I missed when adding this. Will be fixed in next version.

    • This reply was modified 3 months, 2 weeks ago by eskapism.
    Thread Starter peter8nss

    (@peter8nss)

    I can see that the change has gone into version 5.0.2. Thank you.

    I’m not seeing a change in the autoload value for “SimplePluginLogger_plugin_info_before_update” yet. I think the impact of this change won’t apply until the next update, as the “upgrader_pre_install” hook for this upgrade will have used the old code.

    No action required, it should come through with the next release.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.