fix error wp.org#27
Conversation
- Removed Lando configuration and related scripts. - Introduced wp-env configuration with .wp-env.json and updated .distignore. - Updated .env file for local development with new database and WordPress settings. - Migrated testing framework from Codeception to PHPUnit, removing related test configurations. - Updated composer.json and package.json to reflect new dependencies and PHP version requirements. - Adjusted README for installation and testing instructions. - Cleaned up unused files and directories.
| "pretest:unit:report": "wp-env start", | ||
| "test:unit": "wp-env run cli --env-cwd=wp-content/plugins/bea-sanitize-filename ./vendor/bin/phpunit", | ||
| "test:unit:report": "wp-env run cli --env-cwd=wp-content/plugins/bea-sanitize-filename ./vendor/bin/phpunit --testdox", | ||
| "test:unit:once": "npm run wp-env:start && npm run test:unit && npm run wp-env:stop", |
There was a problem hiding this comment.
Docker containers not stopped on test failure
Low Severity
The test:unit:once script uses && to chain wp-env:start, test:unit, and wp-env:stop. Because && short-circuits on failure, if test:unit exits with a non-zero code, wp-env:stop is never executed, leaving Docker containers running and consuming resources. This contradicts the "one-shot" intent documented in the README. The CI workflow handles this correctly using if: always() for the stop step.
- Bump version to 2.0.9 in all relevant files. - Fix invalid smart quotes in special characters list. - Migrate tests to `wp-env` with PHPUnit unit tests only. - Improve testing documentation and scripts.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
There are 3 total unresolved issues (including 1 from previous review).
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| operating-system: [ ubuntu-latest ] |
There was a problem hiding this comment.
Outdated checkout action version in tests workflow
Medium Severity
The tests workflow uses actions/checkout@v2 while the release workflow was updated to actions/checkout@v4 in the same PR. v2 relies on Node.js 12, which GitHub Actions has deprecated and will eventually stop supporting, meaning this workflow will start failing. This is clearly an oversight since the rest of the workflow was heavily modernized.
Additional Locations (1)
| "phpVersion": "8.0", | ||
| "plugins": [ | ||
| "." | ||
| ], |
There was a problem hiding this comment.
Duplicate plugin mount in wp-env configuration
Medium Severity
The plugins array includes "." and mappings also mounts "." to wp-content/plugins/bea-sanitize-filename. This is a known wp-env anti-pattern that causes the plugin to be mounted twice — once under the workspace directory name and once under the explicit mapping name — resulting in duplicate entries in wp plugin list and potential activation under the wrong directory name. The "." entry in plugins is redundant when mappings already handles it.


Note
Medium Risk
Moderate risk because it changes the local/CI test harness and bumps the minimum PHP/tooling versions, which can break contributor workflows and CI. Runtime plugin logic changes are minimal (quote fix) and low risk.
Overview
Bumps plugin version to
2.0.9and fixes thesanitize_file_name_charslist by replacing invalid “smart quote” characters with proper ASCII-quoted strings.Migrates testing from Lando/Codeception to
@wordpress/env(wp-env) with PHPUnit-only unit tests: removes Lando/BrowserStack scripts and Codeception config, addspackage.json/.wp-env.json, updates GitHub Actions tests workflow to run via Node +wp-env, and updates docs/env defaults accordingly.Updates release automation to deploy to WordPress.org via 10up deploy action and attach the generated zip to the GitHub release, and modernizes tooling/deps by requiring PHP
^8.0and upgrading PHPUnit/PHPCS/WPCS.Written by Cursor Bugbot for commit f6876ea. This will update automatically on new commits. Configure here.