Skip to content

Conversation

@GaryJones
Copy link
Contributor

This pull request enhances the plugin's development infrastructure and broadens its compatibility.

Summary

  • Add php-parallel-lint for automated syntax checking
  • Standardise Composer scripts with lint, coverage, and i18n tasks
  • Add .distignore for cleaner release packages
  • Lower minimum PHP version from 8.0 to 7.4 to match WordPress requirements
  • Update PHPCS testVersion and CI matrix accordingly

Test plan

  • Verify composer lint runs successfully
  • Verify integration tests pass on PHP 7.4
  • Check .distignore excludes development files

🤖 Generated with Claude Code

GaryJones and others added 3 commits December 13, 2025 01:25
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>
Copilot AI review requested due to automatic review settings December 14, 2025 01:11
Copy link

Copilot AI left a 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
Comment on lines 30 to 31
"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",
Copy link

Copilot AI Dec 14, 2025

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.

Suggested change
"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",

Copilot uses AI. Check for mistakes.
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",
Copy link

Copilot AI Dec 14, 2025

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.

Suggested change
"coverage-ci": "Run tests with code coverage reporting and send results to stdout",
"coverage-ci": "Run tests with code coverage reporting (no HTML output)",

Copilot uses AI. Check for mistakes.
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",
Copy link

Copilot AI Dec 14, 2025

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.

Suggested change
"lint-ci": "Run PHP linting and send results to stdout",
"lint-ci": "Run PHP linting in checkstyle XML format for CI integration",

Copilot uses AI. Check for mistakes.
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",
Copy link

Copilot AI Dec 14, 2025

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.

Suggested change
"i18n": "@php wp i18n make-pot . ./languages/edit-flow.pot",
"i18n": "wp i18n make-pot . ./languages/edit-flow.pot",

Copilot uses AI. Check for mistakes.
…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>
@GaryJones GaryJones merged commit 3201667 into develop Dec 14, 2025
14 checks passed
@GaryJones GaryJones deleted the standardize/add-php-lint branch December 14, 2025 02:34
@GaryJones GaryJones added this to the Next (minor) milestone Dec 14, 2025
@GaryJones GaryJones self-assigned this Dec 14, 2025
@GaryJones GaryJones added the type: maintenance Routine maintenance and code quality improvements label Dec 14, 2025
@GaryJones GaryJones mentioned this pull request Jan 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: maintenance Routine maintenance and code quality improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants