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

Cache directory is not removed when deleting plugin (Deactivation Safeguards disabled) #261

Closed
raamdev opened this issue Aug 4, 2014 · 11 comments
Assignees
Milestone

Comments

@raamdev
Copy link
Contributor

raamdev commented Aug 4, 2014

If Deactivation Safeguards are disabled and Quick Cache is deactivated and deleted, the cache directory remains:

wp-content/cache/quick-cache/cache

This is confusing for some users who expect Quick Cache to be "completed erased" as the Deactivation Safeguards section says it will.

I have confirmed this bug exists in Quick Cache (LITE) and Quick Cache Pro v140725.


Reported here: http://wordpress.org/support/topic/cache-folder-remains-after-uninstall?replies=1#post-5855867

@jaswrks
Copy link

jaswrks commented Aug 5, 2014

@raamdev Would looking closer at this also be a good opportunity to move QC over to the uninstall hook as well? Or do you prefer to keep the same implementation and just look closer at what might be causing this?

@raamdev
Copy link
Contributor Author

raamdev commented Aug 5, 2014

@jaswsinc If you're up for it, moving QC over to the uninstall hook would be great. But it's up to you really. :) This isn't a high-priority item for me, that's why I didn't assign it to the Next Release milestone, but if you feel like working on it that would be awesome!

@jaswrks jaswrks self-assigned this Aug 5, 2014
@jaswrks
Copy link

jaswrks commented Aug 5, 2014

Sure :-) I will be happy to have a look at this. Assigning this to myself.

@jaswrks
Copy link

jaswrks commented Aug 5, 2014

This behavior where Quick Cache does not erase everything on deactivation seems related to Multisite vs. Single Site WordPress installations, and also related to the most recent changes in the cache directory structure. Taking a closer look at this now.

An uninstall hook will help us deal with this scenario better also.

jaswrks pushed a commit to wpsharks/comet-cache-pro that referenced this issue Aug 5, 2014
jaswrks pushed a commit that referenced this issue Aug 5, 2014
jaswrks pushed a commit to wpsharks/comet-cache-pro that referenced this issue Aug 5, 2014
jaswrks pushed a commit that referenced this issue Aug 5, 2014
This was referenced Aug 5, 2014
@jaswrks
Copy link

jaswrks commented Aug 5, 2014

This has been resolved in the feature/261 branch.

@jaswrks
Copy link

jaswrks commented Aug 5, 2014

2014-08-05_13-01-59

In addition to this bug being fixed, Quick Cache now has a dedicated uninstall.php file to deal specifically with the plugin deletion action in WordPress. This is also in the feature/261 branch.

@jaswrks
Copy link

jaswrks commented Aug 5, 2014

I should also note that the Quick Cache deactivation handler remains. The new uninstall action handler is attached only to the plugin deletion action within WordPress.

Deactivation of the plugin now has no configurable options. The configurable option "Plugin Deletion Safeguards" in the Dashboard controls the behavior associated with plugin deletion only.

  • It's pretty obvious what plugin deletion does. It erases the plugin completely; everything.
  • Deactivation of the plugin will "clear" the cache, disable WP_CACHE in the /wp-config.php file and empty (but not delete) the advanced-cache.php file. Effectively deactivating Quick Cache in every way, but retaining the ability for Quick Cache to easily be reactivated without issue.

@raamdev
Copy link
Contributor Author

raamdev commented Aug 5, 2014

@jaswsinc Awesome. Thanks so much for taking care of this!

While reviewing the code I noticed that there didn't seem to be anything that cleaned up the WordPress database of any values that may be left behind by the plugin. It's possible I missed an update from WordPress somewhere where this is handled automatically but, if I recall correctly, unless we remove any plugin options using delete_option(), those options will remain in the database.

@jaswrks
Copy link

jaswrks commented Aug 5, 2014

No sweat! :-) Happy to help 😃

The plugin options are stored in a single array via WP options. They get deleted here.

@raamdev
Copy link
Contributor Author

raamdev commented Aug 5, 2014

Ah, not sure how I missed that. ;) Thanks!

@raamdev
Copy link
Contributor Author

raamdev commented Aug 6, 2014

Closed by PR #265.

@raamdev raamdev closed this as completed Aug 6, 2014
@raamdev raamdev added this to the Next Release milestone Aug 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants