Make WordPress Core

Opened 11 years ago

Last modified 4 weeks ago

#29798 new feature request

unified theme and plugin uploader

Reported by: svenl77's profile svenl77 Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch good-first-bug needs-testing
Focuses: administration Cc:

Description

Hi,

many users try to install plugins as themes and than they get a message stylesheet missing.

"The theme is missing the style.css stylesheet"

The same with installing themes as plugins.

"The package could not be installed. No valid plugins were found."

I think it would make it much easier for the people to make the upload unified and check the header to find out if its a theme or plugin and than just redirect to the correct page after the instal.

Or at least add a message "This is a plugin please go to this page to install it" and "This is a Theme please go to this page to install it"

Attachments (1)

29798.diff (3.0 KB) - added by mattyza 10 years ago.
First pass at adding detection, and notices, if a theme is uploaded to the plugins uploader and visa versa.

Download all attachments as: .zip

Change History (19)

#1 @joedolson
11 years ago

  • Focuses administration added; accessibility removed

#2 follow-up: @DrewAPicture
11 years ago

  • Keywords close added
  • Type changed from enhancement to feature request

There is some discussion going on to improve at least the plugin installation process in 4.1. I don't think we'll be combining the workflows any time soon.

#3 @mattyza
10 years ago

Perhaps a lean solution to mitigate this issue would be to educate the user when they upload to the correct form.

While we could certainly take care of the upload correctly for them in the background (calling the theme uploader if we detect a theme in the plugins uploader, for example), this doesn't help to educate the user about what they've done incorrectly (so they'll learn the incorrect behaviour and just repeat it, because it gets the results they desire).

Perhaps a simple tweak to the error response messages, directing the user to the correct form, is a simple solution which can be forward-compatible as well.

cc @DrewAPicture @svenl77

@mattyza
10 years ago

First pass at adding detection, and notices, if a theme is uploaded to the plugins uploader and visa versa.

#4 @mattyza
10 years ago

For what it's worth, I attempted linking to the theme and plugin installers respectively, yet WP_Error strips out the HTML.

#5 @wonderboymusic
10 years ago

  • Keywords needs-patch added; close removed

#6 in reply to: ↑ 2 @desrosj
3 years ago

  • Keywords has-patch needs-refresh good-first-bug added; needs-patch removed
  • Milestone set to Future Release

Replying to DrewAPicture:

I don't think we'll be combining the workflows any time soon.

This is still accurate today. However, I think that adding an error message for the user informing them that they're in the wrong location is a reasonable change.

This ticket was mentioned in PR #8913 on WordPress/wordpress-develop by @nimeshatxecurify.


6 months ago
#7

  • Keywords needs-refresh removed

Added a check for package type (plugin / theme) before further processing while plugin & theme web upload. Display appropriate message and hyperlink (for better UX).

Trac ticket: WordPress Trac ticket #29798

This ticket was mentioned in Slack in #core by nimeshatxecurify. View the logs.


5 months ago

This ticket was mentioned in Slack in #core by benjamin_zekavica. View the logs.


5 months ago

@karmatosed commented on PR #8913:


5 months ago
#10

@nimesh-xecurify can you share some visual screenshots what your PR does against the existing one please?

This ticket was mentioned in Slack in #core-test by sirlouen. View the logs.


4 months ago

#13 @SirLouen
4 months ago

  • Keywords needs-testing added

#14 @iamshashank
4 months ago

Test Report

Description

✅ This report validates that the indicated patch works as expected.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/8913

Environment

  • WordPress: 6.8.2
  • PHP: 8.2.27
  • Server: nginx/1.26.1
  • Database: mysqli (Server: 8.0.35 / Client: mysqlnd 8.2.27)
  • Browser: Chrome 138.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Three 1.6
  • MU Plugins:
    • Local WP Live Link Helper 2.0
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ✅ Issue resolved with patch.

Screenshots

  • Before:
  • https://ibb.co/zhct5z7p
  • https://ibb.co/WWHXFddh
  • After:
  • https://ibb.co/5qVHPFk
  • https://ibb.co/fGtCk1ff

@circlecube commented on PR #8913:


3 months ago
#15

I tested this and reproduced the issue where uploading a plugin or theme to the theme or plugin page (respectively) gives an error in core:
https://github.com/user-attachments/assets/509be256-c9f1-4827-bd60-3d336254cae0
Upload plugin as theme error.
https://github.com/user-attachments/assets/126a3437-1e9d-4c54-9e08-cbf2101d9b18
Upload theme as plugin error.

This patch adds code that adds a check to see if the upload is a plugin or theme, and if so, provides a link to the plugin/theme page to upload the zip there. The patch does look to work in my testing, redoing the above in the patched playground:
https://github.com/user-attachments/assets/938e9aa4-dae9-4199-82d0-355d33b35b6d
Patched upload plugin as theme error with link to upload a plugin.
https://github.com/user-attachments/assets/08ec60d0-ccb3-4e1a-aec4-ade929a23388
Patched upload theme as plugin error with link to upload a theme.

I'm not sure if this code is run in every case or only when it detects there is an error with the uploaded zip. Ideally, we don't add this check when the file is as expected, for example, when a plugin zip is uploaded and a plugin zip is expected, it shouldn't also check if it's a theme. Also, I'm not entirely sure why the additional $environment value is added to the check_package method. Is this to be used in other cases?

I also tested uploading a non-plugin/theme zip file, and continue to see the original errors in those cases. The updated error is displayed only when the zip is found to be a plugin or theme that is uploaded in the wrong context.

This ticket was mentioned in Slack in #core by nimeshatxecurify. View the logs.


5 weeks ago

This ticket was mentioned in Slack in #core by amykamala. View the logs.


4 weeks ago

#18 @noruzzaman
4 weeks ago

Test Report

Description

This report validates whether the indicated patch works as expected.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/8913

Environment

  • WordPress: 6.8.3
  • PHP: 8.2.27
  • Server: Apache/2.4.43 (Unix)
  • Database: mysqli (Server: 8.0.35 / Client: mysqlnd 8.2.27)
  • Browser: Chrome 141.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.3
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ✅ Issue resolved with patch.

Screenshots

Before After
https://i.ibb.co.com/Mxr27N7x/577387456-725526156542509-6680570229628276705-n.png https://i.ibb.co.com/5XzRf0d3/575912849-1877833206449579-7435461242946745837-n.png
Before After
https://i.ibb.co.com/rRRvgCsG/576766019-2275902029501238-8010553695636074505-n.png https://i.ibb.co.com/QvkcbLxw/576514705-1505530550734174-6074090271354669213-n.png
Last edited 4 weeks ago by noruzzaman (previous) (diff)
Note: See TracTickets for help on using tickets.