Skip to content

A custom phpcs ruleset for WordPress plugin development.

License

Notifications You must be signed in to change notification settings

lipsia/phpcs-wp-plugin-standard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lipsia Digital's WordPress plugin development standard

This is a superset of the NeutronStandard and PSR12 with some modifications.

Installation

composer require --dev squizlabs/php_codesniffer dealerdirect/phpcodesniffer-composer-installer
composer require --dev lipsia/phpcs-wp-plugin-standard

Usage

In your project's ruleset file, enable this ruleset by setting the <rule> tag.

Minimal phpcs.xml.dist:

<?xml version="1.0"?>
<ruleset>
    <rule ref="LDWordPressPlugin"/>
</ruleset>

Or without a file:

./vendor/bin/phpcs --standard=LDWordPressPlugin .

Opinions

This ruleset is opinionated and that is a good thing.

Rules that MUST NOT be changed

  • main plugin file is in ./plugin.php
  • all other plugin files are autoloaded from ./src/
  • composer dependencies are in ./vendor/
  • convert tabs to 4 spaces

Rules that CAN be changed

  • use colors in report
  • look into all files with extension php
  • check 8 files in parallel

About

A custom phpcs ruleset for WordPress plugin development.

Resources

License

Stars

Watchers

Forks

Packages

No packages published