Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Commit f20abbb

Browse files
authored
Update README.md (#3)
Added more detailed instructions and linked to additional documentation. Mega props @cdils ! Fixes #2
1 parent fe7b887 commit f20abbb

File tree

1 file changed

+37
-7
lines changed

1 file changed

+37
-7
lines changed

README.md

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,41 @@
22

33
WP Engine Coding Standards for WordPress
44

5+
If [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/) offer a baseline for developers to use when contributing to or extending WordPress, think of WP Engine Coding Standards as an additional layer of best practices that:
6+
7+
- help developers achieve greater consistency within their themes and plugins
8+
- assist developers in meeting the requirements of a WP Engine Solution Partner
9+
- ensure that all software listed in the WP Engine Solution Center is of the highest quality
10+
- offer users maximum performance and security benefits when using those themes and plugins in a modern hosting environment (PHP 7+)
11+
12+
The information included here walks you through the process of installing and using WP Engine Coding Standards to lint your code.
13+
514
## Requirements
615

16+
WP Engine Coding Standards (WPECS) uses [Composer](https://getcomposer.org/) to install these main dependencies:
17+
18+
* [PHP_Codesniffer (PHPCS)](https://github.com/squizlabs/PHP_CodeSniffer)
19+
* [WordPress Coding Standards](https://github.com/WordPress/WordPress-Coding-Standards)
20+
* [PHPCompatibilityWP](https://github.com/PHPCompatibility/PHPCompatibilityWP).
21+
22+
If you're using Homebrew on Mac, you can install Composer with: `brew install composer`. Otherwise, follow the official installation instructions for Composer.
23+
724
## Installation
825

9-
You can install WPECS globally with the following command:
26+
Clone or download this repository. From terminal, navigate to the download location and install WPECS globally with the following command:
1027

1128
make install
1229

13-
You will then be able to run WPECS from the any directory:
30+
You will then be able to run WPECS from any directory.
31+
32+
Running `make install` will install WPECS dependencies and register coding standards with PHPCS.
33+
34+
## Usage
1435

1536
USAGE: wpecs [--strict] [phpcs-options] <path>
1637
<wpecs> Run the specified path against the WP Engine Coding Standards
1738
<wpecbf> Attempt to fix sniffs against the WP Engine Strict Coding Standards
1839

19-
Try using 'wpecbf' to fix the sniff violations automatically.
20-
21-
## Usage
22-
2340
**WP-Engine Coding Standard**
2441

2542
_The required standard for secure WordPress development._
@@ -28,6 +45,19 @@ _The required standard for secure WordPress development._
2845

2946
**WP-Engine-Strict Coding Standard**
3047

31-
_The recommend standard for WP-Engine authored plugins._
48+
_The recommend standard for WP Engine authored plugins._
3249

3350
`wpecs --standard="WP-Engine-Strict" .`
51+
52+
Since WPECS is a collection of custom rulesets, you can still use regular [PHP_CodeSniffer commands](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage).
53+
54+
## Results
55+
56+
When you run WP Engine Coding Standards against your PHP file(s) or against a project directory, it will generate two reports:
57+
58+
* Summary report of PHP Code Sniffer violations (`report-summary.txt`)
59+
* Verbose report of PHP Code Sniffer violations (`report-full.txt`)
60+
61+
The summary provides an overview of how many total sniff violations were detected, while the detailed review highlights specific lines of code (by file) where errors or warnings were detected and what the issues are.
62+
63+
For help understanding errors or warnings and suggestions for troubleshooting specific issues, please refer to the full [WP Engine Coding Standards Documentation](https://github.com/wpengine/wpengine-coding-standards/wiki).

0 commit comments

Comments
 (0)