Supersedes #108823.
Related Issues
Proposed Changes
Improve error handling / display of large plugin uploads:
| Before |
After |
 |
 |
- Add an
onFileTooLarge callback prop to UploadDropZone so consumers can handle oversized files differently from the default generic error notice
- In the plugin upload page, catch oversized files client-side and show an inline warning (using the
Notice component) with a link to re-upload via WP Admin, instead of a plain text error notice that provides no guidance
- Update the data layer error message from the hardcoded “10MB” to dynamically derive the size from
MAX_UPLOAD_ZIP_SIZE, so the message stays accurate if the limit changes
- Theme uploads continue to show the existing generic error notice (backwards compatible)
Why are these changes being made?
When uploading a plugin zip exceeding 50 MB, the UploadDropZone component catches it client-side and shows a plain text error notice: “Zip file is too large. Please upload a file under 50 MB.” This provides no guidance on what the user should do instead.
The marketplace install page had a dedicated pluginTooBig error screen with a WP Admin link, but it was only reachable via a server-side 413 response — which can no longer occur now that the client and server limits are both 50 MB.
This change intercepts oversized files on the plugin upload page and shows an inline warning with a direct link to WP Admin’s plugin upload page, keeping the user on the same page so they can also try uploading a smaller file.
Additionally, the data layer’s “too large” error message still said “10MB” (hardcoded from when the server limit was lower). This is updated to use the MAX_UPLOAD_ZIP_SIZE constant.
Testing Instructions
- Get a plugin zip file larger than 50 MB. You can use one from https://drive.google.com/drive/folders/1N5gEZtK62CzH-L2zjRXwgf6mJglF22S2?usp=sharing.
- Build the app locally with
yarn && yarn start or use the Calypso Live link below.
- Go to
/plugins/upload/{site-slug} and upload the plugin zip.
- Verify that an inline warning notice appears above the dropzone with a “Go to WP Admin” link. The link should work correctly.
- Verify the dropzone remains usable below the warning (user can try a smaller file).
How AI was used in this PR
Claude Code implemented the initial plan and iterated on the approach (switching from a marketplace install page redirect to an inline Notice component, cleaning up dead code paths, using dynamic size constants) based on my feedback and code review. I have reviewed the whole generated code myself and with Copilot as well.
Pre-merge Checklist
- Have you checked for TypeScript, React or other console errors?
- Has the general commit checklist been followed? (PCYsg-hS-p2)
- Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
- Have you tested accessibility for your changes?
Unfortunately, no screenshots were provided by the developer.