WordPress Coding standards

As defined in the official documentation:

The purpose of the WordPress Coding Standards is to create a baseline for collaboration and review within various aspects of the WordPress open source project and community, from core code to themes to plugins.

The WordPress community developed the standards contained in this section of the handbook, and those standards are part of the best practices that developers and core contributors are recommended to follow.

At Infinum, we developed our own set of coding standards. You can install them using Composer

composer require infinum/coding-standards-wp

If you want to run the checks

vendor/bin/phpcs --standard=Infinum .

You can customize the commands and the output with additional commands.

The Infinum coding standards for WordPress differ from the WordPress Coding Standards in few key ways. We are not using tabs, but spaces, and we are using 2 spaces instead of 4. Since we're using linters for scss and js we are only sniffing php files.