Skip to content

Add WP plugin check for main CI and local dev#24

Merged
bradvin merged 2 commits into
developfrom
feat/plugin-check-ci-main-local
Feb 27, 2026
Merged

Add WP plugin check for main CI and local dev#24
bradvin merged 2 commits into
developfrom
feat/plugin-check-ci-main-local

Conversation

@bradvin
Copy link
Copy Markdown
Owner

@bradvin bradvin commented Feb 25, 2026

What I changed

Branch pulled/synced: develop (from origin/develop)
Work branch created: feat/plugin-check-ci-main-local

  1. CI: Plugin Check for main
    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:
npm ci
npm run plugin:check
  1. Local dev: plugin check command
    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:
starts wp-env
installs/activates official plugin-check
runs wp plugin check clawpress
  1. Docs
    Updated README.md and CONTRIBUTING.md to include npm run plugin:check for local dev.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Feb 26, 2026

Greptile Summary

Added WordPress Plugin Check tooling for both CI and local development to ensure plugin meets WordPress.org standards.

  • CI Integration: New plugin-check job runs on pushes to main and PRs targeting main
  • Local Development: New npm run plugin:check command uses wp-env to run plugin standards check
  • Critical Issue: CI workflow missing composer install - plugin requires vendor dependencies to load properly

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

  • This PR has a critical bug that will prevent the CI check from working correctly
  • The missing composer install step in the CI workflow is a critical issue that will cause the plugin to fail to load its required dependencies (wordpress/wp-ai-client, woocommerce/action-scheduler, automattic/jetpack-autoloader). Without these dependencies, the plugin cannot activate properly in wp-env, making the plugin check unreliable. The rest of the implementation is solid.
  • .github/workflows/ci.yml needs composer install added before running the plugin check

Important Files Changed

Filename Overview
.github/workflows/ci.yml Added plugin-check job for main branch, but missing composer install step needed for plugin dependencies
bin/plugin-check Well-structured bash script with proper error handling to run WordPress plugin check via wp-env
.wp-env.json Minimal but correct wp-env configuration to mount plugin for testing
package.json Added plugin:check script and @wordpress/env dependency for local plugin testing

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
Loading

Last reviewed commit: 0e7f66d

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment thread .github/workflows/ci.yml
Comment on lines +68 to +69
- name: Install dependencies
run: npm ci
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- name: Install dependencies
run: npm ci
- name: Install dependencies
run: |
npm ci
composer install --no-interaction --prefer-dist

@foo-bender
Copy link
Copy Markdown
Collaborator

Follow-up clarification: in the plugin-check job I added setup-php + composer install --no-interaction --prefer-dist --no-progress before npm run plugin:check, so vendor deps are present when the plugin boots in wp-env.

@bradvin
Copy link
Copy Markdown
Owner Author

bradvin commented Feb 27, 2026

@greptile

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Feb 27, 2026

Greptile Summary

This 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 npm run plugin:check to run the same checks in a disposable wp-env environment.

Key changes:

  • CI plugin-check job properly addresses the previous comment about missing composer dependencies
  • New bin/plugin-check script orchestrates local plugin checks via wp-env
  • .wp-env.json provides minimal but functional configuration
  • Documentation updated in README.md and CONTRIBUTING.md

Issue found:

  • The local bin/plugin-check script doesn't run composer install before starting wp-env, which could cause unreliable results if dependencies aren't already installed. The CI workflow handles this correctly.

Confidence Score: 4/5

  • This PR is safe to merge with one non-critical fix recommended for local development reliability
  • The CI implementation is solid and properly addresses the previous composer dependency concern. The only issue is the local dev script missing composer install, which could cause problems if dependencies aren't already installed but doesn't affect CI reliability. All other changes are straightforward configuration and documentation updates.
  • bin/plugin-check needs composer install added before wp-env start for consistency with CI workflow

Important Files Changed

Filename Overview
.github/workflows/ci.yml Adds plugin-check job with proper triggers, PHP/Composer setup, and dependency installation
bin/plugin-check Bash script to run plugin check locally via wp-env; missing composer install before wp-env start
.wp-env.json Minimal wp-env config that mounts current directory as plugin
package.json Adds plugin:check script and @wordpress/env dev dependency

Last reviewed commit: 04366c0

Comment thread bin/plugin-check
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"

cd "$REPO_ROOT"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run composer install before starting wp-env to ensure dependencies are available when the plugin loads

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

@bradvin bradvin merged commit 80d7b2d into develop Feb 27, 2026
4 checks passed
@bradvin bradvin deleted the feat/plugin-check-ci-main-local branch February 27, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants