Plugins: offer to replace an installed plugin instead of rejecting the upload - #113944
Draft
escapemanuele wants to merge 1 commit into
Draft
Plugins: offer to replace an installed plugin instead of rejecting the upload#113944escapemanuele wants to merge 1 commit into
escapemanuele wants to merge 1 commit into
Conversation
…e upload Uploading a zip whose plugin folder already exists fails with `folder_exists`, and the install screen's only way out was to send the customer to wp-admin. Most of them are trying to update a plugin they already have. Route the upload to /plugins/replace when a slug is supplied, retain the zip so the retry can re-send it, and offer the replace on the error screen with the installed and uploaded versions when the API reports them. Falls back to the existing rejection when either is missing.
|
WordPress.com
Automattic for Agencies
|
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~795 bytes added 📈 [gzipped]) Details
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~256 bytes added 📈 [gzipped]) Details
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes https://linear.app/a8c/issue/DOTCOM-18352/uploading-a-newer-zip-of-an-installed-plugin-is-rejected-outright-and
Proposed Changes
Uploading a zip for a plugin the site already has now offers to replace it, instead of dead-ending on an error.
/plugins/replacewhen a slug is given, and keeps the zip around so the replace can re-send it.Why are these changes being made?
WordPress refuses to unpack a plugin zip over a folder that already exists. Until now that ended the flow: the customer was told the upload failed and pointed at wp-admin to do it by hand.
Most of them were not installing something new — they were updating a plugin they already had. Over five days, 674 sites hit this error 4,223 times, and two thirds of the plugins installed afterwards were ones the site already had (DOTCOM-18352).
Testing Instructions
yarn start, open/plugins/upload/:siteon a Business-plan site and install any plugin zip.