-
Notifications
You must be signed in to change notification settings - Fork 135
Improve CI infrastructure and expand PHP compatibility #835
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
Conversation
Adds php-parallel-lint as a dev dependency and standardises composer scripts to align with other Automattic plugins: - Adds lint, lint-ci, i18n, coverage, coverage-ci scripts - Adds scripts-descriptions for all commands - Uses consistent -q flag for phpcs/phpcbf 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds .distignore to exclude development files from WordPress.org releases. Includes tests, vendor, node_modules, and configuration files that shouldn't be in production distributions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
No PHP 8+ features are used in this plugin. Aligns with the standard minimum PHP version across Automattic plugins. Changes: - composer.json: >=8.0 -> >=7.4 - .phpcs.xml.dist: testVersion 8.0- -> 7.4- - php-tests.yml: CI matrix starts at PHP 7.4 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request lowers the minimum PHP version from 8.0 to 7.4 to align with WordPress core requirements and adds standardized development tooling. However, the PR is incomplete as it doesn't update all files that reference the PHP version requirement, and contains critical bugs in the new Composer scripts.
Key Changes:
- Adds php-parallel-lint for automated syntax checking across PHP files
- Standardizes Composer scripts with new commands for linting, coverage reporting, and internationalization
- Introduces .distignore to exclude development files from release packages
Critical Issues Found:
- The lint script uses an incorrect path to the parallel-lint executable
- The i18n script incorrectly prefixes a WP-CLI command with
@php - PHP version requirements in edit_flow.php (line 9, 24, 29) and readme.txt (line 6) still reference PHP 8.0 and must be updated to 7.4 for consistency
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| composer.json | Updates PHP requirement to 7.4+, adds php-parallel-lint dependency, and introduces new Composer scripts for linting, coverage, and i18n tasks |
| .phpcs.xml.dist | Updates testVersion from 8.0- to 7.4- to match new minimum PHP version |
| .github/workflows/php-tests.yml | Updates CI test matrix to use PHP 7.4 for lowest supported version testing |
| .distignore | Adds new file to exclude development files and directories from release packages |
composer.json
Outdated
| "lint": "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --exclude vendor --exclude .git", | ||
| "lint-ci": "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --exclude vendor --exclude .git --checkstyle", |
Copilot
AI
Dec 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path to parallel-lint executable is incorrect. Composer packages install their binaries in vendor/bin, not in the package directory. The correct path should be ./vendor/bin/parallel-lint instead of ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint.
| "lint": "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --exclude vendor --exclude .git", | |
| "lint-ci": "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --exclude vendor --exclude .git --checkstyle", | |
| "lint": "@php ./vendor/bin/parallel-lint . -e php --exclude vendor --exclude .git", | |
| "lint-ci": "@php ./vendor/bin/parallel-lint . -e php --exclude vendor --exclude .git --checkstyle", |
composer.json
Outdated
| }, | ||
| "scripts-descriptions": { | ||
| "coverage": "Run tests with code coverage reporting", | ||
| "coverage-ci": "Run tests with code coverage reporting and send results to stdout", |
Copilot
AI
Dec 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script description is misleading. The coverage-ci script does not "send results to stdout" - it runs phpunit without any output flags. To send coverage to stdout, you would need flags like --coverage-text or --coverage-clover. The current command is the same as the coverage script but without the HTML output destination.
| "coverage-ci": "Run tests with code coverage reporting and send results to stdout", | |
| "coverage-ci": "Run tests with code coverage reporting (no HTML output)", |
composer.json
Outdated
| "cs-fix": "Run PHP Code Sniffer and fix violations", | ||
| "i18n": "Generate a POT file for translation", | ||
| "lint": "Run PHP linting", | ||
| "lint-ci": "Run PHP linting and send results to stdout", |
Copilot
AI
Dec 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The lint-ci script description is misleading. While it adds the --checkstyle flag, it doesn't "send results to stdout" in a different way than the regular lint command. The --checkstyle flag outputs in checkstyle XML format, which is useful for CI tools but is still sent to stdout. Consider describing it as "Run PHP linting in checkstyle XML format for CI integration" for clarity.
| "lint-ci": "Run PHP linting and send results to stdout", | |
| "lint-ci": "Run PHP linting in checkstyle XML format for CI integration", |
composer.json
Outdated
| "coverage-ci": "@php ./vendor/bin/phpunit", | ||
| "cs": "@php ./vendor/bin/phpcs -q", | ||
| "cs-fix": "@php ./vendor/bin/phpcbf -q", | ||
| "i18n": "@php wp i18n make-pot . ./languages/edit-flow.pot", |
Copilot
AI
Dec 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The i18n script has an incorrect prefix. The command "wp i18n make-pot" is a WP-CLI command, not a PHP script. It should not be prefixed with "@php". The correct command should be just "wp i18n make-pot . ./languages/edit-flow.pot" or if you need to ensure WP-CLI is called correctly, use the full path to the wp binary.
| "i18n": "@php wp i18n make-pot . ./languages/edit-flow.pot", | |
| "i18n": "wp i18n make-pot . ./languages/edit-flow.pot", |
…sion Corrects issues identified in PR review: - Fix lint script path to use vendor/bin/parallel-lint - Remove @php prefix from i18n script (WP-CLI command) - Update script descriptions for accuracy - Align PHP version requirement to 7.4 in edit_flow.php and readme.txt to match composer.json and phpcs.xml.dist 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This pull request enhances the plugin's development infrastructure and broadens its compatibility.
Summary
Test plan
composer lintruns successfully🤖 Generated with Claude Code