• Resolved r-a-y

    (@r-a-y)


    Hi,

    Our users ran into an issue with the upgrade routine always running on each admin page, causing the page load time to take roughly 50-60 seconds each time.

    The issue is Newsletters uses its own object cache to cache its own options: https://plugins.trac.www.ads-software.com/browser/newsletters-lite/trunk/wp-mailinglist-plugin.php#L10178

    However, Newsletters never purges any of its own object-cached values when they updated or deleted.

    For sites that run an external object cache, this means that all options in Newsletters have the potential of having stale data.

    In the specific case of the updating_plugin() method, Newsletters checks the saved version against the file version before doing its update routine: https://plugins.trac.www.ads-software.com/browser/newsletters-lite/trunk/wp-mailinglist-plugin.php#L10548.

    When grabbing the saved version, this value was old and not the same as the value in the DB.

    This caused the update routine to always run in the admin area on each page load.

    To fix this, we recommend that the this->update_option() method should add a call to the $this->set_cache() method and the $this->delete_option() method should also add a call to the $this->delete_cache() method to avoid stale cached items.

    Let me know if you have any questions.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Tribulant Software

    (@contrid)

    Thank you for your comment and suggestion Ray. We’ll verify this later and, if everything is okay, we’ll apply the fix.

    Thread Starter r-a-y

    (@r-a-y)

    Thanks for the prompt reply.

    If you need me to send a patch, let me know. We would really appreciate if you could address this for the next release if possible.

    Thread Starter r-a-y

    (@r-a-y)

    The better fix is to remove the $this->get_cache() call block from the $this->get_option() method.

    WordPress already has a built-in object cache for their get_option() / update_option() / delete_option() functions, so not sure why you require a different cache in your custom $this->get_option() method. You’re already calling WP’s get_option() in your method anyway.

    Plugin Author Tribulant Software

    (@contrid)

    We have applied a fix and it will be part of the next update.
    Do let us know if you find anything else. We’re grateful for your request!
    Have a great weekend.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Update routine always runs due to stale object cache’ is closed to new replies.