Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump minimum PHP requirement to 7.2 #1130

Merged
merged 21 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/tests export-ignore
/plugin-tests export-ignore
/plugins export-ignore
/build-cs export-ignore

/*.DS_store export-ignore
/.DS_store? export-ignore
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/php-test-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.2', '8.1', '8.0', '7.4', '7.3', '7.2', '7.1', '7.0']
php: ['8.2', '8.1', '8.0', '7.4', '7.3', '7.2']
wp: [ 'latest' ]
include:
- php: '7.4'
Expand All @@ -65,11 +65,8 @@ jobs:
run: npm run build
- name: Install WordPress
run: npm run wp-env start
# Note that `composer update` is required instead of `composer install`
# for the sake of PHP versions older than 8.1, which is the version of
# PHP that the composer.lock was created for.
- name: Composer update
run: npm run wp-env run tests-cli -- --env-cwd="wp-content/plugins/$(basename $(pwd))" composer update --no-interaction
- name: Composer Install
run: npm run wp-env run tests-cli -- --env-cwd="wp-content/plugins/$(basename $(pwd))" composer install --no-interaction --no-progress
- name: Running single site unit tests for plugins
run: npm run test-php-plugins
- name: Running multisite unit tests for plugins
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/php-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.2', '8.1', '8.0', '7.4', '7.3', '7.2', '7.1', '7.0']
php: ['8.2', '8.1', '8.0', '7.4', '7.3', '7.2']
wp: [ 'latest' ]
include:
- php: '7.4'
Expand All @@ -66,11 +66,8 @@ jobs:
run: jq '.plugins = [.plugins[0]]' .wp-env.json > .wp-env.override.json
- name: Install WordPress
run: npm run wp-env start
# Note that `composer update` is required instead of `composer install`
# for the sake of PHP versions older than 8.1, which is the version of
# PHP that the composer.lock was created for.
- name: Composer update
run: npm run wp-env run tests-cli -- --env-cwd="wp-content/plugins/$(basename $(pwd))" composer update --no-interaction
- name: Composer Install
run: npm run wp-env run tests-cli -- --env-cwd="wp-content/plugins/$(basename $(pwd))" composer install --no-interaction --no-progress
- name: Running single site unit tests
run: npm run test-php
- name: Running multisite unit tests
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ nbproject/
build
.wp-env.override.json
*.asset.php
build-cs/vendor/
build-cs/composer.lock

############
## Vendor
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Thank you for your interest in contributing to the Performance Lab plugin! Compl
In general, all code must follow the [WordPress Coding Standards and best practices](https://developer.wordpress.org/coding-standards/). All code in the Performance Lab plugin must follow these requirements:

- **WordPress**: As of Performance Lab v3.0.0, released April 15, 2024, the plugin's minimum WordPress version requirement is 6.4.
- **PHP**: Always match the latest WordPress version. The minimum required version right now is 7.0.
- **PHP**: Always match the latest WordPress version. The minimum required version right now is 7.2.


## Guidelines
Expand Down
2 changes: 1 addition & 1 deletion bin/phpcs/phpcs.ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<description>Sniffs for WordPress plugins</description>

<rule ref="PHPCompatibility"/>
<config name="testVersion" value="7.0-"/>
<config name="testVersion" value="7.2-"/>

<rule ref="WordPress-Docs"/>
<rule ref="WordPress-Extra" />
Expand Down
20 changes: 0 additions & 20 deletions build-cs/composer.json

This file was deleted.

96 changes: 52 additions & 44 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,50 @@
{
"name": "wordpress/performance",
"type": "wordpress-plugin",
"license": "GPL-2.0-or-later",
"description": "Performance plugin from the WordPress Performance Team, which is a collection of standalone performance features.",
"homepage": "https://wordpress.org/plugins/performance-lab/",
"license": "GPL-2.0-or-later",
"type": "wordpress-plugin",
"keywords": [
"performance",
"wordpress"
],
"homepage": "https://wordpress.org/plugins/performance-lab/",
"support": {
"issues": "https://github.com/WordPress/performance/issues"
},
"require": {
"php": "^7.2 || ^8.0",
"ext-json": "*"
},
"require-dev": {
"wp-phpunit/wp-phpunit": "^5.8",
"phpcompatibility/php-compatibility": "^9.3",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-deprecation-rules": "^1.1",
"phpstan/phpstan-phpunit": "^1.3",
"slevomat/coding-standard": "^8.0",
"squizlabs/php_codesniffer": "^3.9",
"szepeviktor/phpstan-wordpress": "^1.3",
"wp-coding-standards/wpcs": "^3.1",
"wp-phpunit/wp-phpunit": "^6.5",
"yoast/phpunit-polyfills": "^1.0"
},
"require": {
"composer/installers": "~1.0",
"ext-json": "*",
"php": ">=7|^8"
"autoload-dev": {
"psr-4": {
"PerformanceLab\\Tests\\": "tests/utils"
}
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true
Comment on lines +37 to +39
Copy link
Member

Choose a reason for hiding this comment

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

Is this missing composer/installers? I'm getting the following when I do composer install:

image

Copy link
Member

Choose a reason for hiding this comment

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

composer/installers contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "composer/installers" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] ?
y - add package to allow-plugins in composer.json and let it run immediately
n - add package (as disallowed) to allow-plugins in composer.json to suppress further prompts
d - discard this, do not change composer.json and do not allow the plugin to run
? - print help
Do you trust "composer/installers" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] d

I went with d. I'm not seeing it happen now when I do composer install. 😕

Copy link
Member Author

Choose a reason for hiding this comment

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

This might be due to stale vendor content. I don't see if we are using this plugin so I removed it.

},
"platform": {
"php": "7.2"
}
},
"scripts": {
"post-install-cmd": "if php -r 'exit( version_compare( phpversion(), \"8.1\", \">=\" ) ? 0 : 1 );'; then composer --working-dir=build-cs install --no-interaction; else echo 'Skipping composer install for build-cs since not on PHP 8.1+. You are running: '; php -v; fi",
"post-update-cmd": "if php -r 'exit( version_compare( phpversion(), \"8.1\", \">=\" ) ? 0 : 1 );'; then composer --working-dir=build-cs update --no-interaction; else echo 'Skipping composer update for build-cs since not on PHP 8.1+. You are running: '; php -v; fi",
"phpstan": "build-cs/vendor/bin/phpstan analyse --memory-limit=2048M",
"format": "build-cs/vendor/bin/phpcbf --report-summary --report-source",
"lint": "build-cs/vendor/bin/phpcs",
"format": "phpcbf --report-summary --report-source",
"lint": "phpcs",
"lint:all": [
"@lint",
"@lint:auto-sizes",
Expand All @@ -41,24 +60,17 @@
"lint:optimization-detective": "@lint -- ./plugins/optimization-detective --standard=./plugins/optimization-detective/phpcs.xml.dist",
"lint:speculation-rules": "@lint -- ./plugins/speculation-rules --standard=./plugins/speculation-rules/phpcs.xml.dist",
"lint:webp-uploads": "@lint -- ./plugins/webp-uploads --standard=./plugins/webp-uploads/phpcs.xml.dist",
"phpstan": "phpstan analyse --memory-limit=2048M",
"test": "phpunit --verbose --testsuite performance-lab",
"test-multisite": "phpunit -c tests/multisite.xml --verbose --testsuite performance-lab",
"test:all": [
"@test",
"@test:plugins"
],
"test-multisite:all": [
"@test-multisite",
"@test-multisite:plugins"
],
"test:plugins": [
"@test:auto-sizes",
"@test:dominant-color-images",
"@test:embed-optimizer",
"@test:optimization-detective",
"@test:speculation-rules",
"@test:webp-uploads"
],
"test-multisite:auto-sizes": "phpunit -c tests/multisite.xml --verbose --testsuite auto-sizes",
"test-multisite:dominant-color-images": "phpunit -c tests/multisite.xml --verbose --testsuite dominant-color-images",
"test-multisite:embed-optimizer": "phpunit -c tests/multisite.xml --verbose --testsuite embed-optimizer",
"test-multisite:optimization-detective": "phpunit -c tests/multisite.xml --verbose --testsuite optimization-detective",
"test-multisite:plugins": [
"@test-multisite:auto-sizes",
"@test-multisite:dominant-color-images",
Expand All @@ -67,29 +79,25 @@
"@test-multisite:speculation-rules",
"@test-multisite:webp-uploads"
],
"test-multisite:speculation-rules": "phpunit -c tests/multisite.xml --verbose --testsuite speculation-rules",
"test-multisite:webp-uploads": "phpunit -c tests/multisite.xml --verbose --testsuite webp-uploads",
"test:all": [
"@test",
"@test:plugins"
],
"test:auto-sizes": "phpunit --verbose --testsuite auto-sizes",
"test-multisite:auto-sizes": "phpunit -c tests/multisite.xml --verbose --testsuite auto-sizes",
"test:dominant-color-images": "phpunit --verbose --testsuite dominant-color-images",
"test-multisite:dominant-color-images": "phpunit -c tests/multisite.xml --verbose --testsuite dominant-color-images",
"test:embed-optimizer": "phpunit --verbose --testsuite embed-optimizer",
"test-multisite:embed-optimizer": "phpunit -c tests/multisite.xml --verbose --testsuite embed-optimizer",
"test:optimization-detective": "phpunit --verbose --testsuite optimization-detective",
"test-multisite:optimization-detective": "phpunit -c tests/multisite.xml --verbose --testsuite optimization-detective",
"test:plugins": [
"@test:auto-sizes",
"@test:dominant-color-images",
"@test:embed-optimizer",
"@test:optimization-detective",
"@test:speculation-rules",
"@test:webp-uploads"
],
"test:speculation-rules": "phpunit --verbose --testsuite speculation-rules",
"test-multisite:speculation-rules": "phpunit -c tests/multisite.xml --verbose --testsuite speculation-rules",
"test:webp-uploads": "phpunit --verbose --testsuite webp-uploads",
"test-multisite:webp-uploads": "phpunit -c tests/multisite.xml --verbose --testsuite webp-uploads"
},
"config": {
"allow-plugins": {
"composer/installers": true,
"phpstan/extension-installer": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"autoload-dev": {
"psr-4": {
"PerformanceLab\\Tests\\": "tests/utils"
}
"test:webp-uploads": "phpunit --verbose --testsuite webp-uploads"
}
}
Loading
Loading