Skip to content
Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/workflows/local-docker-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@ jobs:
- db-version: '9.0'
- db-version: '9.1'
- db-version: '9.2'
# MySQL 9.0+ will not work on PHP 7.2 & 7.3. See https://core.trac.wordpress.org/ticket/61218.
- php: '7.2'
db-version: '9.3'
- php: '7.3'
db-version: '9.3'

with:
os: ${{ matrix.os }}
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/phpunit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-24.04 ]
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
db-type: [ 'mysql' ]
db-version: [ '5.7', '8.0', '8.4' ]
tests-domain: [ 'example.org' ]
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-24.04 ]
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
db-type: [ 'mariadb' ]
db-version: [ '5.5', '10.3', '10.4', '10.5', '10.6', '10.11', '11.4', '11.8' ]
multisite: [ false, true ]
Expand Down Expand Up @@ -195,19 +195,14 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-24.04 ]
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
db-type: [ 'mysql', 'mariadb' ]
db-version: [ '9.3', '11.7' ]
multisite: [ false, true ]
memcached: [ false ]
db-innovation: [ true ]

exclude:
# MySQL 9.0+ will not work on PHP <= 7.3 because mysql_native_password was removed. See https://core.trac.wordpress.org/ticket/61218.
- php: '7.2'
db-version: '9.3'
- php: '7.3'
db-version: '9.3'
# Exclude version combinations that don't exist.
- db-type: 'mariadb'
db-version: '9.3'
Expand Down Expand Up @@ -239,7 +234,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ '7.2', '7.4', '8.0', '8.4' ]
php: [ '7.4', '8.0', '8.4' ]
db-type: [ 'mysql' ]
db-version: [ '8.4' ]
phpunit-test-groups: [ 'html-api-html5lib-tests' ]
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/reusable-upgrade-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ jobs:
--health-retries="5"
-e MYSQL_ROOT_PASSWORD="root"
-e MYSQL_DATABASE="test_db"
--entrypoint sh ${{ inputs.db-type }}:${{ inputs.db-version }}
-c "exec docker-entrypoint.sh mysqld${{ inputs.db-type == 'mysql' && contains( fromJSON('["7.2", "7.3"]'), inputs.php ) && ' --default-authentication-plugin=mysql_native_password' || '' }}"

steps:
- name: Set up PHP ${{ inputs.php }}
Expand Down
14 changes: 3 additions & 11 deletions .github/workflows/upgrade-develop-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,12 @@ jobs:
fail-fast: false
matrix:
os: [ 'ubuntu-24.04' ]
php: [ '7.2', '8.4' ]
php: [ '7.4', '8.4' ]
db-type: [ 'mysql' ]
db-version: [ '5.7', '8.4' ]
# WordPress 4.9 is the oldest version that supports PHP 7.2.
wp: [ '4.9', '6.6', '6.7', '6.8' ]
# WordPress 5.3 is the oldest version that supports PHP 7.4.
wp: [ '5.3', '6.6', '6.7', '6.8' ]
multisite: [ false, true ]

exclude:
# The PHP <= 7.3/MySQL 8.4 jobs currently fail due to mysql_native_password being disabled by default. See https://core.trac.wordpress.org/ticket/61218.
- php: '7.2'
db-version: '8.4'
# WordPress 4.9 does not support PHP 8.4.
- php: '8.4'
wp: '4.9'
with:
os: ${{ matrix.os }}
php: ${{ matrix.php }}
Expand Down
44 changes: 5 additions & 39 deletions .github/workflows/upgrade-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,11 @@ jobs:
fail-fast: false
matrix:
os: [ 'ubuntu-24.04' ]
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
db-type: [ 'mysql' ]
db-version: [ '5.7', '8.0', '8.4', '9.3' ]
wp: [ '6.7', '6.8' ]
multisite: [ false, true ]

