Introducing Plugin Check (PCP)

After the original proposal for a WordPress plugin check a little over two years ago, the Plugin Check plugin (or PCP for short) has become a reality. It saw its first stable release earlier this year and has since been used by hundreds of developers. This post provides more context about PluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party Check and why you should start using it.

Plugin Check is a tool for testing whether your plugin meets the required standards for the WordPress.orgWordPress.org The community site where WordPress code is created and shared by the users. This is where you can download the source code for WordPress core, plugins and themes as well as the central location for community conversations and organization. https://wordpress.org/ plugin directory. With this plugin you will be able to run most of the checks used for new submissions, and check if your plugin meets the requirements. The plugins team is currently working on making it an integral part of the review process. If you are considering submitting a new plugin to the plugin directory, run these checks yourself beforehand to save time later on.

But there is more! In addition to things relevant for the review process, the tool flags violations or concerns around plugin development best practices, from basic requirements like correct usage of internationalization functions to accessibilityAccessibility Accessibility (commonly shortened to a11y) refers to the design of products, devices, services, or environments for people with disabilities. The concept of accessible design ensures both “direct access” (i.e. unassisted) and “indirect access” meaning compatibility with a person’s assistive technology (for example, computer screen readers). (https://en.wikipedia.org/wiki/Accessibility), performance, and security best practices. It does so using both static checks using PHP_CodeSniffer and dynamic checks, where it actually activates your plugin to test it “live”.

Because of this, PCP is useful even beyond the initial plugin submission, which is why it’s recommended to make it a part of your development workflow. This shortens your feedback loopLoop The Loop is PHP code used by WordPress to display posts. Using The Loop, WordPress processes each post to be displayed on the current page, and formats it according to how it matches specified criteria within The Loop tags. Any HTML or PHP code in the Loop will be processed on each post. https://codex.wordpress.org/The_Loop. as you can immediately address potential bugs as they come up, before they affect your users. To achieve this, simply install the plugin on a local environment and regularly run it against your plugin. The checks can be run either via WordPress admin or WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is http://wp-cli.org/ https://make.wordpress.org/cli/.

For even more peace of mind you can continuously monitor your plugin using a dedicated GitHub action. It automatically runs Plugin Check against your plugin for every commit or PR, and posts all results as annotations on your source files so you know exactly where to look for resolving any errors or warnings.

Plugin Check is not a replacement for the manual review process, but it will help you speed up the process of getting your plugin approved for the WordPress.org plugin repository, and it will also help you avoid some common mistakes. Even if you do not intend to host your plugin in the WordPress.org directory, you are encouraged to use it so that your plugin follows the base requirements and best practices for WordPress plugins. Keep in mind that automated tools like this aren’t perfect, so there may occasionally be false positives.

All development for this plugin is handled via GitHub, and any bug reports or feature requests should be reported there. The GitHubGitHub GitHub is a website that offers online implementation of git repositories that can easily be shared, copied and modified by other developers. Public repositories are free to host, private repositories require a paid subscription. GitHub introduced the concept of the ‘pull request’ where code changes done in branches by contributors can be reviewed and discussed before being merged be the repository owner. https://github.com/ Action is maintained in its own repository.

Download the Plugin Check plugin or install the Plugin Check GitHub Action today to get started.

Written and reviewed by swissspidy, flixos90, davidperez