Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Leveraging the WordPress Coding Standards to review plugins and themes

Leveraging the WordPress Coding Standards to review plugins and themes

Presented on November 25, 2017 at Wordcamp Utrecht, Utrecht, The Netherlands.
https://2017.utrecht.wordcamp.org/
---------------------------------------------------------------
In contrast to most coding standards, the WordPress Coding Standards are about so much more than just (code) style. It is about best practices, modern code, preventing conflicts with other themes and plugins and can even help safeguard you against some common security vulnerabilities.

No matter whether you are a developer or you can’t tell divs from eval’s, the WordPress Coding Standards can help you. Let me tell you how…

------------------------------------
Links mentioned in the slides:

Slide 4:
* https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards

Slide 12:
* https://github.com/jrfnl/QA-WP-Projects

Slide 13:
* http://php.net/download
* https://getcomposer.org/download/
* https://github.com/jrfnl/QA-WP-Projects

Slide 35:
* https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1157

Juliette Reinders Folmer

November 25, 2017
Tweet

More Decks by Juliette Reinders Folmer

Other Decks in Programming

Transcript

  1. Basic Checks  Uses GitHub ?   Uses PHPCS

    and/or other QA tools ?   Has (Unit) Tests ? 
  2. PHP • http://php.net/download Composer • https://getcomposer.org/download/ QA-WP- Projects • https://github.com/jrfnl/QA-WP-Projects

    • Either download the latest release as a zip or clone using git • Run: composer install
  3. Before Running the QA Test  Download a copy of

    the plugin/theme  Check the PHP version of the deployment environment  Check Readme.txt for minimum supported WP version  Check main plugin/theme file for the text-domain Header: Text Domain: my-plugin  "Guess" the plugin/theme prefixes
  4. Running the checks vendor/bin> phpcs ./path/to/plugin-root/ --standard=WP-QA-Basic --report-full --report-source --report-summary

    --basepath=./path/to/plugin-root/ --runtime-set testVersion 5.6- --runtime-set minimum_supported_wp_version 4.5 --ignore=./path/to/plugin-root/tests/ --runtime-set text_domain plugin-slug --runtime-set prefixes plugin_prefix,plugin_acronym WP-QA-Strict