exclude:
# The PHP <= 7.3/MySQL 8.4 jobs currently fail due to mysql_native_password being disabled by default. See https://core.trac.wordpress.org/ticket/61218.
- php: '7.2'
db-version: '8.4'
- php: '7.3'
db-version: '8.4'
# MySQL 9.0+ will not work on PHP 7.2 & 7.3. See https://core.trac.wordpress.org/ticket/61218.
- php: '7.2'
db-version: '9.3'
- php: '7.3'
db-version: '9.3'
with:
os: ${{ matrix.os }}
php: ${{ matrix.php }}
Expand All @@ -98,16 +86,11 @@ jobs:
fail-fast: false
matrix:
os: [ 'ubuntu-24.04' ]
php: [ '7.2', '7.4', '8.0', '8.4' ]
php: [ '7.4', '8.0', '8.4' ]
db-type: [ 'mysql' ]
db-version: [ '5.7', '8.4' ]
wp: [ '6.0', '6.3', '6.4', '6.5' ]
multisite: [ false, true ]

exclude:
# The PHP <= 7.3/MySQL 8.4 jobs currently fail due to mysql_native_password being disabled by default. See https://core.trac.wordpress.org/ticket/61218.
- php: '7.2'
db-version: '8.4'
with:
os: ${{ matrix.os }}
php: ${{ matrix.php }}
Expand All @@ -117,7 +100,7 @@ jobs:
new-version: ${{ inputs.new-version && inputs.new-version || 'latest' }}
multisite: ${{ matrix.multisite }}

# Tests 5.x releases where the WordPress database version changed on the oldest and newest supported versions of PHP 7.
# Tests 5.x releases where the WordPress database version changed on the only supported version of PHP 7.
upgrade-tests-wp-5x-php-7x-mysql:
name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }}
uses: ./.github/workflows/reusable-upgrade-testing.yml
Expand All @@ -126,16 +109,11 @@ jobs:
fail-fast: false
matrix:
os: [ 'ubuntu-24.04' ]
php: [ '7.2', '7.4' ]
php: [ '7.4' ]
db-type: [ 'mysql' ]
db-version: [ '5.7', '8.4' ]
wp: [ '5.0', '5.1', '5.3', '5.4', '5.5', '5.6', '5.9' ]
multisite: [ false, true ]

exclude:
# The PHP <= 7.3/MySQL 8.4 jobs currently fail due to mysql_native_password being disabled by default. See https://core.trac.wordpress.org/ticket/61218.
- php: '7.2'
db-version: '8.4'
with:
os: ${{ matrix.os }}
php: ${{ matrix.php }}
Expand Down Expand Up @@ -186,23 +164,11 @@ jobs:
fail-fast: false
matrix:
os: [ 'ubuntu-24.04' ]
php: [ '7.2', '7.3', '7.4' ]
php: [ '7.4' ]
db-type: [ 'mysql' ]
db-version: [ '5.7', '8.0', '8.4', '9.3' ]
wp: [ '4.7' ]
multisite: [ false, true ]

