Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing, activating, deactivating, and deleting a plugin does not wipe/clear the cache #424

raamdev opened this issue Feb 26, 2015 · 7 comments


Copy link

raamdev commented Feb 26, 2015

As of Quick Cache v150129, installing, activating, deactivating, and deleting a plugin does not wipe/clear the cache. This is unexpected behavior; I would expect it to clear the cache upon any of those events, since plugins often make front-end changes.

As of v150129, we have auto-clear handlers for active plugin upgrades, but not for installing, activating, deactivating, deleting plugins.

Related to #308.

Copy link
Contributor Author

raamdev commented Jul 27, 2015

Need to test if this issue is still applicable with the latest version of ZenCache Lite and ZenCache Pro.

Copy link

jaswrks commented Nov 12, 2015


Copy link

jaswrks commented Nov 12, 2015

Next Actions

  • New feature branch in the websharks/zencache-pro repo.

  • After this line add the following:

    add_action('activated_plugin', array($this, 'autoClearOnPluginActivationDeactivation'));
    add_action('deactivated_plugin', array($this, 'autoClearOnPluginActivationDeactivation'));
  • Create a new file in this directory with the name: WcpPluginUtils.php

    namespace WebSharks\ZenCache\Pro;
    * Automatically wipes/clears on plugin activation/deactivation.
    * @since 15xxxx Adding auto-wipe|clear on plugin activations/deactivations.
    * @attaches-to `activated_plugin` hook.
    * @attaches-to `deactivated_plugin` hook.
    * @param string $plugin Plugin basename.
    * @param bool True if activating|deactivating network-wide.
    * @return int Total files wiped|cleared by this routine (if any).
    $self->autoClearOnPluginActivationDeactivation = function ($plugin, $network_wide) use ($self) {
        return $self->{($network_wide ? 'autoWipeCache' : 'autoClearCache')}();
  • Submit PR.

Copy link

jaswrks commented Nov 12, 2015

Assigning this to @renzms :-)

Copy link

renzms commented Nov 17, 2015

@jaswsinc PR submitted! 👍

@raamdev raamdev added this to the Next Release (Pro) milestone Nov 17, 2015
renzms added a commit to wpsharks/comet-cache-pro that referenced this issue Dec 2, 2015
Copy link
Contributor Author

raamdev commented Dec 2, 2015

Next Pro Release Changelog:

  • Enhancement: ZenCache now clears the cache whenever a WordPress plugin is activated or deactivated. Many WordPress plugins change content on the front-end of the site, so this enhancement ensures that an old cache file is never served to visitors. If you want to disable this automatic behavior, see this article. Props @renzms. See Issue #424.

@raamdev raamdev closed this as completed Dec 2, 2015
@wpsharks wpsharks locked and limited conversation to collaborators Dec 21, 2015
Copy link
Contributor Author

raamdev commented Dec 21, 2015

ZenCache Pro v151220 has been released and includes changes worked on as part of this GitHub Issue. See the release announcement for further details.

This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one (#424).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

3 participants