-
Notifications
You must be signed in to change notification settings - Fork 384
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
Optimize : Plugin uninstallation with data #6826
Comments
I wonder if there are plugins that are trying to purge some caches after each
A challenge here is that the object cache can be left populated with data, but better to have stale cache than having data permanently left in the DB. We could also consider obtaining the current Another option would be to obtain all the IDs that we need to delete, then to do a SQL batch |
Another thought is that we could call |
@milindmore22 Something to check is if users get the same error when they have the “uninstall at delete” toggle turned off in the settings. Is the issue the removal of data or that the plugin has a large number of files? |
The user confirmed that by toggling off he is able to delete the AMP plugin. |
@milindmore22 Have you been able to identify a common factor across users who have data deletion failures? Do they have a caching plugin in common, for example? |
I have checked three site info, available with us, they have very few similarities
I have tested, Rank Math SEO, WooCommerce, and Updraftplus plugins and didn't encounter any issue while deleting the AMP plugin. |
Let's go ahead with just doing the SQL In looking at what WooCommerce does, they do SQL |
Hey, I am also facing this issue. Cannot delete the plugin until I turn off that delete all data button. But why I am writing here is because AMP left some children somewhere and cannot find where to remove it. This is the Notice I get from RankMath : SEO Notice: A previously published term has been moved to trash. You may redirect https://example.com/?taxonomy=amp_validation_error&term=a6703459abe929936dadcce26e4f7fe4 Where do I find this to delete it? It really bothers me that notification. Here is the Support UUID : ampwp-d7974cae-5b93-5bb9-9820-74df0166b945 Thank you in advance |
Hello @rfseapp We are working on optimizing the delete data process, which is likely to release with 2.2.1, meanwhile, you can try and use the WP CLI commands or SQL queries mentioned in this reply (Please use those SQL queries at your own risk, also once you execute those queries please clear Site cache and Object Cache) |
In addition to checking the uninstallation visually via the admin, here's a good way to QA the uninstallation by examining the result of the specific SQL wp db export - --extended-insert=FALSE > /tmp/before-uninstall.sql
# Now do uninstall.
wp db export - --extended-insert=FALSE > /tmp/after-uninstall.sql
diff /tmp/before-uninstall.sql /tmp/after-uninstall.sql | cut -c1-200 | egrep '^<' The resulting diff will show the rows that have been deleted from the database. |
QA Passed The AMP-related data is successfully removed after deleting the plugin. I've set up a set of test posts and activated several plugins that cause AMP incompatibilities. Then, I've validated a bunch of posts. The DB dump before uninstalling had over 2000 lines. The dump done after the uninstall had almost 1600 lines which means that AMP related data has been removed. I've also reviewed the after-uninstall DB dump manually and could find a few remaining occurrences of |
Bug Description
We have been receiving support topics mentioning failing to delete data while uninstalling the plugin
I am not able to reproduce the issue, but I doubt that cause maybe the timeout error failing to delete 1000 posts and taxonomies one by one, as in some cases there are plugins that have heavy processing or 50+ plugins on a site creating large number of invalidation record.
Please check the possibility of optimizing the uninstallation process (500 posts?), we can consider executing SQL queries, instead of using
wp_delete_post
andwp_delete_term
Expected Behaviour
Hassle-free Uninstallation process 💯
Screenshots
No response
PHP Version
7.4
Plugin Version
2.2.0
AMP plugin template mode
Transitional, Reader
WordPress Version
5.8.2
Site Health
ampwp-45d67ac7-6236-5036-b88d-8d797b7833cc
Gutenberg Version
12.2.0
OS(s) Affected
all
Browser(s) Affected
all
Device(s) Affected
all
Acceptance Criteria
No response
Implementation Brief
No response
QA Testing Instructions
No response
Demo
No response
Changelog Entry
No response
The text was updated successfully, but these errors were encountered: