Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions .github/workflows/install-testing.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Confirms that installing WordPress using WP-CLI works successfully.
#
# This workflow is not meant to test wordpress-develop checkouts, but rather tagged versions officially available on WordPress.org.
#
# This workflow is triggered for all WordPress versions that are currently receiving security updates. It therefore needs to
# retain support for older PHP and database versions.
name: Installation Tests

on:
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/local-docker-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,6 @@ jobs:
- db-version: '9.2'
- db-version: '9.3'
- db-version: '9.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.5'
- php: '7.3'
db-version: '9.5'
# No PHP 8.5 + Memcached support yet.
- php: '8.5'
memcached: true
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/phpunit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,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', '8.5' ]
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
db-type: [ 'mysql' ]
db-version: [ '5.7', '8.0', '8.4' ]
tests-domain: [ 'example.org' ]
Expand Down Expand Up @@ -149,7 +149,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', '8.5' ]
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
db-type: [ 'mariadb' ]
db-version: [ '5.5', '10.3', '10.5', '10.6', '10.11', '11.4', '11.8' ]
multisite: [ false, true ]
Expand Down Expand Up @@ -201,19 +201,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', '8.5' ]
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
db-type: [ 'mysql', 'mariadb' ]
db-version: [ '9.5', '12.0' ]
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.5'
- php: '7.3'
db-version: '9.5'
# Exclude version combinations that don't exist.
- db-type: 'mariadb'
db-version: '9.5'
Expand Down Expand Up @@ -248,7 +243,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 Expand Up @@ -277,7 +272,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ '7.2', '8.4' ]
php: [ '7.4', '8.4' ]
db-version: [ '8.4', '11.8' ]
db-type: [ 'mysql', 'mariadb' ]
multisite: [ false ]
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 @@ -75,8 +75,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
22 changes: 4 additions & 18 deletions .github/workflows/upgrade-develop-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,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.7', '6.8', '6.9-RC1' ]
# WordPress 5.3 is the oldest version that supports PHP 7.4.
wp: [ '5.3', '6.7', '6.8', '6.9-RC1' ]
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 All @@ -98,17 +90,11 @@ jobs:
fail-fast: false
matrix:
os: [ 'ubuntu-24.04' ]
php: [ '7.2', '8.4' ]
php: [ '7.4', '8.4' ]
db-type: [ 'mysql' ]
db-version: [ '8.4' ]
# WordPress 4.9 is the oldest version that supports PHP 7.2.
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'
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 @@ -68,23 +68,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', '8.5' ]
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
db-type: [ 'mysql' ]
db-version: [ '5.7', '8.0', '8.4', '9.5' ]
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.5'
- php: '7.3'
db-version: '9.5'
with:
os: ${{ matrix.os }}
php: ${{ matrix.php }}
Expand All @@ -105,16 +93,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 @@ -124,7 +107,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 @@ -135,16 +118,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 @@ -199,23 +177,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.5' ]
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.5'
- php: '7.3'
db-version: '9.5'
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 @@
{
"7-0": [
"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 @@ -965,6 +965,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 @@ -1621,8 +1621,8 @@ function wp_check_php_version() {

$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 at least 8.0 in the future. Check if the current version is lower.
if ( version_compare( $version, '8.0', '<' ) ) {
$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 @@ -296,80 +296,11 @@ function utf8_decode( $utf8_text ): string {
endif;
endif;

// 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
Loading
Loading