Title: Test the new WPThemeReview standards
Author: Denis Žoljom
Published: January 30, 2019

---

 [  ](https://profiles.wordpress.org/dingo_d/) [Denis Žoljom](https://profiles.wordpress.org/dingo_d/)
7:49 am _on_ January 30, 2019     
Tags: coding standards, [WPThemeReview ( 2 )](https://make.wordpress.org/themes/tags/wpthemereview/)

# Test the new WPThemeReview standards

[WPThemeReview](https://github.com/WPTRT/WPThemeReview) is the official Theme Review
Team coding standard used for checking the themes using [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer/)(
PHPCSPHP Code Sniffer [PHP Code Sniffer,](https://github.com/squizlabs/PHP_CodeSniffer)
a popular tool for analyzing code quality. The [WordPress Coding Standards](https://github.com/WordPress/WordPress-Coding-Standards/)
rely on PHPCS.).

The aim of the WPThemeReview project is to automate the code analysis part of the
[Theme Review Process](https://make.wordpress.org/themes/handbook/review/) as much
as possible using static code analysisStatic code analysis "...the analysis of computer
software that is performed without actually executing programs, in contrast with
dynamic analysis, which is analysis performed on programs while they are executing."-
[Wikipedia](https://en.wikipedia.org/wiki/Static_program_analysis).

### Release of WordPress Coding StandardsWordPress Coding Standards The Accessibility, PHP, JavaScript, CSS, HTML, etc. coding standards as published in the WordPress 󠀁[Coding Standards Handbook](https://developer.wordpress.org/coding-standards/)󠁿. May also refer to 󠀁[The collection of PHP_CodeSniffer rules](https://github.com/WordPress/WordPress-Coding-Standards/)󠁿 (sniffs) used to format and validate PHP code developed for WordPress according to the PHP coding standards. 2.0.0

Version 2.0.0 of [WordPress Coding Standards](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/releases/tag/2.0.0)(
WPCSWordPress Community Support A public benefit corporation and a subsidiary of
the WordPress Foundation, [established](https://wordpressfoundation.org/news/2016/introducing-wordpress-community-support-a-public-benefit-subsidiary/)
in 2016.) was released two weeks ago, and it brought some changes to the WPCS ruleset.
Juliette Reinders Folmer made a pull request with the changes needed for WPThemeReview
to work with WPCS 2.0.0.

We need your help in testing these changes before releasing an update.

To set the WPThemeReview in your theme you’ll need [Composer](https://getcomposer.org/).

The following instructions are based on Mac, but you have detailed instructions 
in the [contributing document](https://github.com/WPTRT/WPThemeReview/blob/develop/.github/CONTRIBUTING.md).

Go to your theme folder and from the terminal run

    ```wp-block-preformatted
    composer require wptrt/wpthemereview:dev-develop dealerdirect/phpcodesniffer-composer-installer:^0.4.4
    ```

This will install the develop branch of the WPThemeReview standards as well as composer
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/](https://wordpress.org/plugins/)
or can be cost-based plugin from a third-party. that will register all the standards
with PHPCS. After that you can run

    ```wp-block-preformatted
    vendor/bin/phpcs -i
    ```

You should see

    ```wp-block-preformatted
    The installed coding standards are PEAR, Zend, PSR2, MySource, Squiz, PSR1, PSR12, PHPCompatibility, PHPCompatibilityParagonieRandomCompat, PHPCompatibilityParagonieSodiumCompat, PHPCompatibilityWP, WordPress, WordPress-Extra, WordPress-Docs, WordPress-Core and WPThemeReview
    ```

Then just run

    ```wp-block-preformatted
    vendor/bin/phpcs -p . --standard=WPThemeReview
    ```

You should see something like this

    ```wp-block-code
    WW...W.W.....W......WWW.WW.W.WW.WW.....WEEEEEEEEEEEEEEWEEEEE   60 / 1197 (5%)
    EEWEEEWEEEEEEEEEWEWEEEEEEEEEEEEEEEEEEEEEEEE.EEEEEEEEEEEEEEEE  120 / 1197 (10%)
    E.E..EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE  180 / 1197 (15%)
    EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE  240 / 1197 (20%)
    EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEES  300 / 1197 (25%)
    EESSEESEESSSEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE  360 / 1197 (30%)
    EEEEEEEEEEEEEEEEEEEEEWEEEE.EEEEEEE.EEEEEEEEEEEEEE.EEEEEEEEEE  420 / 1197 (35%)
    EEEEEEEEEWEWWWEEEEWEEEE.EEEEEEEEEEEEEEEEEEEEEEEEEEEE.......W  480 / 1197 (40%)
    W..WEWE.EEEEEEEEEEEEEEEEEEEE.E.EEWE..EWEEWEEEEW.EEWEWEEEEEEE  540 / 1197 (45%)
    EEEEEEEEEEEEEEWEE.EWEE.EEEEE..EEEEEEEEEEEWEEEEEE.WEWEEEEE.E.  600 / 1197 (50%)
    WWEEEEEEEEEE.E.EEEEEEEEE.E..EEEE..EE.E.EEE.EE.E.EEE..E.EEEEE  660 / 1197 (55%)
    EEEEEEEEEE.EEEEEEE.W.EEEEEE..E.E..EEE.EEEEEWEE.EW..EWEEWWEEE  720 / 1197 (60%)
    E.E..EEW..EEEEEEEEEEEEEEEEEE.EE.E.EEEEEEEEEEEEEEEEEEEEEEEEEE  780 / 1197 (65%)
    EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE.WEWE.EEEE  840 / 1197 (70%)
    EE..EE.E.EE..EE...EE...E..EEE..EE.EEE.EEEEEEEE.EEE.EE.EEEEEE  900 / 1197 (75%)
    EEEEEE.EEEEEEEEEEEEEEEEEWEWE..EEEE.EEEEEEE...EEE..EE.EEEEEEE  960 / 1197 (80%)
    EEEWEEEEEEE.EEEE.EEWEE.EEEEEEWWWEEEEEEEEEEE.EEEEE.EEEEEEEEEE 1020 / 1197 (85%)
    EEEEEEEE.EEEE.E..E.EEWEE.EE.EEEE.EEEEEEEE..EEEEEEEEEEEEEEEEE 1080 / 1197 (90%)
    EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 1140 / 1197 (95%)
    EEEEEEEEEEEEEEEEEEEEEEE.EE.....E.E.WEE.EEEEEEEEEEEE.EEEEE    1197 / 1197 (100%)



    FILE: public_html/wp-content/themes/twentynineteen/functions.php
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     273 | WARNING | All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$primary_color'.
     274 | WARNING | All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found
         |         | 'twentynineteen_custom_colors_css'.
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    ...
    ```

If you find any errors or problems with setup feel free to report the issue on the
[Github](https://github.com/WPTRT/WPThemeReview/issues) or here in the comments.

[#coding-standards](https://make.wordpress.org/themes/tags/coding-standards/), [#wpthemereview](https://make.wordpress.org/themes/tags/wpthemereview/)

### Share this:

 * [  Threads ](https://make.wordpress.org/themes/2019/01/30/test-the-new-wpthemereview-standards/?share=threads)
 * [  Mastodon ](https://make.wordpress.org/themes/2019/01/30/test-the-new-wpthemereview-standards/?share=mastodon)
 * [  Bluesky ](https://make.wordpress.org/themes/2019/01/30/test-the-new-wpthemereview-standards/?share=bluesky)
 * [  Facebook ](https://make.wordpress.org/themes/2019/01/30/test-the-new-wpthemereview-standards/?share=facebook)
 * [  X ](https://make.wordpress.org/themes/2019/01/30/test-the-new-wpthemereview-standards/?share=x)
 * [  LinkedIn ](https://make.wordpress.org/themes/2019/01/30/test-the-new-wpthemereview-standards/?share=linkedin)

 * [Login to Reply](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fmake.wordpress.org%2Fthemes%2F2019%2F01%2F30%2Ftest-the-new-wpthemereview-standards%2F%23respond&locale=en_US)

### Leave a Reply 󠀁[Cancel reply](https://make.wordpress.org/themes/2019/01/30/test-the-new-wpthemereview-standards/?output_format=md#respond)󠁿

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fmake.wordpress.org%2Fthemes%2F2019%2F01%2F30%2Ftest-the-new-wpthemereview-standards%2F&locale=en_US)
to post a comment.

This site uses Akismet to reduce spam. [Learn how your comment data is processed.](https://akismet.com/privacy/)

# Post navigation

[← Development help with Theme Sniffer](https://make.wordpress.org/themes/2019/01/14/development-help-with-theme-sniffer/)

[Theme Review Team Meeting Agenda for 26 February 2019 →](https://make.wordpress.org/themes/2019/02/26/theme-review-team-meeting-agenda-for-26-february-2019/)