Skip to content

Commit 5281626

Browse files
authored
Merge pull request #530 from wpengine/issue-488-hwp-previews-review
chore(previews): test against WordPress 6.9
2 parents 3a74934 + b0f7b96 commit 5281626

File tree

12 files changed

+600
-547
lines changed

12 files changed

+600
-547
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@wpengine/hwp-previews-wordpress-plugin": patch
3+
---
4+
5+
Verify WordPress 6.9 compatibility and update CI test matrix
6+
7+
- Tested compatibility with WordPress 6.9
8+
- Updated CI test matrix to WordPress 6.9, 6.8, 6.7 (dropped 6.5, 6.6)
9+
- Updated dev dependencies (mockery/mockery to ^1.6, wp-graphql/wp-graphql-testcase to ^3.4)
10+
- Updated Docker defaults to WordPress 6.9
11+
- Reduced readme.txt tags to 5 for WordPress.org compliance

.github/workflows/code-quality.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,11 @@ jobs:
6565
id: detect-php-version
6666
run: |
6767
PLUGIN="${{ steps.plugin.outputs.slug }}"
68-
PHP_VERSION="7.4"
69-
if [ -f "plugins/$PLUGIN/composer.json" ]; then
70-
DETECTED_VERSION=$(jq -r '.require["php"] // empty' plugins/$PLUGIN/composer.json | grep -oE '[0-9]+\.[0-9]+' | head -1)
71-
if [ -n "$DETECTED_VERSION" ]; then
72-
PHP_VERSION="$DETECTED_VERSION"
73-
echo "Detected PHP version $PHP_VERSION from composer.json"
74-
else
75-
echo "No PHP version found in composer.json, using default $PHP_VERSION"
76-
fi
77-
else
78-
echo "No composer.json found, using default PHP version $PHP_VERSION"
79-
fi
68+
# Use PHP 8.2 for code quality checks - PHPStan/Psalm can analyze older PHP code
69+
# while running on newer PHP. This is required because wordpress-stubs v6.8+
70+
# contain PHP 8+ syntax that cannot be parsed by PHP 7.4.
71+
PHP_VERSION="8.2"
72+
echo "Using PHP $PHP_VERSION for code quality checks"
8073
echo "php-version=$PHP_VERSION" >> $GITHUB_OUTPUT
8174
quality-checks:
8275
needs: detect-plugins

plugins/hwp-previews/.docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
ARG WP_VERSION
88
ARG PHP_VERSION
99

10-
FROM wordpress:${WP_VERSION:-6.8}-php${PHP_VERSION:-8.2}
10+
FROM wordpress:${WP_VERSION:-6.9}-php${PHP_VERSION:-8.2}
1111

1212
# Needed to specify the build args again after the FROM command.
1313
ARG WP_VERSION

plugins/hwp-previews/bin/build-docker.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ print_usage_instructions() {
1414
echo "Example use:"
1515
echo " npm run docker:build"
1616
echo ""
17-
echo " WP_VERSION=6.7 PHP_VERSION=8.2 npm run docker:build -- - c"
17+
echo " WP_VERSION=6.9 PHP_VERSION=8.2 npm run docker:build -- - c"
1818
echo ""
19-
echo " WP_VERSION=6.7 PHP_VERSION=8.2 bin/build-docker.sh -- c"
19+
echo " WP_VERSION=6.9 PHP_VERSION=8.2 bin/build-docker.sh -- c"
2020
exit 1
2121
}
2222

@@ -50,7 +50,7 @@ done
5050

5151

5252
TAG=${TAG:-latest}
53-
WP_VERSION=${WP_VERSION:-6.7}
53+
WP_VERSION=${WP_VERSION:-6.9}
5454
PHP_VERSION=${PHP_VERSION:-8.2}
5555

5656
BUILD_NO_CACHE=${BUILD_NO_CACHE:-}

plugins/hwp-previews/composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@
4141
"humanmade/psalm-plugin-wordpress": "^3.1",
4242
"johnpbloch/wordpress-core": "^6.8",
4343
"lucatume/wp-browser": "^3.5",
44-
"mockery/mockery": "^1.5",
45-
"phpcompatibility/php-compatibility": "dev-develop as 9.99.99",
44+
"mockery/mockery": "^1.6",
45+
"phpcompatibility/php-compatibility": "^9.3",
4646
"phpcompatibility/phpcompatibility-wp": "^2.0",
4747
"phpstan/phpstan-strict-rules": "^2.0",
4848
"slevomat/coding-standard": "^8.0",
4949
"szepeviktor/phpstan-wordpress": "^2.0",
5050
"wp-cli/wp-cli-bundle": "^2.8.1",
51-
"wp-graphql/wp-graphql-testcase": "^3.0.1"
51+
"wp-graphql/wp-graphql-testcase": "^3.4"
5252
},
5353
"config": {
5454
"allow-plugins": {

0 commit comments

Comments
 (0)