Add Plugin Check workflow and remove local plugin-check dependency#2320
Add Plugin Check workflow and remove local plugin-check dependency#2320westonruter merged 24 commits intotrunkfrom
Conversation
Port changes from WordPress/ai#139 to transition from the local wpackagist-plugin/plugin-check dependency to the official wordpress/plugin-check-action GitHub Action. - Add .github/workflows/plugin-check.yml. - Remove wpackagist-plugin/plugin-check from composer.json. - Remove related rules from tools/phpcs/phpcs.ruleset.xml. - Add PHPCS exclusion for object-cache.copy.php filename to allow drop-in naming. Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: felixarntz <flixos90@git.wordpress.org> Co-authored-by: JasonTheAdams <jason_the_adams@git.wordpress.org> Co-authored-by: justlevine <justlevine@git.wordpress.org> Co-authored-by: dkotter <dkotter@git.wordpress.org> Co-authored-by: westonruter <westonruter@git.wordpress.org> Co-authored-by: jeffpaul <jeffpaul@git.wordpress.org>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #2320 +/- ##
=======================================
Coverage 68.87% 68.87%
=======================================
Files 90 90
Lines 7618 7618
=======================================
Hits 5247 5247
Misses 2371 2371
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This introduces a 'prepare-matrix' job to dynamically extract the list of plugins from 'plugins.json'. The 'plugin-check' job then uses this list to run checks in parallel via a matrix strategy, building and checking each plugin separately from its own directory in 'build/'. This fixes an issue where the check was being run on the entire root directory instead of the specific plugin build artifacts. Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
It doesn't seem that the plugin-check action is set up to work in a monorepo of multiple plugins. Specifically the last step of the action is: - name: Upload artifact
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: ${{ always() }}
with:
name: plugin-check-results
path: ${{ runner.temp }}/plugin-check-results.txt
if-no-files-found: ignoreThis is causing problems when plugin-check is running in parallel for multiple plugins. Most of the jobs fail here with:
For the last job in the matrix, it succeeds with:
It seems like the - name: plugin-check-results
+ name: plugin-check-results${{ inputs.slug ? '-' + inputs.slug : '' }} |
…nPrefixedVariableFound
…meFound for intentionally-applied core filters
Move the dependency installation and build process to the preparatory job and share the results via artifacts. This avoids redundant `npm ci` and build steps for every plugin in the matrix, significantly reducing workflow execution time and resource usage. Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
Maybe @swissspidy you can advise here since you implemented the GitHub action? |
Co-authored-by: Pascal Birchler <pascalb@google.com>
|
Yay! The Plugin Check jobs are now all passing. 🎉 |
There was a problem hiding this comment.
Pull request overview
This PR transitions from using a local wpackagist-plugin/plugin-check dependency to the official wordpress/plugin-check-action GitHub Action. This change resolves issues with Plugin Check 1.7.0+ compatibility and modernizes the plugin checking workflow.
Key Changes:
- Added a new Plugin Check GitHub Actions workflow that builds plugins and runs checks in a matrix strategy
- Removed the
wpackagist-plugin/plugin-checkComposer dependency and related PHPCS rules - Updated multiple plugins to address Plugin Check compliance issues including function prefixing, ABSPATH guards, and PHPCS annotations
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/plugin-check.yml |
New workflow that builds plugins and runs Plugin Check action for each plugin in a matrix |
.github/workflows/deploy-plugins.yml |
Updated artifact download action version comment from v5 to v7.0.0 |
composer.json |
Removed wpackagist-plugin/plugin-check dependency and related repository configuration |
composer.lock |
Removed composer/installers and plugin-check package entries |
tools/phpcs/phpcs.ruleset.xml |
Removed Plugin Check PHPCS rule references and added exclusion for object-cache.copy.php filename |
plugins/webp-uploads/uninstall.php |
Refactored multisite cleanup to use array_map instead of foreach |
plugins/webp-uploads/picture-element.php |
Added ABSPATH security guard |
plugins/webp-uploads/image-edit.php |
Added PHPCS ignore comment for core filter usage |
plugins/view-transitions/uninstall.php |
Refactored multisite cleanup to use array_map instead of foreach |
plugins/speculation-rules/uninstall.php |
Refactored multisite cleanup to use array_map instead of foreach |
plugins/speculation-rules/load.php |
Added PHPCS ignore comments for prefixed global variables |
plugins/performance-lab/includes/site-health/webp-support/hooks.php |
Renamed function to add perflab_ prefix |
plugins/performance-lab/includes/site-health/webp-support/helper.php |
Renamed function to add perflab_ prefix |
plugins/performance-lab/includes/site-health/avif-support/hooks.php |
Renamed function to add perflab_ prefix |
plugins/performance-lab/includes/site-health/avif-support/helper.php |
Renamed function to add perflab_ prefix |
plugins/performance-lab/includes/site-health/avif-headers/hooks.php |
Renamed function to add perflab_ prefix |
plugins/performance-lab/includes/site-health/avif-headers/helper.php |
Renamed functions to add perflab_ prefix |
plugins/performance-lab/includes/server-timing/class-perflab-server-timing.php |
Added ABSPATH security guard |
plugins/performance-lab/includes/admin/plugins.php |
Added PHPCS ignore comment for core filter usage |
plugins/performance-lab/includes/admin/load.php |
Added PHPCS ignore comment for core filter usage |
plugins/optimization-detective/uninstall.php |
Renamed variables to add od_ prefix for global scope clarity |
plugins/optimization-detective/readme.txt |
Updated stable tag version |
plugins/optimization-detective/load.php |
Added PHPCS ignore comments for prefixed global variables |
plugins/image-prioritizer/load.php |
Added PHPCS ignore comments for prefixed global variables |
plugins/embed-optimizer/load.php |
Added PHPCS ignore comments for prefixed global variables |
plugins/dominant-color-images/helper.php |
Added ABSPATH security guard |
plugins/auto-sizes/includes/improve-calculate-sizes.php |
Added ABSPATH security guard |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 27 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Closes #2257
Closes #2323
Provided by Gemini 3 in gemini-cli:
Additionally, the plugins have been updated to address various issues that Plugin Check identified.
To do
defaulttext domain, for example: Mismatched text domain. Expected 'dominant-color-images' but got 'default'.Use of AI Tools
Given that I'm adapting a PR from the AI experiments plugin, it felt especially appropriate to use AI to prepare this PR. I used gemini-cli with these key prompts:
"phpcompatibility/php-compatibility": "^9.3"to"phpcompatibility/phpcompatibility-wp": "^3.0.0-alpha"seems out of scope. I think that should be undone. The same goes for replacingPHPCompatibilitywithPHPCompatibilityWPinphpcs.ruleset.xml.github/workflows/plugin-check.ymlisn't working right. It needs to run do the Run plugin check for each of the subdirectories inside ofbuildnot on the entire root directory..github/workflows/plugin-check.ymlwhere it seems to be re-building all plugins multiple times and maybe even running composer install and npm ci. Should these be moved to steps under prepare-matrix?I've provided attribution to the original authors of that AI Experiments PR via
Co-authored-bytrailers in the commit message. I've also prop'ed Gemini.