Add WP plugin check for main CI and local dev#24
Conversation
Greptile SummaryAdded WordPress Plugin Check tooling for both CI and local development to ensure plugin meets WordPress.org standards.
The implementation is well-structured with proper bash error handling and clear documentation, but the missing composer step will cause the CI check to fail or produce unreliable results. Confidence Score: 2/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[CI: Push to main or PR to main] --> B{plugin-check job}
B --> C[npm ci]
C --> D[npm run plugin:check]
D --> E[bin/plugin-check script]
F[Local: npm run plugin:check] --> E
E --> G[npx wp-env start]
G --> H[Install plugin-check plugin]
H --> I[wp plugin check clawpress]
I --> J[Plugin standards report]
style B fill:#f9f,stroke:#333
style E fill:#bbf,stroke:#333
style J fill:#bfb,stroke:#333
Last reviewed commit: 0e7f66d |
| - name: Install dependencies | ||
| run: npm ci |
There was a problem hiding this comment.
Missing composer install before running plugin check. The plugin requires composer dependencies (wordpress/wp-ai-client, woocommerce/action-scheduler, automattic/jetpack-autoloader) to load properly. Without these, the plugin will fail to activate in wp-env and the check results will be unreliable.
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install dependencies | |
| run: | | |
| npm ci | |
| composer install --no-interaction --prefer-dist |
|
Follow-up clarification: in the plugin-check job I added setup-php + |
|
@greptile |
Greptile SummaryThis PR adds WordPress plugin check functionality for both CI and local development. The CI workflow now runs plugin checks when pushing to main or opening PRs against main, and includes proper PHP/Composer setup with dependency installation. Local developers can use Key changes:
Issue found:
Confidence Score: 4/5
Important Files Changed
Last reviewed commit: 04366c0 |
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" | ||
|
|
||
| cd "$REPO_ROOT" |
There was a problem hiding this comment.
Run composer install before starting wp-env to ensure dependencies are available when the plugin loads
| cd "$REPO_ROOT" | |
| cd "$REPO_ROOT" | |
| echo "Installing Composer dependencies..." | |
| composer install --no-interaction --prefer-dist --no-progress | |
| echo "Starting wp-env for plugin check..." |
What I changed
Branch pulled/synced: develop (from origin/develop)
Work branch created: feat/plugin-check-ci-main-local
Updated .github/workflows/ci.yml:
Added push trigger for main
Added new plugin-check job that runs only when:
pushing to main, or
PR base branch is main
Job runs:
Added:
package.json script:
plugin:check → bin/plugin-check
.wp-env.json to mount this plugin in a disposable WP env
bin/plugin-check script that:
Updated README.md and CONTRIBUTING.md to include npm run plugin:check for local dev.