Repository navigation
Plugins: Update the Plugins screen after updating a plugin from the details modal - #14289
DevinWalker wants to merge 2 commits into
Conversation
…etails modal. Since WordPress 6.5, updating a plugin from the "View details" modal runs the update inside the modal's iframe. The modal shows "Updated!", but the screen behind it never finds out. The Plugins list keeps showing the old version and the update notice, and the update counts in the admin menu, Toolbar, and "Update Available" filter stay the same until the page is reloaded. The existing `updated-plugin` message sent to the parent window now includes the plugin file and the old and new versions. The parent uses it to update the plugin's row on the Plugins screen, the same way the inline "update now" link does, and to decrement the update counts on any screen. This also removes the click handler for `#plugin_update_from_iframe`, which has not matched any element since 6.5. See #62212.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
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-pluginmessage to the parent window, but the parent only uses it to update plugin cards on the Add Plugins screen.This PR:
updated-pluginmessage.#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 triggerwp-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.Trac ticket: https://core.trac.wordpress.org/ticket/62212
Before and after
After updating Classic Editor from 1.6.3 to 1.7.0 in the "View details" modal and closing it:
Testing Instructions
npm run env:cli -- plugin install classic-editor --version=1.6.3 --force.The inline "update now" link on the Plugins screen works the same as before. I tested all of the above on single site and on multisite, using the matching Network Admin screens.
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.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.