A GitHub Action to run the WordPress Plugin Check (PCP) on your plugin and report results directly in your Pull Requests.
- 🚀 Easy Setup: Works out of the box with minimal configuration.
- 🐳 Isolated Environment: Runs checks inside a temporary WordPress environment using
wp-env. - 💬 PR Comments: Automatically posts a detailed report of errors and warnings to your Pull Request.
- 🛡️ Zero Config: Automatically detects your plugin slug.
Create a workflow file (e.g., .github/workflows/plugin-check.yml) in your repository:
name: Plugin Check
on:
pull_request:
paths:
- '**/*.php'
- 'readme.txt'
jobs:
check:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write # Required to post/update PR comments
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Run Plugin Check
uses: Utsav-Ladani/wordpress-plugin-check@main
with:
plugin: 'https://example.com/path/to/your-plugin.zip'
# token: ${{ secrets.GITHUB_TOKEN }} # Optional, defaults to github.token| Input | Description | Required | Default |
|---|---|---|---|
plugin |
Plugin ZIP URL or local path. Supports both remote ZIP files (e.g., https://example.com/plugin.zip) and local directories (e.g., ./my-plugin). |
Yes | |
token |
GitHub Token used to post comments. | No | ${{ github.token }} |
This example builds your plugin into a ZIP and checks it:
name: Plugin Check
on:
pull_request:
push:
branches: [main]
jobs:
check:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Composer Dependencies
run: composer install --no-dev --optimize-autoloader
- name: Install NPM Dependencies
run: npm install
- name: Build Assets
run: npm run build
- name: Create Plugin ZIP
run: npm run plugin-zip
- name: Upload Plugin ZIP
uses: actions/upload-artifact@v4
id: upload-zip
with:
name: plugin-zip
path: ./plugin.zip
- name: Run Plugin Check
uses: Utsav-Ladani/wordpress-plugin-check@main
with:
plugin: ${{ steps.upload-zip.outputs.artifact-url }}This example checks the plugin directly from your repository:
name: Plugin Check
on:
pull_request:
jobs:
check:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Run Plugin Check
uses: Utsav-Ladani/wordpress-plugin-check@main
with:
plugin: './my-plugin' # Check plugin in current directory- name: Run Plugin Check
uses: Utsav-Ladani/wordpress-plugin-check@main
with:
plugin: 'https://github.com/your-org/your-plugin/releases/download/v1.0.0/plugin.zip'- name: Run Plugin Check
uses: Utsav-Ladani/wordpress-plugin-check@main
with:
plugin: 'https://downloads.wordpress.org/plugin/my-plugin.1.0.0.zip'This action is built using Node.js.
To build the action for distribution:
npm install
npm run build