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

Only clear site cache when upgrading an active component #327

Closed
raamdev opened this issue Sep 20, 2014 · 3 comments
Closed

Only clear site cache when upgrading an active component #327

raamdev opened this issue Sep 20, 2014 · 3 comments
Labels
Milestone

Comments

@raamdev
Copy link
Contributor

@raamdev raamdev commented Sep 20, 2014

In #145, Quick Cache hooked into upgrader_process_complete to auto-clear the site cache when a component was upgraded. However, it's not always necessary to clear the site cache when upgrading a component:

  • Upgrading an inactive plugin should not clear the site cache
  • Upgrading an inactive theme should not clear the site cache, unless that theme is the parent theme for a currently active child theme.
@raamdev raamdev self-assigned this Sep 20, 2014
@raamdev raamdev added this to the Next Release milestone Sep 20, 2014
@jaswrks
Copy link

@jaswrks jaswrks commented Sep 21, 2014

Example code I have used in the past to check if a plugin is active.

$active_plugins = (is_multisite()) ? wp_get_active_network_plugins() : array();
$active_plugins = array_unique(array_merge($active_plugins, wp_get_active_and_valid_plugins()));

foreach($active_plugins as $active_plugin) // Search.
    if(plugin_basename($active_plugin) === 'bbpress/bbpress.php')
        return true; // bbPress active.
@jaswrks
Copy link

@jaswrks jaswrks commented Sep 23, 2014

I see you chose to use is_plugin_active(). Nice! I didn't know that existed :-)

@raamdev raamdev closed this in 91e712a Sep 25, 2014
@raamdev
Copy link
Contributor Author

@raamdev raamdev commented Sep 25, 2014

Next release changelog:

  • Bug Fix: When an active plugin is updated, or when an active theme or the parent theme for an active child theme is updated, or when WordPress Core is updated, Quick Cache now properly clears the cache to ensure that an outdated cache file does not get served to a visitor. See #145 and #327.
@raamdev raamdev removed their assignment Apr 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants