Make WordPress Core

Opened 13 months ago

Closed 4 months ago

Last modified 11 days ago

#58719 closed enhancement (fixed)

Bump the minimum PHP version to 7.2

Reported by: justlevine's profile justlevine Owned by: johnbillion's profile johnbillion
Milestone: 6.6 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: Cc:

Description

Background: #51043, #57345

Per discussion in #51043 (and reaffirmed in #57345, specifically https://core.trac.wordpress.org/ticket/57345#comment:29 and https://core.trac.wordpress.org/ticket/57345#comment:83 ), for WordPress to consider dropping support for a PHP version, the versions need to get below 5% usage, regardless of the WordPress version used on those sites.

As of 5 July 2023, [PHP usage for all WordPress sites](https://wordpress.org/about/stats/)

  • PHP 5.6 is at 3.93%
  • PHP 7.0 is at 2.05%
  • PHP 7.1 is at 1.38%

#57345 is slated to drop support for 5.6, which means barring the unlikely event that migrating users choose PHP 7.0 or 7.1 instead of a later version, the collective usage of PHP 7.0+7.1 is <%5 and eligible to be dropped.

That said (and as evidenced in the referenced tickets), dropping support for a PHP version is an orchestrated event that requires leadership approval, coordination with web hosts, and an announcement post that gives users ample time to prepare.

In an effort to prevent some of the planning hiccups around previous version drops, and hopefully continuing to standardize the process, I propose we already begin planning the eventual removal of the next slated PHP version.

Specifically,

  • We should choose a "go/no-go" date for when we should evaluate the stats and determine which versions (collectively) meet the <%5 threshold (my assumption is that we will want to pad #57345 to see where the migrations land).
  • We should determine the minimum ideal time before dropping support for an announcement post (several in #57345 suggested 2-3 months advanced notice)

Previously:
#57345 Bumping the minimum PHP version to 7.0 in WordPress 6.3 (targeted)
#46594 Bumping the minimum PHP version to 5.6 in WordPress 5.2
#16917 Bumping the minimum PHP version to 5.2 in WordPress 3.2

Change History (54)

#1 @johnbillion
13 months ago

Thanks for opening this ticket. FYI myself and a couple other core folks are going to propose a somewhat more firmly defined process for proposing each minimum supported PHP version bump, probably next month once 6.3 is out the door. It will benefit everyone if this process is more clearly defined and documented.

#2 @masteradhoc
13 months ago

Thanks @johnbillion for your work on pushing this. A defined process is always better and gives people an early headsup on whats going to be needed / possible for core, themes & plugins.

Still think a timeline like suggested here https://core.trac.wordpress.org/ticket/57345#comment:77 might be best :)

WordPress Version Minimum PHP Version PHP EOL since Date* Comment
WP 6.3PHP 7.031 Dec 2018 PHP 5.6 Support will be dropped
WP 6.4PHP 7.210 Jan 2019
1 Dec 2019
PHP 7.0 will be dropped
PHP 7.1 Support will be dropped
WP 6.5PHP 7.330 Nov 2020 PHP 7.2 Support will be dropped
TBD as currently still on 6.26% - might be possible to get that number below 5% for that release

But maybe thats more to catch up and then have a real process.
Lets get first 6.3 ready and then give you guys some time to prepare this. Happy to help.

#3 @samiamnot
12 months ago

Based on stats.

removing PHP 7.2 support is going to take a while since it is currently at 5.64% vs 6.48% last month. This is a pretty significant drop in a month, but it will likely take a while to reach the level where 7.2 can be dropped. PHP 7.3 was at 8.16% last month, and is now at 7.62%.

Month/YearPHP7.0PHP 7.1Total
Jul 20232.051.383.43%
Aug 20231.991.333.32%

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


12 months ago

#5 @snoringdragon
11 months ago

Hi, everyone.
WordPress 6.3 is successfully out. Congratulations.
It will be great if we can start work on this ticket as it will take quite some to reach consensus and all approvals.
Thanks.

#6 @samiamnot
11 months ago

Adding a link to @flixos90's Community Summit Discussion Notes: PHP version support post related to this subject.

#7 @samiamnot
11 months ago

Updated for September based on stats.

Removing PHP 7.2 support (not part of this ticket) is going to take a while since it is currently at 5.55%. This is a very small drop compared to the previous month and it will likely take a while to reach the level where 7.2 can be dropped. PHP 7.3 is now at was at 7.18%, and this is dropping at a faster rate than 7.2.

Month/YearPHP7.0PHP 7.1 PHP 7.0 + 7.1PHP 7.2PHP 7.3PHP 7.2 + 7.3
Jul 20232.051.383.43%6.48%8.16%14.64%
Aug 20231.991.333.32%5.64%7.62%13.26%
Sep 20231.931.273.2%5.55%7.18%12.73%
Last edited 11 months ago by samiamnot (previous) (diff)

#8 @peq42
11 months ago

It surprised me to see wordpress wasting resources on supporting very old versions of PHP while not having full support for newer ones.

https://twitter.com/official_php/status/1597203297537957888
PHP devs have dropped support to all versions of PHP below 8.0 since NOVEMBER last year. A whole 10 months.
PHP 8.2 has existed for at least 9 months, and has only fairly recent joined beta support, without even a dev note about it.

PHP 8 and above, even though they are the only supported versions, still are beta for all versions of wordpress according to https://make.wordpress.org/core/handbook/references/php-compatibility-and-wordpress-versions/

My opinion? Drop PHP 7.4 and below completely and focus on PHP 8 and Above, their performance improvements and new features. People who don't update PHP to the stable, maintained versions won't be updating wordpress anyway, so its worthless wasting time and resources keeping compatibility.

#9 @johnbillion
11 months ago

@peq42 I appreciate your concern but the topic of WordPress retaining support for EOL versions of PHP has been discussed to death and back again. Just because the PHP project has ended support for a version of PHP does not mean that every piece of software must stop supporting that version. Bumping the minimum supported PHP version to 8.0 would mean cutting off over two thirds of all existing WordPress sites. That is unreasonably hostile to users, and without users there is no WordPress.

Let's keep this ticket on topic, thank you. A few internal (sorry) discussions have happened about which version we could or should bump the minimum to, based on current and projected usage figures and how they correlate with WordPress versions.

Hopefully we'll have an update soon.

#10 follow-ups: @johnbillion
11 months ago

Just to manage expectations, there has been some internal discussion on this topic (again, sorry about that) and there will be no increase to the minimum supported version of PHP in WordPress 6.4. We'll come back to this in due course.

#11 in reply to: ↑ 10 ; follow-up: @justlevine
11 months ago

Replying to johnbillion:

Just to manage expectations, there has been some internal discussion on this topic (again, sorry about that) and there will be no increase to the minimum supported version of PHP in WordPress 6.4. We'll come back to this in due course.

Thanks for the update @johnbillion!

What can be done to make these discussions public and transparent going forward?

#12 @peq42
11 months ago

Won't keeping support to those old versions be detrimental to wordpress' overall performance? Lot's of new functionality won't be useable if the project has to take into account PHP 5.6

#13 in reply to: ↑ 11 @johnbillion
11 months ago

Replying to justlevine:

What can be done to make these discussions public and transparent going forward?

I wish I knew.

Replying to peq42:

Lot's of new functionality won't be useable if the project has to take into account PHP 5.6

The minimum supported version is 7.0 since WordPress 6.3, but yes in general newer functionality can't be used unless it's done conditionally or with backwards compatibility included. Hence the push to increase the minimum supported version as soon as we can while still considering that end users are the priority.

#14 in reply to: ↑ 10 @samiamnot
11 months ago

Replying to johnbillion:

Just to manage expectations, there has been some internal discussion on this topic (again, sorry about that) and there will be no increase to the minimum supported version of PHP in WordPress 6.4. We'll come back to this in due course.

On the positive side, with the delay there is hope that by WP 6.5 even PHP 7.3 may be in play 😄. I somehow doubt that it will be low enough though. As of today, 7.0 + 7.1 + 7.2 = 8.64% usage.

#15 @justlevine
10 months ago

@johnbillion I wonder would these backroom conversations be able to already raise this for 6.5?

We still have some 6.4 beta time to add a Site Health notice about the minimum PHP bump in the following release, which even (or especially) in lieu of a formal policy / proposal (whenever it comes) I think we can all agree is a good pattern.
(Iirc it was used for the >= PHP 5.6 drop, but skipped before the >= 7.0 drop since the final ship decision was relatively last minute).

#16 @samiamnot
10 months ago

Updated for October based on stats.

Removing PHP 7.2 support (not part of this ticket) is going to take a while since it is currently at 5.31%. This is a very small drop compared to the previous month and it will likely take a while to reach the level where 7.2 can be dropped. PHP 7.3 is now at was at 6.87%, and this is dropping at a faster rate than 7.2.

Month/YearPHP7.0PHP 7.1 PHP 7.0 + 7.1PHP 7.2PHP 7.3PHP 7.2 + 7.3
Jul 20232.051.383.43%6.48%8.16%14.64%
Aug 20231.991.333.32%5.64%7.62%13.26%
Sep 20231.931.273.2%5.55%7.18%12.73%
Oct 20231.871.233.1%5.31%6.87%12.18%

#17 @masteradhoc
9 months ago

@johnbillion any update for the new propose for handling php versions?

Based on the decision on WP 6.4 to not raise any minimum php version i'd like to propose a new timeline to get to a more up to date minimum php version.

As of now - see https://www.php.net/supported-versions.php - only php 8.1 and 8.2 get active support. php 8.0 will run out of security fixes in a month. We cant keep up that speed but should definately catch up...

WordPress Version Minimum PHP Version PHP EOL since Date* Comment
WP 6.4PHP 7.031 Dec 2018 no change
WP 6.5PHP 7.210 Jan 2019
1 Dec 2019
PHP 7.0 & PHP 7.1 Support will be dropped - currently combined on around 3% usage
WP 6.6PHP 7.330 Nov 2020 PHP 7.2 Support will be dropped
currently on 5.5% - should be possible to get that number below 5% for that release

Usage based on https://wordpress.org/about/stats/ and the updated collection of @samiamnot at https://core.trac.wordpress.org/ticket/58719#comment:16

Second @justlevine's idea on https://core.trac.wordpress.org/ticket/58719#comment:15 to already preinform users to give them an early hint that they should prepare to update.

Last edited 9 months ago by masteradhoc (previous) (diff)

#18 @samiamnot
9 months ago

Updated for November based on stats.

Here are the latest monthly stats.

Month/YearPHP7.0PHP 7.1 PHP 7.0 + 7.1PHP 7.2PHP 7.3PHP 7.2 + 7.3
Jul 20232.051.383.43%6.488.1614.64%
Aug 20231.991.333.32%5.647.6213.26%
Sep 20231.931.273.20%5.557.1812.73%
Oct 20231.871.233.10%5.316.8712.18%
Nov 20231.791.172.96%5.206.5111.71%

This ticket was mentioned in Slack in #hosting by justlevine. View the logs.


9 months ago

#20 @samiamnot
8 months ago

Updated for early Dec based on stats.

Here are the latest monthly stats. No significant change, but PHP 7.2 is getting close to 5% that may allow it to be dropped in a subsequent release.

Month/YearPHP7.0PHP 7.1 PHP 7.0 + 7.1PHP 7.2PHP 7.3PHP 7.2 + 7.3
Jul 20232.051.383.43%6.488.1614.64%
Aug 20231.991.333.32%5.647.6213.26%
Sep 20231.931.273.20%5.557.1812.73%
Oct 20231.871.233.10%5.316.8712.18%
Nov 20231.791.172.96%5.206.5111.71%
Dec 20231.731.122.85%5.086.1711.25%

#21 @masteradhoc
8 months ago

Based on https://wordpress.org/about/stats/ PHP 7.2 dropped now below 5%.
Due to WordPress currently still supporting PHP 7.0 (1.71%) and PHP 7.1 (1.11%) based on current decision we're not able to also drop PHP 7.2 (4.96%) inside the same release.

I would assume it would be best for WP 6.5 to drop PHP 7.0 and 7.1 support and early inform users that PHP 7.2 will be additionally dropped in WP 6.6. This would allow hosting companies and users to check and update their used php version.

#22 follow-ups: @samiamnot
7 months ago

While developers want to move on, note that based on the current stats, the no longer supported PHP 5.6 and lower accounts for 4.78% of all sites. The cumulative count of PHP 7.0 and lower versions stands at 6.47%. Does this number have to drop below 5% to allow dropping PHP 7.0? One things that surprised me was that there was no significant drop in sites using PHP 5.6 since support was dropped in WP 6.3 in Aug. At that time PHP 5.6 was used on 4.02% of sites. It is now used in 3.25%, a drop of less than a percent despite it not being supported for over 4 months. This does not bode well for significant changes in the supported versions.

#23 in reply to: ↑ 22 @peq42
7 months ago

Replying to samiamnot:

One things that surprised me was that there was no significant drop in sites using PHP 5.6 since support was dropped in WP 6.3 in Aug. At that time PHP 5.6 was used on 4.02% of sites. It is now used in 3.25%, a drop of less than a percent despite it not being supported for over 4 months. This does not bode well for significant changes in the supported versions.

and this, again, adds to my point before: People who dont update PHP, dont update WordPress. Bothering with support for those cases is a waste.

If I were to guess, websites using 7.4 and below still are probably dead websites. They'll only get out of that version of php when the host takes the website itself down.

#24 in reply to: ↑ 22 @justlevine
7 months ago

Replying to samiamnot:

The cumulative count of PHP 7.0 and lower versions stands at 6.47%. Does this number have to drop below 5% to allow dropping PHP 7.0?

Precedent from previous releases (e.g. from @azaozz in the 5.6 drop https://core.trac.wordpress.org/ticket/57345#comment:29) has the threshold only for sites left behind in the release, and not those that have already been abandoned.

I believe there is a meta ticket for adding a cross-section of WP-on-PHP version to Stats, to add better understanding how many of those 7.0 sites are for example 'abandoned' at WP4.9, but I can't find it 🤔

#25 @samiamnot
7 months ago

Updated for early Jan 2024 based on stats.

As reported earlier, PHP 7.2 is now less than 5% (4.79% down from 5.08% in Dec) and PHP 7.3 is likely 2 months from dropping below 5%. 7.2+7.3 dropped about 4% over half a year as sites move to newer PHP versions and at this rate ... .

Month/YearPHP7.0PHP 7.1 PHP 7.0 + 7.1PHP 7.2PHP 7.3PHP 7.2 + 7.3
Jul 20232.051.383.43%6.488.1614.64%
Aug 20231.991.333.32%5.647.6213.26%
Sep 20231.931.273.20%5.557.1812.73%
Oct 20231.871.233.10%5.316.8712.18%
Nov 20231.791.172.96%5.206.5111.71%
Dec 20231.731.122.85%5.086.1711.25%
Jan 20241.681.092.77%4.795.9010.69%

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


7 months ago

#27 follow-up: @hellofromTonya
7 months ago

As of today, here's the percentage of sites running on PHP versions older than PHP 7.2:

PHPUsage Percentage
7.11.08%
7.01.67%
5.63.21%
5.50.35%
5.40.44%
5.20.50%
5.20.21%

Total = 7.46%

Bumps are intentionally slow to avoid leaving users behind for those users who are on hosting that does not offer the version being proposed as the next minimum. Leaving these users behind means they are unable to upgrade their PHP version on their current hosting in order to upgrade to the newest version of WordPress.

Once the usage percentage drops below 5%, then the next step is for Matt to review and approve the bump.

Though the stats weren't low enough yet, I did ask during 6.4 but a bump was not approved.

#28 in reply to: ↑ 27 @justlevine
7 months ago

Replying to hellofromTonya:

Thanks for the follow up (as well as shedding some light on the 6.4 decision 🙏)

As noted above, the precedent for previous drops (including the the most recent one) has been < 5% of currently supported PHP versions, not sites that have already been abandoned (as they anyway need to upgrade their PHP versions).

Am I misunderstanding or has there been a change in policy?

Last edited 7 months ago by justlevine (previous) (diff)

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


7 months ago

#30 @hellofromTonya
7 months ago

There's not a "policy" per se, but a 5% general milestone that can kick-off a request to Matt for his review and approval. There's vagueness around what should or shouldn't be included in the 5%. This is something folks like @johnbillion and I have been seeking to better understand for clarity.

Last edited 7 months ago by hellofromTonya (previous) (diff)

This ticket was mentioned in Slack in #hosting by javier. View the logs.


7 months ago

#32 @azaozz
6 months ago

My understanding is that the "5% or less" calculation would not include sites that are running on unsupported PHP versions. AFAIK only sites that will be affected by the version bump are counted (i.e. sites that may be left behind if their hosting is not updated).

For example the PHP 5.2, 5.3, 5.4, etc. versions have been unsupported for several years. The sites that are still on these old versions will not be affected by a PHP version bump from 7.0 to 7.2. They are most likely not actively maintained any more.

Having said that I also agree with @hellofromTonya that "Bumps are intentionally slow to avoid leaving users behind for those users who are on hosting that does not (yet) offer the version being proposed". Would be ideal if the number of sites that "were left behind" after the last bump decreases more. 3.21% still on PHP 5.6 seems a lot.

The bump to PHP 7.0 was about seven months ago [56141]. Perhaps the bump to 7.2 should be about a year later, i.e. in WP 6.6?

#33 @samiamnot
6 months ago

Updated for early Feb 2024 based on stats.

Month/YearPHP 7.0PHP 7.1 PHP 7.0 + 7.1PHP 7.2PHP 7.3PHP 7.2 + 7.3
Jul 20232.051.383.43%6.488.1614.64%
Aug 20231.991.333.32%5.647.6213.26%
Sep 20231.931.273.20%5.557.1812.73%
Oct 20231.871.233.10%5.316.8712.18%
Nov 20231.791.172.96%5.206.5111.71%
Dec 20231.731.122.85%5.086.1711.25%
Jan 20241.681.092.77%4.795.9010.69%
Feb 20241.621.042.66%4.675.5410.21%

If we have to support no longer supported versions (note that if this were the case, we would not have been able to drop PHP 5.6 in #57345 when support was dropped, something we clearly did). At this rate of drop (a 5th of a percent) in the past month, it will likely be some time in 2025 before we can make 7.2 the minimum supported PHP version.

Month/YearPHP 5.2PHP 5.3PHP 5.4PHP 5.5PHP 5.6PHP 7.0PHP 7.1Total
Jan 20240.210.500.44%0.353.211.67%1.087.46%
Feb 20240.210.490.42%0.353.121.62%1.047.25%

#34 @samiamnot
5 months ago

Updated for early March based on stats.

Month/YearPHP 7.0PHP 7.1 PHP 7.0 + 7.1PHP 7.2PHP 7.3PHP 7.2 + 7.3
Jul 2023 2.05 1.38 3.43% 6.48 8.16 14.64%
Aug 2023 1.99 1.33 3.32% 5.64 7.62 13.26%
Sep 2023 1.93 1.27 3.20% 5.55 7.18 12.73%
Oct 2023 1.87 1.23 3.10% 5.31 6.87 12.18%
Nov 2023 1.79 1.17 2.96% 5.20 6.51 11.71%
Dec 2023 1.73 1.12 2.85% 5.08 6.17 11.25%
Jan 2024 1.68 1.09 2.77% 4.79 5.90 10.69%
Feb 2024 1.62 1.04 2.66% 4.67 5.54 10.21%
Mar 2024 1.55 0.99 2.54% 4.30 5.11 9.41%

If we have to support no longer supported versions (note that if this were the case, we would not have been able to drop PHP 5.6 in #57345 when support was dropped, something we clearly did).

Month/YearPHP 5.2PHP 5.3PHP 5.4PHP 5.5PHP 5.6PHP 7.0PHP 7.1Total
Jan 2024 0.21 0.50 0.44 0.35 3.21 1.67 1.08 7.46%
Feb 2024 0.21 0.49 0.42 0.35 3.12 1.62 1.04 7.25%
Mar 2024 0.21 0.48 0.39 0.34 3.02 1.55 0.99 6.98%

#35 follow-up: @johnbillion
5 months ago

  • Milestone changed from Awaiting Review to 6.6
  • Owner set to johnbillion
  • Status changed from new to accepted

I propose that in WordPress 6.6 the minimum supported version of PHP is increased to 7.2. The exact point release can be discussed but it seems that 7.2.24 is a solid candidate based on the discussion and usage stats provided in #57345.

Supporting data:

  • WordPress 5.2 dropped support for PHP 5.2 - 5.5 in May 2019. A whopping 19.3% of sites were affected on release day.
  • WordPress 6.3 dropped support for PHP 5.6 in August 2023. 3.9% of sites were affected on release day.
  • This ticket proposes to drop support for PHP 7.0 - 7.1. Currently just 2.5% of sites are affected, well under the 5% threshold that has been used recently as a guideline for these bumps.

With WP 6.6 planned for July 2024, we can expect that value to be around 2.1 - 2.2% on release day if the 0.1% decrease seen every month for the last year continues. This also brings us to one year since the last bump, just as azaozz recommended.

One noteworthy benefit of dropping support for 7.0 and 7.1 is that the sodium compat library can be removed because libsodium is part of PHP since 7.2. The type enhancements in PHP 7.1 and 7.2 are welcome additions for developers but less immediately applicable to WordPress core as it currently makes little use of type declarations.

#36 @masteradhoc
5 months ago

Sounds great @johnbillion. Would love to see this getting done in WP 6.6.

If things continue with a decline as we have it now we should easily be able to push the minimum php version to 7.4 on WP 6.7. if we can agree on this (if ofc combined its below the 5% threshold) it would be great to preinform users early on this step also.

#37 @peq42
5 months ago

Any upgrade on minimum php version is an immediate yes from me.

That way we can assure that wordpress will be making use of new features, meaning better performance and safety, on top of "forcing" the web to move forward with newer versions of php

#38 @johnbillion
5 months ago

Let's keep the discussion focused on PHP 7.2 for now, so we don't get ahead of ourselves.

Once WordPress 6.5 is out the door I'll speak with Josepha about getting this agreed. Nothing to do here for a while yet.

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


5 months ago
#39

  • Keywords has-patch added

Trac ticket: https://core.trac.wordpress.org/ticket/58719

Leaving this as a draft until 6.5 is out the door.

#40 in reply to: ↑ 35 ; follow-up: @jrf
5 months ago

Replying to johnbillion:

One noteworthy benefit of dropping support for 7.0 and 7.1 is that the sodium compat library can be removed because libsodium is part of PHP since 7.2.

@johnbillion While Sodium ships with PHP as of PHP 7.2, PHP can still be compiled without it and the extension can be turned off from the config as well.

In other words, the Sodium Compat library can not be removed unless the Sodium extension is made a hard requirement for installing WordPress, including for updating to the WordPress version in which the library would be dropped.

@jrf commented on PR #6221:


5 months ago
#41

For visibility:

While Sodium ships with PHP as of PHP 7.2, PHP can still be compiled without it and the extension can be turned off from the config as well.

In other words, the Sodium Compat library can not be removed unless the Sodium extension is made a hard requirement for installing WordPress, including for updating to the WordPress version in which the library would be dropped.

#42 in reply to: ↑ 40 @dd32
5 months ago

Replying to jrf:

While Sodium ships with PHP as of PHP 7.2, PHP can still be compiled without it and the extension can be turned off from the config as well.

To back this up with light data1; while PHP 7.0+7.1 account for less than 5% of sites, Sodium is only installed ~60% of sites where we track PHP extension metrics (WP 6.1+); that will include some PHP 5.6 sites in the data, but it wouldn't be possible for it to be on 95%+ or even 80%+ of PHP 7.2+ sites based on that.

1: Because although I can query for the data in future, it'd take longer to do that now, than needed than writing this comment'

#43 @samiamnot
4 months ago

Updated for early April based on stats. 7.0+7.1 saw the typical tiny reduction. 7.2+7.3 continues to decrease nicely, down 0.82%. It will be a while until those are under 5%. While at the current rate it will be under 4% in 6 months, I expect the decrease to slow down as seen in older versions.

Month/YearPHP 7.0PHP 7.1 PHP 7.0 + 7.1PHP 7.2PHP 7.3PHP 7.2 + 7.3
Jul 2023 2.05 1.38 3.43% 6.48 8.16 14.64%
Aug 2023 1.99 1.33 3.32% 5.64 7.62 13.26%
Sep 2023 1.93 1.27 3.20% 5.55 7.18 12.73%
Oct 2023 1.87 1.23 3.10% 5.31 6.87 12.18%
Nov 2023 1.79 1.17 2.96% 5.20 6.51 11.71%
Dec 2023 1.73 1.12 2.85% 5.08 6.17 11.25%
Jan 2024 1.68 1.09 2.77% 4.79 5.90 10.69%
Feb 2024 1.62 1.04 2.66% 4.67 5.54 10.21%
Mar 2024 1.55 0.99 2.54% 4.30 5.11 9.41%
Apr 2024 1.50 0.95 2.45% 3.80 4.79 8.59%

For historical reasons, here are the stats going back to PHP 5.2. This is not changing much and much are likely "abandoned" sites that are on old versions of WP.

Month/YearPHP 5.2PHP 5.3PHP 5.4PHP 5.5PHP 5.6PHP 7.0PHP 7.1Total
Jan 2024 0.21 0.50 0.44 0.35 3.21 1.67 1.08 7.46%
Feb 2024 0.21 0.49 0.42 0.35 3.12 1.62 1.04 7.25%
Mar 2024 0.21 0.48 0.39 0.34 3.02 1.55 0.99 6.98%
Apr 2024 0.20 0.47 0.38 0.33 2.93 1.50 0.95 6.76%
Last edited 4 months ago by samiamnot (previous) (diff)

#44 @johnbillion
4 months ago

@jrf @dd32 Thanks for that information! Given such a high percentage of sites that could have Sodium disabled, I've reverted the removal of sodium_compat from the PR and we'll retain it in core.

@samiamnot Thanks for keeping an eye on the stats.

#45 @jrf
4 months ago

Thanks @johnbillion for updating the proposed patch.

For the record: I fully support upping the minimum supported PHP version to PHP 7.2 (or even 7.3) sooner rather than later.

Keeping WP running PHP cross-version will be getting more and more painful if we don't.

Some examples:

SimplePie has dropped support for PHP < 7.2 in version 1.8.0 which was released in January 2023.
WordPress currently cannot update SimplePie anymore, but older SimplePie versions will not receive patches to support newer PHP versions, like PHP 8.3 or PHP 8.4.

While Sodium_Compat (previously discussed as still necessary) currently still has a minimum supported PHP version of PHP 5.2.4, I would be very surprised if that doesn't get raised to PHP 7.1 in the foreseeable future.
The Sodium_Compat library, in particular, is impacted by the PHP 8.4 "implicitly nullable parameters" deprecation with 36 instances needing fixing.
If PHP < 7.1 would continue to be supported, they would need to drop the type declarations of the affected function parameters, which is a significant BC-break as their classes are not final.
If they'd raise the minimum supported version to 7.1, they can fix these issues by using nullable types.
For most end-users of Sodium Compat, that wouldn't be a problem as those projects use Composer and Composer can sort out that a version is installed which is compatible with the server on which the package is being run.
However, WordPress is not one of those users and shipping WP with two different versions, while doable, is probably still not the best of ideas.

Requests has already fixed that deprecation, but this means it had to make a potential breaking change, though this was (of course) done after careful research of uses of the one method for which this BC-break was needed.

And while the GetID3 package - for now - still has a minimum of PHP 5.4 for their 2.0 release, there is a discussion going to change this to PHP 7.2 too.

Aside from the above, PHP_CodeSniffer will also have a PHP 7.2 minimum as of version 4.0, which is expected sometimes over the next few months. This decision was already taken years ago when the 4.0 branch was created (2020).
When WordPressCS will be made compatible with PHPCS 4.0, it is likely that the minimum supported PHP version for WPCS will need to be raised to PHP 7.2 as well, even if PHPCS 3.0 would still be supported.
As WordPress should always try to enforce the latest version of its own coding standards, we cannot allow for an older WPCS version to be installed by contributors, which would create an ugly conundrum as WP having a dev dependency with a higher minimum PHP version than its own minimum PHP version is problematic.

On top of all that, I've seen some recent patches in WP which introduced parameter type declarations. While this is not a great idea in the context of WordPress in the first place, though that's beside the point, the problem in light of this ticket is that PHP < 7.4 doesn't fully support co-variance or contra-variance. And while PHP 7.2 doesn't offer full support yet, it is the PHP version in which the first significant steps were taken to add support for co-variance and contra-variance to PHP.

Either way, that's my two pennies. Hope it helps to inform the decision by the powers that be.

#46 follow-up: @desrosj
4 months ago

For what it's worth, I wanted to weigh in with my support for raising the required minimum to PHP 7.2 in WordPress 6.6, dropping PHP 7.0 and 7.1 at this point.

With the broader context of the projects and libraries WordPress relies on from @jrf above, it's clear that the maintenance for several parts of Core will become unmanageable and potentially result in exposing sites to security problems if we don't also raise our minimum at this time.

While PHP 7.2 is currently sitting at 3.8%, I don't see much benefit to also trimming support for 7.2 at this time. Though it's likely and reasonable to circle back to 7.2 and 7.3 late this/early next year.

It's a shame that so many sites have PHP compiled without Sodium, but perhaps we could call this out to hosts in an attempt to get that number up so the compat library can be dropped in a future release.

#47 in reply to: ↑ 46 @jrf
4 months ago

Replying to desrosj:

It's a shame that so many sites have PHP compiled without Sodium, but perhaps we could call this out to hosts in an attempt to get that number up so the compat library can be dropped in a future release

@desrosj Might also be something to check and recommend via Site Health. I suspect (but haven't checked) that Sodium is now not called out as a missing/recommended extension due to the polyfill being in place.

We should be able to figure something out to distinguish whether Sodium is provided via the polyfill or via the PHP extension and if the extension is not available to show a recommendation to enable it. That should hopefully assist in getting the numbers up.

#49 @johnbillion
4 months ago

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

In 57985:

General: Increase the minimum supported version of PHP to 7.2.24.

Props justlevine, masteradhoc, samiamnot, hellofromTonya, azaozz, jrf, dd32, desrosj, jorbin

Fixes #58719

#51 @samiamnot
3 months ago

Updated for early May based on stats. Note the drop in changes in 7.2 + 7.3. This slowed down to about half of what it had been in the previous month.

Month/YearPHP 7.0PHP 7.1 PHP 7.0 + 7.1PHP 7.2PHP 7.3PHP 7.2 + 7.3
Jul 2023 2.05 1.38 3.43% 6.48 8.16 14.64%
Aug 2023 1.99 1.33 3.32% 5.64 7.62 13.26%
Sep 2023 1.93 1.27 3.20% 5.55 7.18 12.73%
Oct 2023 1.87 1.23 3.10% 5.31 6.87 12.18%
Nov 2023 1.79 1.17 2.96% 5.20 6.51 11.71%
Dec 2023 1.73 1.12 2.85% 5.08 6.17 11.25%
Jan 2024 1.68 1.09 2.77% 4.79 5.90 10.69%
Feb 2024 1.62 1.04 2.66% 4.67 5.54 10.21%
Mar 2024 1.55 0.99 2.54% 4.30 5.11 9.41%
Apr 2024 1.50 0.95 2.45% 3.80 4.79 8.59%
May 2024 1.45 0.92 2.37% 3.63 4.52 8.15%

For historical reasons, here are the stats going back to PHP 5.2. This is not changing much and much are likely "abandoned" sites that are on old versions of WP.

Month/YearPHP 5.2PHP 5.3PHP 5.4PHP 5.5PHP 5.6PHP 7.0PHP 7.1Total
Jan 2024 0.21 0.50 0.44 0.35 3.21 1.67 1.08 7.46%
Feb 2024 0.21 0.49 0.42 0.35 3.12 1.62 1.04 7.25%
Mar 2024 0.21 0.48 0.39 0.34 3.02 1.55 0.99 6.98%
Apr 2024 0.20 0.47 0.38 0.33 2.93 1.50 0.95 6.76%
May 2024 0.20 0.46 0.37 0.32 2.84 1.45 0.92 6.56%

#52 @samiamnot
8 weeks ago

Updated for early June based on stats. With the slowdown of upgrades on 7.2+7.3 to about 0.4% a month, I do not think that it is realistic to drop 7.2+7.3 for quite a while. At the current pace, it will take about 7 months, but the actual change rate is slowing down every month. My assumption is that will will not be low enough for the next phase of dropping 7.2+7.3 for close to a year.

Month/YearPHP 7.0PHP 7.1 PHP 7.0 + 7.1PHP 7.2PHP 7.3PHP 7.2 + 7.3
Jul 2023 2.05 1.38 3.43% 6.48 8.16 14.64%
Aug 2023 1.99 1.33 3.32% 5.64 7.62 13.26%
Sep 2023 1.93 1.27 3.20% 5.55 7.18 12.73%
Oct 2023 1.87 1.23 3.10% 5.31 6.87 12.18%
Nov 2023 1.79 1.17 2.96% 5.20 6.51 11.71%
Dec 2023 1.73 1.12 2.85% 5.08 6.17 11.25%
Jan 2024 1.68 1.09 2.77% 4.79 5.90 10.69%
Feb 2024 1.62 1.04 2.66% 4.67 5.54 10.21%
Mar 2024 1.55 0.99 2.54% 4.30 5.11 9.41%
Apr 2024 1.50 0.95 2.45% 3.80 4.79 8.59%
May 2024 1.45 0.92 2.37% 3.63 4.52 8.15%
Jun 2024 1.41 0.89 2.30% 3.46 4.30 7.76%

For historical reasons, here are the stats going back to PHP 5.2. This is not changing much and many are likely "abandoned" sites that are on old versions of WP.

Month/YearPHP 5.2PHP 5.3PHP 5.4PHP 5.5PHP 5.6PHP 7.0PHP 7.1Total
Jan 2024 0.21 0.50 0.44 0.35 3.21 1.67 1.08 7.46%
Feb 2024 0.21 0.49 0.42 0.35 3.12 1.62 1.04 7.25%
Mar 2024 0.21 0.48 0.39 0.34 3.02 1.55 0.99 6.98%
Apr 2024 0.20 0.47 0.38 0.33 2.93 1.50 0.95 6.76%
May 2024 0.20 0.46 0.37 0.32 2.84 1.45 0.92 6.56%
Jun 2024 0.20 0.45 0.36 0.31 2.76 1.41 0.89 6.38%

#53 @samiamnot
3 weeks ago

Updated for early July based on stats. With the slowdown of upgrades on 7.2+7.3 to under 0.4% a month, I do not think that it is realistic to drop 7.2+7.3 for quite a while. At the current pace, it will take a minimum 7 months, but the actual change rate is slowing down every month. My assumption is that will will not be low enough to drop for close to a year.

@justlevine, Now that this is closed and expected to be released in the next few weeks, you may want to open the follow-up ticket to drop support for PHP 7.2 and 7.3 that will likely not be able to be targeted for a release for quite a while from now. Not only are the numbers too high, but there has never been a historical case of dropping release of a PHP version within a year of the previous drop. WPDisplay has a nice graph visualizing this.

Month/YearPHP 7.0PHP 7.1 PHP 7.0 + 7.1PHP 7.2PHP 7.3PHP 7.2 + 7.3
Jul 2023 2.05 1.38 3.43% 6.48 8.16 14.64%
Aug 2023 1.99 1.33 3.32% 5.64 7.62 13.26%
Sep 2023 1.93 1.27 3.20% 5.55 7.18 12.73%
Oct 2023 1.87 1.23 3.10% 5.31 6.87 12.18%
Nov 2023 1.79 1.17 2.96% 5.20 6.51 11.71%
Dec 2023 1.73 1.12 2.85% 5.08 6.17 11.25%
Jan 2024 1.68 1.09 2.77% 4.79 5.90 10.69%
Feb 2024 1.62 1.04 2.66% 4.67 5.54 10.21%
Mar 2024 1.55 0.99 2.54% 4.30 5.11 9.41%
Apr 2024 1.50 0.95 2.45% 3.80 4.79 8.59%
May 2024 1.45 0.92 2.37% 3.63 4.52 8.15%
Jun 2024 1.41 0.89 2.30% 3.46 4.30 7.76%
Jul 2024 1.36 0.86 2.22% 3.33 4.10 7.43%

For historical reasons, here are the stats for no longer supported versions (as of WP 6.6) going back to PHP 5.2. This is not changing much (going down about 0.20% a month) and many are likely "abandoned" sites that are on old versions of WP.

Month/YearPHP 5.2PHP 5.3PHP 5.4PHP 5.5PHP 5.6PHP 7.0PHP 7.1Total
Jan 2024 0.21 0.50 0.44 0.35 3.21 1.67 1.08 7.46%
Feb 2024 0.21 0.49 0.42 0.35 3.12 1.62 1.04 7.25%
Mar 2024 0.21 0.48 0.39 0.34 3.02 1.55 0.99 6.98%
Apr 2024 0.20 0.47 0.38 0.33 2.93 1.50 0.95 6.76%
May 2024 0.20 0.46 0.37 0.32 2.84 1.45 0.92 6.56%
Jun 2024 0.20 0.45 0.36 0.31 2.76 1.41 0.89 6.38%
Jul 2024 0.19 0.44 0.35 0.30 2.63 1.36 0.86 6.13%

#54 @samiamnot
11 days ago

Based on based on WordPress stats, as of today's release of WordPress 6.6 with a minimum supported PHP version of 7.2, 6.05% of WordPress sites are now running on unsupported PHP versions. 7.29% of sites are running on PHP 7.2 + 7.3, the next logical set of PHP versions to drop. PHP 7.4 is by far the most used PHP version for WordPress, comprising 39.63% of all WordPress sites.

Note: See TracTickets for help on using tickets.