Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#50593 closed defect (bug) (fixed)

Check requirements when uploading a plugin/theme by ZIP

Reported by: mariovalney Owned by: SergeyBiryukov
Priority: normal Milestone: 5.5
Component: Upgrade/Install Version: 5.4.2
Severity: normal Keywords: has-patch
Cc: Focuses: docs

Description

From 9757 we agree uploading a plugin should check PHP required version.

We already check the package is a valid plugin and I think we can add both verifications: Requires PHP and Requires at least. And extend it to themes.

Attachments (1)

48666.diff​ (4.9 KB ) - added by audrasjb 6 years ago.
Upgrade/Install: Link HelpHub documentation about PHP and WordPress upgrade after failed plugins and themes upgrade attempts

Download all attachments as: .zip

Change History (13)

#1 @SergeyBiryukov
6 years ago

  • Milestone Awaiting Review → 5.5

This ticket was mentioned in ​PR #401 on ​WordPress/wordpress-develop by ​mariovalney.


6 years ago
#2

  • Keywords has-patch added; needs-patch removed

Add PHP/WP version validation to upload ZIP packages.
Support to theme and plugins.

Ticket: https://core.trac.wordpress.org/ticket/50593

#3 @mariovalney
6 years ago

  • Keywords needs-design needs-unit-tests added

Added a PR with validation to themes and plugins.
I'm using the same strings from 9757 to keep UX.

I guess we can improve this UI at least with the link do HelpHub like @desrosj suggested (wp_get_update_php_url / wp_get_default_update_php_url / wp_get_update_php_annotation).

Maybe keep version string in another line?


Here are prints for each case:

PHP Version for Plugin
https://i.imgur.com/Eoi9eIZ.png

WP Version for Theme
https://i.imgur.com/bedGCVw.png

Last edited 6 years ago by mariovalney (previous) (diff)

#4 @SergeyBiryukov
6 years ago

  • Owner set to SergeyBiryukov
  • Status new → reviewing

#5 @SergeyBiryukov
6 years ago

In 48666:

Upgrade/Install: Check WordPress and PHP version requirements when uploading a plugin or theme from ZIP file.

Props mariovalney, desrosj.
See #50593.

#6 in reply to: ↑ description @SergeyBiryukov
6 years ago

  • Keywords needs-patch added; needs-screenshots has-patch needs-design needs-unit-tests removed
  • Milestone 5.5 → 5.5.1

Replying to mariovalney:

(@desrosj suggests) When the PHP or WordPress requirements are not met, can we link to the HelpHub so that the user has some direction: Maybe this page: ​https://wordpress.org/support/update-php/?

Let's address this in 5.5.1.

@audrasjb
6 years ago

Upgrade/Install: Link HelpHub documentation about PHP and WordPress upgrade after failed plugins and themes upgrade attempts

#7 @audrasjb
6 years ago

  • Focuses docs added
  • Keywords has-patch added; needs-patch removed

Added HelpHub links as per @SergeyBiryukov ’s previous comment.

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


6 years ago

This ticket was mentioned in ​Slack in #core-auto-updates by audrasjb. ​View the logs.


6 years ago

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


6 years ago

#11 @SergeyBiryukov
6 years ago

  • Keywords commit added

#12 @SergeyBiryukov
6 years ago

  • Keywords commit removed
  • Milestone 5.5.1 → 5.5
  • Resolution → fixed
  • Status reviewing → closed

48666.diff​ doesn't seem to work as expected in my testing:

  • WP_Upgrader_Skin:error() runs the message through esc_html( strip_tags( ... ) ), so any links are stripped. That was likely added for a reason, so I'm not very comfortable with changing that in a minor release.
  • I think the message should use the checks and functions used for similar messages elsewhere: current_user_can( 'update_php' ), wp_get_update_php_url(), wp_get_update_php_annotation().

Going to re-close this as fixed in 5.5. Created #51152 for addressing the remaining bits.

Note: See TracTickets for help on using tickets.