Skip to content

Latest commit

 

History

History
46 lines (31 loc) · 1.07 KB

README.md

File metadata and controls

46 lines (31 loc) · 1.07 KB

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