Repository navigation
Resolve: the plugin deletion error issue on QM - #2115
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Multisite cleanup currently processes only the first 100 sites.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Moves deletion cleanup into WordPress’s isolated uninstall flow and prevents Action Scheduler shutdown errors.
Changes:
- Adds
uninstall.phpfor option/transient cleanup. - Detaches Action Scheduler during plugin deletion.
File summaries
| File | Description |
|---|---|
godam.php |
Replaces uninstall hook with deletion safeguard. |
uninstall.php |
Performs standalone cleanup across sites. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
🔍 WordPress Plugin Check Report
📊 Report
|
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
missing_composer_json_file | The "/vendor" directory using composer exists, but "composer.json" file is missing. |
📁 readme.txt (2 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
mismatched_plugin_name | Plugin name "GoDAM - Organize WordPress Media Library & File Manager with Unlimited Folders for Images, Videos & more" is different from the name declared in plugin header "GoDAM". |
0 |
trademarked_term | The plugin name includes a restricted term. Your chosen plugin name - "GoDAM - Organize WordPress Media Library & File Manager with Unlimited Folders for Images, Videos & more" - contains the restricted term "wordpress" which cannot be used at all in your plugin name. |
📁 assets/build/blocks/godam-gallery-v2/render.php (2 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
15 |
WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound | Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$inner_block_video_ids". |
23 |
WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound | Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$inner_block_video_ids". |
📁 assets/build/css/main.css (1 warning)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
EnqueuedStylesScope | This style is being loaded in all contexts. |
📁 assets/src/libs/analytics.min.js (5 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
EnqueuedScriptsScope | This script is being loaded in all frontend contexts. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880 (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/2026/09/14/hello-world/ (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/sample-page/ (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/demo-attachment-post/ (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead. |
📁 assets/build/js/main.min.js (5 warnings)
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
EnqueuedScriptsScope | This script is being loaded in all frontend contexts. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880 (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/2026/09/14/hello-world/ (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/sample-page/ (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
0 |
NonBlockingScripts.NoStrategy | This script on http://localhost:8880/demo-attachment-post/ (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead. |
🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check
Code review — regression checkReviewed the diff (
A few things worth addressing (none block the fix): 1. Multisite cleanup silently caps at 100 sites — $rtgodam_blog_ids = get_sites( array( 'fields' => 'ids', 'number' => 0 ) );2. Guard removes only one of AS's two shutdown callbacks — 3. Minor: the closure in Nice, well-documented fix overall — the isolation rationale in both files is very clear. 👍 |
Fix: Plugin deletion error (502 / "Deletion failed") when GoDAM is deleted
Closes #1146
Problem
Deleting the GoDAM plugin threw an error — a
502 Bad Gateway(openresty), or under Query Monitor a "Deletion failed: … ClassActionScheduler_Locknot found" — even though the plugin was actually removed (a page refresh confirmed it). Other plugins deleted cleanly; only GoDAM failed.Root cause
GoDAM cleaned up on delete via
register_uninstall_hook(), which makes WordPress include and fully bootstrapgodam.phpduring deletion — loading the bundled WooCommerce Action Scheduler and registering itsshutdowncallback / autoloaders. WordPress then deletes the plugin's files, so onshutdownthose now-dangling references fatally autoload classes that no longer exist. Query Monitor appends that fatal to the delete AJAX response (corrupting the JSON), and on buffered servers the FPM worker dies before the response flushes, returning a 502.Fix
uninstall.php. WordPress runs it in isolation (withWP_UNINSTALL_PLUGINdefined) and does not bootstrap the plugin, so Action Scheduler is never loaded during deletion and no dangling references exist atshutdown. Moved the option cleanup here and removedregister_uninstall_hook().delete_pluginguard ingodam.phpthat detaches Action Scheduler'sshutdowndispatch as a safety net for the case where GoDAM is loaded during the delete request.Testing
{success:true}and removes immediately — no fatal, no 502, no refresh needed.Changed files
godam.phpuninstall.php(new)Demo