Opened 2 years ago
Last modified 3 weeks ago
#62212 new defect (bug)
Plugin update via modal does not update plugins list until page reload
| Reported by: | siliconforks | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Plugins | Version: | 6.5 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | administration |
Description
If you visit the "Plugins" page in the admin section and there is a plugin update available, the following text will be displayed:
There is a new version of [the plugin's name] available. View version [the plugin's latest version] details or update now.
If you click the "View version ... details" link, a modal dialog box (using an iframe) will be displayed with a button to perform the update.
Before WordPress 6.5, this button was labeled "Install Update Now". If you clicked the button, the modal would close, the text on the main page would change to "Updating..." and then finally this text would change to "Updated!" when the update was completed.
In WordPress 6.5 and later, the button is labeled "Update Now" (and has a different appearance). If you click the button, the modal does not close, but the text on the button changes to "Updating..." and then finally "Updated!" If you close the modal, you will see that the main page has not changed at all: the plugin still displays the old version with the same "There is a new version of [the plugin's name] available..." text. You have to manually reload the page in order to see that the plugin has been updated to the new version.
Is this behavior intentional? Probably the change in the button label and appearance was intentional (but that's not very important). Keeping the modal open during the update might be intentional (although I preferred the old behavior). But failing to update the main page seems like a bug, or at least a significant regression in functionality compared to earlier versions.
Attachments (1)
Change History (8)
#2
@
15 months ago
- Keywords needs-patch added
Reproduction Report
Description
✅ This report validates that the issue can be reproduced.
Environment
- WordPress: 6.8.2
- PHP: 8.4.10
- Server: nginx/1.26.1
- Database: mysqli (Server: 8.0.35 / Client: mysqlnd 8.4.10)
- Browser: Chrome 139.0.0.0
- OS: Windows 10/11
- Theme: ModernPress 1.0.0
- MU Plugins: None activated
- Plugins:
- Test Reports 1.2.0
- WP Crontrol 1.19.1
Testing Instructions
- Install a plugin where a new version is available.
- Navigate to Plugins > Installed Plugins in the admin.
- Click the "View version … details" link for the plugin update.
- In the modal popup, click the Update Now button.
- Wait for the button state to change from Updating… to Updated!.
- Close the modal.
Actual Results
- ✅ Error condition occurs (reproduced).
- After closing the modal, the plugins list still shows the old version along with the “There is a new version…” update notice.
- The page must be manually refreshed to display the updated version.
Additional Notes
In previous versions (≤ 6.4), the modal would close after clicking Install Update Now, and the list table was updated automatically without a manual reload.
#3
@
15 months ago
- Focuses administration added
- Summary If you update a plugin from the details modal, it no longer updates the main page → Plugin update via modal does not update plugins list until page reload
This ticket was mentioned in PR #14289 on WordPress/wordpress-develop by @dlocc.
5 weeks ago
#4
- Keywords has-patch added; needs-patch removed
Updating a plugin from the "View details" modal on the Plugins screen leaves the list out of date. The modal shows "Updated!", but after closing it the row still shows the old version and the update notice, and the update counts don't change until you reload.
Since 6.5 the update runs inside the modal's iframe. When it finishes, the iframe posts an updated-plugin message to the parent window, but the parent only uses it to update plugin cards on the Add Plugins screen.
This PR:
- Adds the plugin file and the old and new versions to the
updated-pluginmessage. - Updates the plugin's row on the Plugins screen when that message arrives, matching what the inline "update now" link does.
- Decrements the update counts on any screen that opens the modal. Add Plugins and Dashboard > Updates had the same stale counts.
- Removes the click handler for
#plugin_update_from_iframe. Nothing has output that ID since 6.5 (comment:1 on the ticket).
The modal still stays open and shows "Updating..." then "Updated!", same as 6.5. The parent doesn't call wp.updates.updatePluginSuccess() or trigger wp-plugin-update-success, so screen readers don't hear "Update completed successfully." twice, and a bulk update notice in progress on the same screen doesn't count the modal update.
Testing Instructions
- Install an older version of a plugin, for example
npm run env:cli -- plugin install classic-editor --version=1.6.3 --force. - Go to "Plugins > Installed Plugins" and click "View version 1.7.0 details" in the update notice.
- Click "Update Now" in the modal and wait for "Updated!".
- Close the modal.
- Before: the row still shows 1.6.3 with the update notice, and the counts still show 1. After: the row shows 1.7.0 with an "Updated!" notice, and the counts are cleared.
- Repeat from a plugin card's "More Details" on "Plugins > Add Plugin" and from "View version details" on "Dashboard > Updates". The update counts should drop after closing the modal.
The inline "update now" link on the Plugins screen works the same as before. I haven't tested the network admin Plugins screen yet. It uses the same code path (plugins-network).
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Tracing the cause, writing the patch, and scripted browser testing (Playwright) against a local wordpress-develop environment. I reviewed the code and the test results before submitting.
#5
@
5 weeks ago
Hey all, I submitted the following PR: https://github.com/WordPress/wordpress-develop/pull/14289
Summary of fix: Since 6.5 the update runs inside the modal's iframe and posts an updated-plugin message to the parent window, but the parent only uses it to update plugin cards on the Add Plugins screen. The PR sends the plugin file and versions along with that message, updates the row on the Plugins screen, and decrements the update counts on every screen that opens the modal. It also removes the dead #plugin_update_from_iframe handler mentioned in comment:1.
The modal still stays open and shows "Updated!", same as 6.5.
Tested on trunk (7.2-alpha) in Chromium from the Plugins, Add Plugins, and Dashboard > Updates screens.
@
4 weeks ago
Before/after PR 14289: after updating Classic Editor from the details modal, the row and update counts now update without a reload
#6
@
4 weeks ago
Test Report
Patch tested: https://github.com/WordPress/wordpress-develop/pull/14289
Environment
- WordPress: 7.2-alpha-63166-src
- Subdirectory: No
- PHP: 8.3.35
- Server: nginx/1.31.7
- Database: mysqli (Server: 9.7.2 / Client: mysqlnd 8.3.33)
- Browser: Chrome 155.0
- OS: macOS
- Theme: Twenty Twenty-Five 1.5
- MU Plugins:
- Fix Docker Loopback Requests 1.0.0
- Plugins: None activated
Steps taken
- Install an older version of a plugin so an update is available (Classic Editor 1.6.5; 1.7.0 is available).
- Go to Plugins > Installed Plugins.
- Click "View version 1.7.0 details" in the update notice.
- Click "Update Now" in the modal and wait for "Updated!".
- Close the modal.
- ✅ Patch is solving the problem
Expected result
- The plugin row shows the new version, the update notice is gone, and the update counts decrease.
Additional Notes
- Before the patch (trunk 518cd6524d): the update finishes (1.7.0 on disk), but after closing the modal the row still shows "Version 1.6.5" with the update notice, and the Plugins menu and toolbar update counts still show 1 until the page is reloaded.
- With the patch (after
npm run build:dev): the row shows "Version 1.7.0" with an "Updated!" notice, and both update counts are cleared. No console errors. - This is a regression from [57545] (#22316, WordPress 6.5), which removed
#plugin_update_from_iframefrom the modal. - Not tested: the Add Plugins and Dashboard > Updates screens, and multisite Network Admin.
- AI assistance: Yes (Tool(s): Claude Code; Model(s): Opus 5.5; Used for: Setting up the test site, driving the browser steps, taking the screenshots and drafting this report; I reviewed the results and the screenshots myself.)

Note that the old JavaScript code for handling the click on the "Install Update Now" button was never removed - it is still present in 6.5 and later (including the latest trunk version), even though the code never gets executed any more.
https://github.com/WordPress/wordpress-develop/blob/6e7acb0103ce64bcd0b66d22cb0efb6249028004/src/js/_enqueues/wp/updates.js#L3212
That is just dead code now, since the
plugin_update_from_iframeID no longer exists.