WordPress.org

Make WordPress Core

Opened 17 months ago

Closed 16 months ago

Last modified 10 months ago

#46594 closed task (blessed) (fixed)

Bump PHP version requirements

Reported by: jorbin Owned by: jorbin
Milestone: 5.2 Priority: high
Severity: normal Version:
Component: General Keywords: commit
Focuses: Cc:

Description

Follow up to [17523] and [17562] and [44950]

Attachments (2)

46594.diff (891 bytes) - added by jorbin 17 months ago.
46594.2.diff (3.0 KB) - added by jorbin 16 months ago.

Download all attachments as: .zip

Change History (20)

@jorbin
17 months ago

#1 follow-up: @jorbin
17 months ago

Want to bump this so that people can't accidentally upgrade to a version they can't use.

@dd32 @pento - Either of you have insights into the stats for the specific minor of 5.6 we want to use?

#2 in reply to: ↑ 1 @dd32
17 months ago

Replying to jorbin:

Either of you have insights into the stats for the specific minor of 5.6 we want to use?

I pulled the stats for WP 5.x usage of PHP 5.6.x, summarised here: https://docs.google.com/spreadsheets/d/1QtChQBycXJa5helEiDCWIH6EMFR5wZUr9NdfcJQ5djQ/edit#gid=0

Basically, 54% use the latest 5.6.40, 95% are 5.6.30 and above, and 99% are 5.6.20 and above (I don't like how round these numbers are.. :) )

Most of the PHP 5.6 fixes after 5.6.25 seem to be security-related, and that's the point I stopped looking into it.

#3 @jorbin
17 months ago

Thanks Dion!

Barring objections or arguments, I’m fine with a 95% solution and will commit that.

#4 @jorbin
17 months ago

  • Owner set to jorbin
  • Resolution set to fixed
  • Status changed from new to closed

In 44982:

PHP: Bump minimum version

95% of 5.6 sites are on 5.6.30 or higher, hence this specific minimum version.

Fixes #46594.

#5 @jorbin
17 months ago

#46624 was marked as a duplicate.

#6 follow-up: @jorbin
17 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

in #46624, @luciano-croce proposed setting the minimum as 5.6.40. Unfortunately, I think that's going in the wrong direction. As the stats point out, only 54% of 5.6.x sites are on that, so we would be eliminating a lot more sites than intended from upgrading to WordPress 5.2 by doing so. ~20% of users are already going to be left behind.

In slack, @afragen suggested going down to 5.6.20 as local by flywheel has that as it's PHP version. As that is a fairly popular development environment, it feels like that might make sense.

Last edited 11 months ago by SergeyBiryukov (previous) (diff)

#7 in reply to: ↑ 6 @dd32
16 months ago

Replying to jorbin:

In slack, afergen suggested going down to 5.6.20 as local by flywheel has that as it's PHP version. As that is a fairly popular development environment, it feels like that might make sense.

As a personal opinion, I feel like 5.6.20 is the safer option, especially given that bumping it to 5.6.30 doesn't gain WordPress much in the way of added features, bugfixes, or bring any major security improvement (that i'm aware of).

I would normally advocate for supporting down to PHP 5.6.0, just to make messaging and support easier "PHP 5.6 or greater", but given the significantly small fraction of people who would be affected by that change it's not even worth considering.

@jorbin
16 months ago

#8 @jorbin
16 months ago

Latest patch sets the minimum to 5.6.20, the recommended to 7.3 (to match https://wordpress.org/about/requirements/ ), and cleans up the travis config. I believe that is what will be needed in order to finish up the minimum version update.

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


16 months ago

#10 @afragen
16 months ago

Thank you many times over.

#11 @netweb
16 months ago

  • Keywords commit added

46594.2.diff looks good to me @jorbin 👌

#12 @jorbin
16 months ago

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

In 45058:

PHP: Finish updating PHP Minimum version

Previous [44982] and [44950].

This bumps the minimum version down slightly based on some research into the usage of php 5.6. This also brings the recommended version in line with https://wordpress.org/about/requirements/ .

The travis matrix is also being reduced in order to speed up builds. This is a hard break. PHP 5.2 - 5.5 we are never ever, ever, getting back together. You go talk to your friends, talk to my friends, talk to me, But we are never ever, ever, ever getting back together.

Props DD32, afergen for research.
Fixes #46594.

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


16 months ago

This ticket was mentioned in Slack in #core-site-health by sergey. View the logs.


11 months ago

#15 @desrosj
11 months ago

In 46205:

Code Modernization: Deprecate the Services_JSON and Services_JSON_Error classes.

The PHP native JSON extension has been bundled and compiled with PHP by default since version 5.2.0. Because the minimum version of PHP required by WordPress is now 5.6.20 (see #46594 and [45058]), JSON extension related polyfills and backwards compatibility code can now be removed.

Since there are still some plugins and themes that utilize the Services_JSON class, these classes will remain for the time being, but including the wp-includes/class-json.php file and creating Services_JSON instances will now throw deprecated notices.

See #47699.
Props jrf, Clorith, pento.

#16 @desrosj
11 months ago

In 46206:

Code Modernization: Remove JSON extension workarounds for PHP < 5.6.

The PHP native JSON extension has been bundled and compiled with PHP by default since version 5.2.0. Because the minimum version of PHP required by WordPress is now 5.6.20 (see #46594 and [45058]), JSON extension related polyfills and backwards compatibility code can now be removed.

This change removes code that supported JSON related functionality on older versions of PHP. This includes (but is not limited to) checks that json_last_error() exists, checking and setting the JSON_UNESCAPED_SLASHES and JSON_PRETTY_PRINT constants if not previously defined, and deprecating the _wp_json_prepare_data() function (which was 100% workaround code).

Follow up of [46205].

See #47699.
Props jrf, Clorith, pento.

#17 @desrosj
11 months ago

In 46208:

Code Modernization: Remove JSON related polyfills.

The PHP native JSON extension has been bundled and compiled with PHP by default since version 5.2.0. Because the minimum version of PHP required by WordPress is now 5.6.20 (see #46594 and [45058]), JSON extension related polyfills and backwards compatibility code can now be removed.

This change removes the json_last_error_msg() and JsonSerializable polyfills included in WordPress for full JSON extension support in PHP < 5.6.

Follow up of [46205-46206].

See #47699.
Props jrf, Clorith, pento.

#18 @desrosj
10 months ago

In 46455:

Upgrade/Install: Detect the presence of the native PHP JSON extension before updating.

The PHP native JSON extension has been bundled and compiled with PHP by default since version 5.2.0. Because the minimum version of PHP required by WordPress is now 5.6.20 (see #46594 and [45058]), the related polyfills and workarounds have been removed (see [46205-46206,46208]).

However, even though the JSON extension is now included in PHP by default, it is still possible to disable the extension in a custom configuration. This change will prevent sites from upgrading if the JSON extension is disabled to prevent compatibility issues.

Props jrf, jorbin, dd32, desrosj.
Fixes #47699.

Note: See TracTickets for help on using tickets.