From d38370ad2c4e5a35eecfadcf6a57ee5281b11993 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Mon, 15 Sep 2025 14:53:09 -0400 Subject: [PATCH 1/3] Load old version of the Importer for PHP < 7.2 --- tools/local-env/scripts/install.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/local-env/scripts/install.js b/tools/local-env/scripts/install.js index 891d43cc42cab..032aed77f1e90 100644 --- a/tools/local-env/scripts/install.js +++ b/tools/local-env/scripts/install.js @@ -55,6 +55,11 @@ function wp_cli( cmd ) { function install_wp_importer() { const testPluginDirectory = 'tests/phpunit/data/plugins/wordpress-importer'; + + // The final version of the WordPress Importer plugin with support for PHP < 7.2 is 0.9.0. + const phpVersion = parseFloat(process.env.LOCAL_PHP.split('-')[0]); + const branchFlag = phpVersion < 7.2 ? '--branch 0.9.0' : ''; + execSync( `docker compose exec -T php rm -rf ${testPluginDirectory}`, { stdio: 'inherit' } ); - execSync( `docker compose exec -T php git clone https://github.com/WordPress/wordpress-importer.git ${testPluginDirectory} --depth=1`, { stdio: 'inherit' } ); + execSync( `docker compose exec -T php git clone ${branchFlag} https://github.com/WordPress/wordpress-importer.git ${testPluginDirectory} --depth=1`, { stdio: 'inherit' } ); } From a796304b4748edf094059610b52bf1e0d064bce8 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Mon, 15 Sep 2025 14:55:08 -0400 Subject: [PATCH 2/3] PHP change to trigger build. --- src/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.php b/src/index.php index 91c0517857339..353fc2dfa5157 100644 --- a/src/index.php +++ b/src/index.php @@ -25,6 +25,7 @@ require_once ABSPATH . WPINC . '/compat.php'; require_once ABSPATH . WPINC . '/load.php'; + // Check for the required PHP version and for the MySQL extension or a database drop-in. wp_check_php_mysql_versions(); From ed0e9ae05eedc61b1d26fde45cd183e6c4fae9f6 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Mon, 15 Sep 2025 14:55:15 -0400 Subject: [PATCH 3/3] Revert "PHP change to trigger build." This reverts commit a796304b4748edf094059610b52bf1e0d064bce8. --- src/index.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/index.php b/src/index.php index 353fc2dfa5157..91c0517857339 100644 --- a/src/index.php +++ b/src/index.php @@ -25,7 +25,6 @@ require_once ABSPATH . WPINC . '/compat.php'; require_once ABSPATH . WPINC . '/load.php'; - // Check for the required PHP version and for the MySQL extension or a database drop-in. wp_check_php_mysql_versions();