X-post: Strengths and Challenges: Follow Up

X-comment from +make.wordpress.org/updates: Comment on Strengths and Challenges: Follow Up

Test the new WPThemeReview standards

WPThemeReview is the official Theme Review Team coding standard used for checking the themes using PHP_CodeSniffer (PHPCS).

The aim of the WPThemeReview project is to automate the code analysis part of the Theme Review Process as much as possible using static code analysis.

Release of WordPress Coding Standards 2.0.0

Version 2.0.0 of WordPress Coding Standards (WPCS) 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.

The following instructions are based on Mac, but you have detailed instructions in the contributing document.

Go to your theme folder and from the terminal run

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 plugin that will register all the standards with PHPCS. After that you can run

vendor/bin/phpcs -i

You should see

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

vendor/bin/phpcs -p . --standard=WPThemeReview

You should see something like this


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 or here in the comments.

#coding-standards, #wpthemereview

X-post: Our Strengths and Challenges

X-comment from +make.wordpress.org/updates: Comment on Our Strengths and Challenges

Development help with Theme Sniffer

Theme Sniffer is a tool that helps reviewers and developers check the themes they are reviewing/developing against several coding standards.

The last stable version (0.1.5) is still using the old version of the WordPress Coding Standards, and a lot has changed since then. For close to a year now I’ve been working on upgrading the plugin a bit, and the new version is nearing completion.

The new version has updated codebase, updated coding standards (updated WPCS and added WPThemeReview standard as well), newer version of PHP_CodeSniffer which brings some performance updates and some other tweaks.
Even though the majority of the plugin is functional, it still has some issues.

This is where I need your help.

The new PHPCS has a different way of running the sniffer, using the Runner class and the Config class. For Theme Sniffer to perform the sniffing process it needs to write it’s own runner.

The issue I’m having is that some of the custom config settings are not working properly.
One way you can help is to see what could be the issue with this.

How to setup the development of the Theme Sniffer?

To start working on the development of the plugin you need to have a development environment. I’m using VVV, you can work on whatever works the best for you.

Steps to reproduce:

1. Go to your plugins folder and clone the repository

git clone git@github.com:WPTRT/theme-sniffer.git

2. Go to the directory

cd theme-sniffer

3. Checkout development branch

git checkout development

4. Go to theme-sniffer folder and run composer install, npm install and npm run build (in that order)

5. Activate your plugin and test away

Anything you find you can report in the opened pull request, or in the slack #themereview channel.

Thank you!

Pixabay Images are not allowed

As a reminder: The wordpress.org directory contains only themes which are considered 100% GPL or GPL compatible. This includes making sure both the code and all of the bundled assets are compatible.

A few days ago, Pixabay Updated their license.

In the Pixabay Licence they mentioned:

Do not redistribute images or videos on other stock photo or wallpaper platforms.

One of the things it means when you use the GPL licence is that your are sharing your theme with the explicit rights to redistribute copies. The clause in the Pixabay Licence prevents free distribution of the images and as such it is not in the spirit of the freedoms that the GPL grants.

Other Options for Images

It would be preferable if images bundled with themes are shared under the CC0 licence – however other GPL compatible licences may also be used.

We have a list of recommended website from where you can use images if you need help finding sites that offer images with GPL compatible licences.

You can always join themereview channel and ask your queries there.

Please leave a comment below if you have anything to say regarding this. If you have any idea about the CCO compatible license website, comment below. So that we can suggest them.