Adding Plugin Check (PCP) to Your Development Workflow

In 2022, there was a post about a WordPress plugin checker that would be a tool for statically scanning plugins to identify if it follows certain guidelines and best practices.

After a long development process over the last two years, the Plugin Check plugin (PCP) was officially introduced.

The plugin team made an announcement that PCP will be used on all newly submitted plugins to the .org repository

when you submit a new plugin to the Plugins Directory, it will first be run through Plugin Check’s Plugin Repo category. If the new plugin has an error level item in this category, the submission will be blocked from being submitted for review, until it is fixed.

If you’re planning on submitting a new plugin to WordPress.org, then you should definitely test out PCP on your current development.

They also noted that they’re going to start running all existing plugins through it too:

While this pre-submission check applies only to new plugins being submitted into the WordPress.org Directory, our goal is to continue to expand our use of Plugin Check on existing plugins as well.

With that, now is the time to check your plugin(s) and fix any issues before they pull your plugin from the repository due to guideline violations they detect.

Let’s walk through how using PCP can improve your codebase, provide quick automated feedback and prevent issues with the WordPress.org repository.

Download the Plugin Check plugin and run it manually

If you have never used PCP before, it’s a development plugin that you can download directly through the admin’s plugin page or manually from WordPress.org.

Just be sure that you’re installing it in a local or development only environment.

It is not meant to run on a production site.

Once you’ve downloaded and installed the plugin, navigate to the plugin’s page in the tools section of the menu and you’ll be presented with some options on areas you’d like to check.

First, select the plugin you want to run tests on.

Then select the areas you’d like to check within the selected plugin:

  • General
  • Plugin Repo
  • Security
  • Performance
  • Accessibility

If you’d only like to verify that the plugin will be a good fit for plugin review in the submission process, then you can just run the “Plugin Repo” option.

It’s not guaranteed that your plugin will be approved if it passes here, but it will check all the most common issues. Your plugin will still need to be manually reviewed.

As an example, Hello Dolly has some work to do 😅

Run The Plugin Check GitHub action In Your Repository

If you host your plugin on GitHub, the plugin team has provided a free GitHub action to integrate checks directly with minimal setup.

I’ve written previous issues on setting up GitHub actions for your WordPress plugin if you’d like to learn more.

Whenever you submit a new pull request, you can have the plugin check run through the changes and identify anything that will need to be fixed.

You can add this with a new workflow file in your project.

  1. Create a new file in your project .github/workflows/plugin_check.yml
  2. Add the necessary configuration
name: 'plugin-check'

on: # check all pull requests and pushes to the `main` branch
  pull_request:
  push:
    branches:
    - main

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v4

    - name: Run plugin check
      uses: wordpress/plugin-check-action@v1

When you add that to your Github project, you’ll be able to see any issues that arise when pushing new pull requests or the main branch.

Here’s an example from the action repository that shows what the errors will look like when running the action:

The action configuration can be more advanced, but what I’ve shown above is enough to at least get started with it.

You can view more advanced documentation in the GitHub Action’s repository.

In Conclusion

The Plugin Check (PCP) is a great tool that will definitely help you improve your codebase over time.

It’s going to bring a lot of consistency to The Plugins Team and help them reduce their queue substantially which I’m thankful for.

A shorter queue means less waiting for approval 😎

It’s a great chance for introducing automated testing in your development workflow and it’ll help you improve the quality of your plugin’s code.

Have you used PCP yet? What do you think about it?