Make WordPress Core

Opened 2 months ago

Closed 7 weeks ago

#60578 closed enhancement (fixed)

When plugin upload fails, add a link to return to plugin installer page

Reported by: presskopp's profile Presskopp Owned by: desrosj's profile desrosj
Milestone: 6.6 Priority: normal
Severity: normal Version:
Component: Upload Keywords: has-patch commit
Focuses: administration Cc:

Description (last modified by swissspidy)

When for any reason a plugin upload fails (Only .zip archives may be uploaded. / Incompatible Archive.) you will be confronted with an error and there is no way out. Of course, you can use the browser's built-in back button, but still it would be nice to offer an additional link "Go to Plugin Installer" or "Back to Plugin Installer" (leading to wp-admin/plugin-install.php)

Attachments (3)

60578.patch (1.0 KB) - added by pmbaldha 8 weeks ago.
Patch file
Screenshot 2024-03-07 at 10.06.58 AM.png (38.0 KB) - added by aneeshd16 7 weeks ago.
Test report for patch 60578
60578.diff (1.1 KB) - added by desrosj 7 weeks ago.

Download all attachments as: .zip

Change History (22)

#1 @Presskopp
2 months ago

Oops I crashed the formatting, sorry.

#2 @swissspidy
2 months ago

  • Description modified (diff)
  • Focuses administration added
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

Sounds reasonable to me.

#3 @smub
2 months ago

+1 - I agree this would definitely help improve UX for beginners & non-techy users. I wonder if there are other error screens like these without an action link that can benefit from it.

#4 @pmbaldha
8 weeks ago

This feature is already implemented in the current WordPress core.
https://nimb.ws/cqlrgOv

#5 @swissspidy
8 weeks ago

@pmbaldha This ticket is about the error message you get when the file is invalod. For example, try renaming a TXT file to ZIP und upload that. You‘ll get an error message without a back button

@pmbaldha
8 weeks ago

Patch file

#6 @pmbaldha
8 weeks ago

@swissspidy Can you please verify and test the attached patch file? Thanks Swiss!

#7 @swissspidy
8 weeks ago

  • Keywords has-patch needs-testing added; needs-patch removed

#8 @pmbaldha
8 weeks ago

@smub I have opened the ticket https://core.trac.wordpress.org/ticket/60644 for the theme installation fails error screen.

#9 @swissspidy
8 weeks ago

No need for a separate ticket, we can do that here, especially since the PR already does that.

#10 @swissspidy
8 weeks ago

#60644 was marked as a duplicate.

#11 @pmbaldha
8 weeks ago

@swissspidy 

This ticket is for an invalid zip file uploaded. Screenshot: https://nimb.ws/hItAqJb. This issue is resolved by this PR.

The other ticket is for the uploaded valid zip file, which is not a valid theme file. Screenshot: https://nimb.ws/GqC3Y17. This issue is not resolved in this PR.

I know that we shouldn't write duplicate tickets. 

so, both issues are different. Can you please reopen the other ticket?

#12 @swissspidy
8 weeks ago

I see, thanks for clarifying. Still, I think we can address this together to make the error messaging consistent. Should be a trivial addition to the existing PR.

#13 @pmbaldha
8 weeks ago

I have debugged the issue on another ticket. The code exists in the codebase, but it is not working. It is not a trivial addition to existing PR.

The other ticket requires a different set of test instructions too.

Let me know what the next step is.

#14 @swissspidy
8 weeks ago

If you feel strongly about it I'll just reopen it.

@aneeshd16
7 weeks ago

Test report for patch 60578

#15 @aneeshd16
7 weeks ago

Test Report

Description

This report validates whether the indicated patch works as expected.

Patch tested: https://core.trac.wordpress.org/attachment/ticket/60578/60578.patch

Environment

  • WordPress: 6.5-RC1
  • PHP: 8.0.30-dev
  • Server: PHP.wasm
  • Database: WP_SQLite_Translator (Server: 5.5 / Client: 3.40.1)
  • Browser: Chrome 122.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-One 2.1
  • MU Plugins:
    • 0-allow-wp-org.php
  • Plugins:
    • SQLite Database Integration 2.1.6
    • Test Reports 1.1.0

Actual Results

  1. ✅ Issue resolved with patch.

Additional Notes

  • Tested this by uploading an invalid zip file. Renamed a different file as a zip file.

Supplemental Artifacts

https://core.trac.wordpress.org/raw-attachment/ticket/60578/Screenshot%202024-03-07%20at%2010.06.58%E2%80%AFAM.png

#16 @desrosj
7 weeks ago

  • Milestone changed from Future Release to 6.6
  • Owner set to desrosj
  • Status changed from new to reviewing

#17 @desrosj
7 weeks ago

  • Component changed from Plugins to Upload

@desrosj
7 weeks ago

#18 @desrosj
7 weeks ago

  • Keywords commit added; needs-testing removed

I made some very small adjustments, but this looks good. Thanks!

#19 @desrosj
7 weeks ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 57786:

Upload: Add links back to installer pages.

This adds a link back to the plugin or theme installers when an incompatible archive error message is encountered.

Props Presskopp, swissspidy, smub, pmbaldha, aneeshd16.
Fixes #60578.

Note: See TracTickets for help on using tickets.