exclude:
# The PHP <= 7.3/MySQL 8.4 jobs currently fail due to mysql_native_password being disabled by default. See https://core.trac.wordpress.org/ticket/61218.
- php: '7.2'
db-version: '8.4'
- php: '7.3'
db-version: '8.4'
# MySQL 9.0+ will not work on PHP 7.2 & 7.3. See https://core.trac.wordpress.org/ticket/61218.
- php: '7.2'
db-version: '9.3'
- php: '7.3'
db-version: '9.3'
with:
os: ${{ matrix.os }}
php: ${{ matrix.php }}
Expand Down
2 changes: 0 additions & 2 deletions .version-support-php.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"6-9": [
"7.2",
"7.3",
"7.4",
"8.0",
"8.1",
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"require": {
"ext-hash": "*",
"ext-json": "*",
"php": ">=7.2.24"
"php": ">=7.4"
},
"suggest": {
"ext-dom": "*"
Expand Down
3 changes: 0 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ services:
- ./tools/local-env/mysql-init.sql:/docker-entrypoint-initdb.d/mysql-init.sql
- mysql:/var/lib/mysql

# For compatibility with PHP versions that don't support the caching_sha2_password auth plugin used in MySQL 8.0.
command: ${LOCAL_DB_AUTH_OPTION-}

healthcheck:
test: [
'CMD-SHELL',
Expand Down
4 changes: 2 additions & 2 deletions phpcompat.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@

<rule ref="PHPCompatibilityWP"/>

<!-- WordPress Core currently supports PHP 7.2+. -->
<config name="testVersion" value="7.2-"/>
<!-- WordPress Core currently supports PHP 7.4+. -->
<config name="testVersion" value="7.4-"/>

<!--
#############################################################################
Expand Down
2 changes: 1 addition & 1 deletion src/readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ <h2>Migrating from other systems</h2>

<h2>System Requirements</h2>
<ul>
<li><a href="https://www.php.net/">PHP</a> version <strong>7.2.24</strong> or greater.</li>
<li><a href="https://www.php.net/">PHP</a> version <strong>7.4</strong> or greater.</li>
<li><a href="https://www.mysql.com/">MySQL</a> version <strong>5.5.5</strong> or greater.</li>
</ul>

Expand Down
1 change: 1 addition & 0 deletions src/wp-admin/includes/class-wp-site-health.php
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,7 @@ public function get_test_php_extensions() {
'function' => 'mysqli_connect',
'required' => false,
),
// Sodium was introduced in PHP 7.2, but the extension may not be enabled.
'libsodium' => array(
'constant' => 'SODIUM_LIBRARY_VERSION',
'required' => false,
Expand Down
4 changes: 2 additions & 2 deletions src/wp-admin/includes/misc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1624,8 +1624,8 @@

$response['is_lower_than_future_minimum'] = false;

// The minimum supported PHP version will be updated to 7.4 in the future. Check if the current version is lower.
if ( version_compare( $version, '7.4', '<' ) ) {
// The minimum supported PHP version will be updated to 8.0 in the future. Check if the current version is lower.
Comment thread
johnbillion marked this conversation as resolved.
Outdated
if ( version_compare( $version, '8.0', '<' ) ) {

Check warning on line 1628 in src/wp-admin/includes/misc.php

View check run for this annotation

Codecov / codecov/patch

src/wp-admin/includes/misc.php#L1628

Added line #L1628 was not covered by tests
$response['is_lower_than_future_minimum'] = true;

// Force showing of warnings.
Expand Down
71 changes: 1 addition & 70 deletions src/wp-includes/compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,80 +273,11 @@ function _mb_strlen( $str, $encoding = null ) {
return --$count;
}

// sodium_crypto_box() was introduced in PHP 7.2.
// sodium_crypto_box() was introduced with Sodium in PHP 7.2, but the extension may not be enabled.
if ( ! function_exists( 'sodium_crypto_box' ) ) {
require ABSPATH . WPINC . '/sodium_compat/autoload.php';
}

if ( ! function_exists( 'is_countable' ) ) {
/**
* Polyfill for is_countable() function added in PHP 7.3.
*
* Verify that the content of a variable is an array or an object
* implementing the Countable interface.
*
* @since 4.9.6
*
* @param mixed $value The value to check.
* @return bool True if `$value` is countable, false otherwise.
*/
function is_countable( $value ) {
return ( is_array( $value )
|| $value instanceof Countable
|| $value instanceof SimpleXMLElement
|| $value instanceof ResourceBundle
);
}
}

if ( ! function_exists( 'array_key_first' ) ) {
/**
* Polyfill for array_key_first() function added in PHP 7.3.
*
* Get the first key of the given array without affecting
* the internal array pointer.
*
* @since 5.9.0
*
* @param array $array An array.
* @return string|int|null The first key of array if the array
* is not empty; `null` otherwise.
*/
function array_key_first( array $array ) { // phpcs:ignore Universal.NamingConventions.NoReservedKeywordParameterNames.arrayFound
if ( empty( $array ) ) {
return null;
}

foreach ( $array as $key => $value ) {
return $key;
}
}
}

if ( ! function_exists( 'array_key_last' ) ) {
/**
* Polyfill for `array_key_last()` function added in PHP 7.3.
*
* Get the last key of the given array without affecting the
* internal array pointer.
*
* @since 5.9.0
*
* @param array $array An array.
* @return string|int|null The last key of array if the array
*. is not empty; `null` otherwise.
*/
function array_key_last( array $array ) { // phpcs:ignore Universal.NamingConventions.NoReservedKeywordParameterNames.arrayFound
if ( empty( $array ) ) {
return null;
}

end( $array );

return key( $array );
}
}

if ( ! function_exists( 'array_is_list' ) ) {
/**
* Polyfill for `array_is_list()` function added in PHP 8.1.
Expand Down
14 changes: 5 additions & 9 deletions src/wp-includes/pluggable.php
Original file line number Diff line number Diff line change
Expand Up @@ -2676,11 +2676,9 @@ function wp_hash_password(
* - `PASSWORD_ARGON2ID`
* - `PASSWORD_DEFAULT`
*
* The values of the algorithm constants are strings in PHP 7.4+ and integers in PHP 7.3 and earlier.
*
* @since 6.8.0
*
Comment thread
johnbillion marked this conversation as resolved.
* @param string|int $algorithm The hashing algorithm. Default is the value of the `PASSWORD_BCRYPT` constant.
* @param string $algorithm The hashing algorithm. Default is the value of the `PASSWORD_BCRYPT` constant.
*/
$algorithm = apply_filters( 'wp_hash_password_algorithm', PASSWORD_BCRYPT );

Expand All @@ -2690,14 +2688,12 @@ function wp_hash_password(
* The default hashing algorithm is bcrypt, but this can be changed via the {@see 'wp_hash_password_algorithm'}
* filter. You must ensure that the options are appropriate for the algorithm in use.
*
* The values of the algorithm constants are strings in PHP 7.4+ and integers in PHP 7.3 and earlier.
*
* @since 6.8.0
*
Comment thread
johnbillion marked this conversation as resolved.
* @param array $options Array of options to pass to the password hashing functions.
* By default this is an empty array which means the default
* options will be used.
* @param string|int $algorithm The hashing algorithm in use.
* @param array $options Array of options to pass to the password hashing functions.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't seem to suggest multiple lines, but this is the one without whitespace to suggest:

Suggested change
* @param array $options Array of options to pass to the password hashing functions.
* @param array<string, string|int> $options Array of options to pass to the password hashing functions.

This is based on looking at the options at https://www.php.net/manual/en/password.constants.php

Naturally this could be done in a follow-up PR via Core-64224.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Yeah I'll do these separately as they're not strictly related to this change despite the parameter type being narrowed with the PHP version bump.

* By default this is an empty array which means the default
* options will be used.
* @param string $algorithm The hashing algorithm in use.
*/
$options = apply_filters( 'wp_hash_password_options', array(), $algorithm );

Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*
* @global string $required_php_version
*/
$required_php_version = '7.2.24';
$required_php_version = '7.4';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific bug fix version of 7.4 that we'd like to make a requirement? It seems that 7.2.24 was used based on usage numbers.

I've created a similar spreadsheet to the one used for the previous bump. Some observations:

  • The "5% or less" criteria is met using 7.4.27.
  • 7.4.x only went up to 7.4.33 so that may not be the best.
  • 7.4.3 has 1.23% for some reason.
  • The only other versions with greater than 1% are 7.4.33 and 7.4.30.
  • No other versions have more than a half percent (0.5%) usage.

I don't know that we'll find a point release with a specific change that we want required, and the last 7.4.x release included security fixes, so technically all others are potentially insecure.

There's a few possible landing spots:

  • 7.4.22 would mean just over 1% of all WordPress sites would be dropped.
  • 7.4.16 would mean just 3% of sites using 7.4.x would be dropped.
  • 7.4.27 would mean less than 5% of PHP sites using PHP 7.4.x would be dropped.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a practical benefit to using a point release as the minimum instead of 7.4.0?

When the minimum was bumped to 5.6 in Core-46594 we ended up on 5.6.20 because of the small fractional difference between that and 5.6.0. When it was bumped to 7.0 in Core-57345 we didn't bother looking at usage for point releases and just went with 7.0.

My preference would be to not introduce an unnecessary point release restriction if it means sites that are on an older point release of 7.4 aren't able to update.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only benefit I can think of is that we ensure certain bug fix are present or specific vulnerabilities are not.

However, I don't know that there is anything specific we want to target in this case. I don't feel strongly about including a particular point release, but just wanted to discuss it because we have used one in the past.


/**
* Holds the names of required PHP extensions.
Expand Down
Loading
Loading