Making WordPress.org

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#4699 closed enhancement (fixed)

Provide compatible WP core updates depending on server PHP version from API

Reported by: afragen's profile afragen Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: Priority: normal
Component: API Keywords: servehappy
Cc:

Description (last modified by SergeyBiryukov)

There has been discussion regarding having users of older versions of WP be able to update to the best version of WP core that their server configuration can run. This seems to be primarily limited by the PHP version. Please refer to #WP47797 for background.

Currently, if a user is running a version of PHP < 5.6.20 they can only install up to WP 5.1.x. However, the Update Now button will try to install the most current version of WP core, WP 5.2.2 at this moment. Unfortunately that results in a failure and there is no easy method of being able to upgrade to a best version.

Part of the discussion, especially in Slack, was that in lieu of needing to backport the patch in #WP47797 it would be more robust to modify the API to return a similar response.

A best version would correspond to the the most current version of WP that is capable of running/installing given the user's current server constraints.

The patch for #WP47797 works by taking the API response for something like, https://api.wordpress.org/core/version-check/1.7/?php=5.3 and changes the { "response": "upgrade" } to the offer that has the highest version that is less than or equal to the ?php=5.x query arg.

There are 3 obvious benefits.

  1. Users will be able to update to a more secure version of WP, in this case WP 5.1.x, with one click.
  2. WP 5.1.x includes the dashboard callout for updating to a more current version of PHP.
  3. This would reach every version of WP > 3.7 without the need for backporting.

Pinging @azaozz and @sergeybiryukov

Attachments (1)

Screen Shot 2019-10-17 at 12.33.30 pm.png (229.5 KB) - added by dd32 5 years ago.
User Experience for a WP 4.9 + PHP 5.3 user after an API change.

Download all attachments as: .zip

Change History (11)

#1 @SergeyBiryukov
5 years ago

  • Description modified (diff)

#2 @SergeyBiryukov
5 years ago

  • Owner set to SergeyBiryukov
  • Status changed from new to accepted

#3 @SergeyBiryukov
5 years ago

Thanks for the ticket!

Discussed this with the Meta team yesterday, the approach seems good so far. A patch is ready, testing it might take some time though, as that API is not open-sourced.

#4 @afragen
5 years ago

Great! If this approach works we can close #WP47797

#5 @desrosj
5 years ago

@SergeyBiryukov Is there any update on the status of this one?

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


5 years ago

@dd32
5 years ago

User Experience for a WP 4.9 + PHP 5.3 user after an API change.

#7 @dd32
5 years ago

  • Keywords needs-patch 2nd-opinion removed
  • Resolution set to fixed
  • Status changed from accepted to closed

I've made an API change which returns multiple versions for users on WordPress 3.7~5.1 running PHP 5.2.4~5.6.20.

We can make a similar addition for when PHP 5.6 support is dropped (It won't be automatic, as I hard-coded the PHP and WP versions)

The above attachment shows the experience, it's not fantastic especially as the string in core doesn't expect that this could ever occur.
I figured showing both would at least allow the user to update to a recent WordPress, while at the same time also making it clear there's a newer version of WordPress that has a more modern PHP requirement.

Fixed via r15417-dotorg:

API: Core Update endpoint: Offer WordPress 5.1.x as an update destination for < 5.1.latest and PHP 5.2.4~5.6.19 users.

#8 follow-up: @afragen
5 years ago

  • Keywords needs-patch 2nd-opinion added

@dd32 thanks very much this is fabulous. I wonder if there's a way to hook into the servehappy API to get the minimium PHP version so it doesn't need to be hard coded..

#9 @afragen
5 years ago

  • Keywords needs-patch 2nd-opinion removed

#10 in reply to: ↑ 8 @dd32
5 years ago

Replying to afragen:

@dd32 thanks very much this is fabulous. I wonder if there's a way to hook into the servehappy API to get the minimium PHP version so it doesn't need to be hard coded..

In this part of the codebase it's not worth abstracting that out.
While I could've done something fancy like looping through all the previous releases until I found one that was supported, it's just not beneficial to the overall API speed.

Note: See TracTickets for help on using tickets.