Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release version 1.0.0 #1392

Merged
merged 255 commits into from
Jul 25, 2018
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
255 commits
Select commit Hold shift + click to select a range
59ff199
DirectDatabaseQuery: move sniff from VIP category to DB category
jrfnl Nov 22, 2017
4c98056
DirectDatabaseQuery: downgrade messages to warning
jrfnl Nov 22, 2017
0630778
SlowDBQuery: move sniff from VIP category to DB category
jrfnl Nov 23, 2017
002d607
PreparedSQL: move sniff from WP category to DB category
jrfnl Nov 23, 2017
a6315f2
DontExtract: move sniff from VIP category to DB category
jrfnl Nov 23, 2017
0b531e2
NonceVerification: move sniff from CSRF category to Security category
jrfnl Nov 23, 2017
b04e8ef
EscapeOutput: move sniff from XSS category to Security category
jrfnl Nov 23, 2017
5f7d0b0
PluginMenuSlug: move sniff from VIP category to Security category
jrfnl Nov 23, 2017
4980804
PluginMenuSlug: downgrade message to warning
jrfnl Nov 23, 2017
cad14c8
ValidatedSanitizedInput: move sniff from VIP category to Security cat…
jrfnl Nov 23, 2017
52faccb
CronInterval: move sniff from VIP category to WP category
jrfnl Nov 23, 2017
77e9086
CronInterval: downgrade message to warning
jrfnl Nov 23, 2017
52ee644
TimezoneChange: move sniff from VIP category to WP category
jrfnl Nov 23, 2017
52ff31f
Merge pull request #1241 from WordPress-Coding-Standards/feature/cs-e…
JDGrimes Nov 26, 2017
04d874f
WP/Deprecated functions: add WP function deprecated in WP 4.9
jrfnl Nov 27, 2017
abbb75e
Merge pull request #1237 from WordPress-Coding-Standards/feature/upda…
JDGrimes Nov 27, 2017
2e4e70a
Revert "Fix build failure"
jrfnl Nov 28, 2017
0067724
GlobalVariables: move sniff from Variables category to WP category an…
jrfnl Nov 28, 2017
1f02646
Merge pull request #1245 from WordPress-Coding-Standards/feature/reve…
JDGrimes Nov 28, 2017
2241bc9
Update README.md
ramonamorea Dec 7, 2017
2613aa1
Merge pull request #1256 from ramonamorea/patch-1
jrfnl Dec 11, 2017
4de1cd6
Merge pull request #1242 from WordPress-Coding-Standards/feature/1157…
JDGrimes Dec 13, 2017
7d33b71
PostsPerPage: split sniff
jrfnl Nov 23, 2017
2e96234
Merge pull request #1260 from WordPress-Coding-Standards/feature/1157…
JDGrimes Dec 14, 2017
e34a591
Add a couple of extra sniffs to `Extra`
jrfnl Nov 23, 2017
cc7d15d
Merge pull request #1261 from WordPress-Coding-Standards/feature/1157…
JDGrimes Dec 15, 2017
7e5401c
Rulesets: lower severity instead of excluding checks
jrfnl Nov 23, 2017
ed05803
Fix two "typo"'s in deprecation messages
jrfnl Dec 20, 2017
cda66cb
Merge pull request #1263 from WordPress-Coding-Standards/feature/fix-…
GaryJones Dec 20, 2017
8036d8a
New sniff to encourage safe redirects
JDGrimes Dec 21, 2017
e7ae802
Use Security.SafeRedirect in VIP ruleset and remove check from VIP.Re…
JDGrimes Dec 21, 2017
fbc5384
Merge pull request #1264 from WordPress-Coding-Standards/feature/secu…
GaryJones Dec 22, 2017
c2e7f61
WP.I18n: Fix false positive on method calls.
jrfnl Dec 26, 2017
f0a5cff
WP.I18n: Move specific function checks down
jrfnl Dec 26, 2017
5637c1a
Readme: move IDE setup instructions to the wiki
jrfnl Dec 26, 2017
735b899
Merge pull request #1267 from WordPress-Coding-Standards/feature/1266…
GaryJones Dec 27, 2017
8053463
Merge pull request #1262 from WordPress-Coding-Standards/feature/1157…
GaryJones Dec 27, 2017
f609677
AssignmentInCondition: fix bug where nested parentheses were presumed…
jrfnl Dec 28, 2017
8bd8459
Merge pull request #1268 from WordPress-Coding-Standards/feature/move…
GaryJones Dec 28, 2017
242604b
Merge pull request #1249 from WordPress-Coding-Standards/feature/issu…
JDGrimes Dec 28, 2017
ac2abfa
AlternativeFunctions: detect `strip_tags()` and advise using `wp_stri…
jrfnl Dec 30, 2017
b605c77
Merge pull request #1271 from WordPress-Coding-Standards/feature/alte…
JDGrimes Dec 30, 2017
b684ba3
PrecisionAlignment: add additional unit tests exposing some bugs
jrfnl Jan 3, 2018
b1de4a3
PrecisionAlignment: fix bug - examine *all* lines
jrfnl Jan 3, 2018
ae7b19d
PrecisionAlignment: fix bug - trigger on echo open tag
jrfnl Jan 3, 2018
933b973
PrecisionAlignment: fix bug - examine inline HTML at end of of file
jrfnl Jan 3, 2018
63f63b2
FileName: examine views using only short echo open tags
jrfnl Jan 3, 2018
70175d2
EmptyStatementSniff: handle empty statements using short echo open tag
jrfnl Jan 3, 2018
1c11ca7
Merge pull request #1273 from WordPress-Coding-Standards/feature/bug-…
JDGrimes Jan 3, 2018
ec646f5
Merge pull request #1274 from WordPress-Coding-Standards/feature/impr…
JDGrimes Jan 3, 2018
8300925
PrefixAllGlobals: bug fix - don't trigger on closure parameter defini…
jrfnl Jan 4, 2018
ea3808f
PrefixAllGlobals: minor fix to the test case files
jrfnl Jan 4, 2018
dd3edd6
Merge pull request #1276 from WordPress-Coding-Standards/feature/1275…
JDGrimes Jan 4, 2018
df05758
PrefixAllGlobals: make the prefix comparison more code style independent
jrfnl Jan 4, 2018
6ce4927
PrefixAllGlobals: do not add invalid prefixes to the validated list
jrfnl Jan 4, 2018
a451119
AlternativeFunctions: add warning about using PHP native rand genera…
jrfnl Jan 4, 2018
4290baf
Merge pull request #1277 from WordPress-Coding-Standards/feature/1248…
GaryJones Jan 4, 2018
18e6653
Merge pull request #1278 from WordPress-Coding-Standards/feature/1239…
GaryJones Jan 4, 2018
30878ec
PrefixAllGlobals: add additional unit test cases for assignments in c…
jrfnl Jan 4, 2018
b032f7f
PrefixAllGlobals: recognize variable assignments in foreach conditions
jrfnl Jan 4, 2018
961369c
PrefixAllGlobals: minor textual correction for fall-back message text
jrfnl Jan 4, 2018
ca58869
Merge pull request #1279 from WordPress-Coding-Standards/feature/1236…
GaryJones Jan 4, 2018
1844042
Fix version numbers in docblock tags
jrfnl Jan 6, 2018
f220f96
I18n: minor fix to the unit test file
jrfnl Jan 6, 2018
75a34ad
Merge pull request #1281 from WordPress-Coding-Standards/feature/fix-…
GaryJones Jan 6, 2018
cdd69a5
Merge pull request #1282 from WordPress-Coding-Standards/feature/i18n…
GaryJones Jan 6, 2018
a8221c6
AlternativeFunctions: only advise alternative if min WP version suppo…
jrfnl Jan 10, 2018
0db1f50
Merge pull request #1285 from WordPress-Coding-Standards/feature/alte…
JDGrimes Jan 11, 2018
9a6ec34
Travis: speed up build times by disabling Xdebug
jrfnl Jan 12, 2018
8f5ce0c
WordPress-VIP: Ensure we use WordPress.com not WordPress. (#1284)
philipjohn Jan 12, 2018
392787e
Merge pull request #1286 from WordPress-Coding-Standards/feature/spee…
JDGrimes Jan 12, 2018
1fba9ed
Travis/Build: validate the composer.json file
jrfnl Jan 14, 2018
45857b2
Merge pull request #1287 from WordPress-Coding-Standards/feature/trav…
GaryJones Jan 14, 2018
e25322c
Travis: More stable solution for removing Xdebug when not needed
jrfnl Jan 20, 2018
f6ba702
Merge pull request #1289 from WordPress-Coding-Standards/feature/trav…
GaryJones Jan 20, 2018
bce2b6a
DeprecatedParameters: fix expected value for `wp_upload_bits()`
jrfnl Feb 3, 2018
145ae24
Sniff: add new `is_use_of_global_constant()` utility method
jrfnl Feb 3, 2018
5e68c58
EscapeOutput: allow for a limited set of safe PHP native constants
jrfnl Feb 3, 2018
2b29c95
Merge pull request #1294 from WordPress-Coding-Standards/feature/bugf…
JDGrimes Feb 3, 2018
1f1addb
Merge pull request #1293 from WordPress-Coding-Standards/feature/1200…
GaryJones Feb 3, 2018
b6fe1c6
Improve recognition of test classes
jrfnl Feb 3, 2018
c62f643
Merge pull request #1295 from WordPress-Coding-Standards/feature/fix-…
GaryJones Feb 4, 2018
cade769
ValidFunctionName: don't hide one error behind another
jrfnl Feb 8, 2018
8b8bcb6
Merge pull request #1298 from WordPress-Coding-Standards/feature/vali…
JDGrimes Feb 9, 2018
b182f38
PrefixAllGlobals: only recognize PHP native classes, don't try and au…
jrfnl Feb 13, 2018
10ab802
Merge pull request #1300 from WordPress-Coding-Standards/feature/bugf…
JDGrimes Feb 13, 2018
a38deb4
PHP.StrictInArray: don't throw an error for no parameters found
jrfnl Feb 26, 2018
c0e2913
Merge pull request #1308 from WordPress-Coding-Standards/feature/1306…
JDGrimes Feb 26, 2018
0297bda
PrefixAllGlobals: allow for defining non-prefixed core globals
jrfnl Mar 1, 2018
3dcae20
Build: move WPCS's own ruleset to the root directory
jrfnl Mar 1, 2018
04db118
Build/PHPCS: add the `<file>` directive
jrfnl Mar 1, 2018
7546c98
Build/PHPCS: run PHPCS against the highest stable PHP version
jrfnl Mar 1, 2018
760bbbb
Build/Travis: drop support for HHVM
jrfnl Mar 1, 2018
26a875b
AbstractFunctionRestrictions: prevent class declarations being confus…
jrfnl Mar 1, 2018
7bbaf49
WP.I18n: add additional unit test
jrfnl Mar 1, 2018
94dd1c2
WhiteSpace/ControlStructureSpacing: prevent fixer removing return typ…
jrfnl Mar 1, 2018
875bb2a
AbstractFunctionRestrictions: prevent use declaration aliases being c…
jrfnl Mar 1, 2018
57bab28
Merge pull request #1314 from WordPress-Coding-Standards/feature/1311…
JDGrimes Mar 1, 2018
9498a5b
Merge pull request #1317 from WordPress-Coding-Standards/feature/898-…
JDGrimes Mar 1, 2018
62a24fd
Merge pull request #1319 from WordPress-Coding-Standards/feature/1202…
JDGrimes Mar 1, 2018
6426385
Merge pull request #1318 from WordPress-Coding-Standards/feature/719-…
JDGrimes Mar 1, 2018
988b73f
Merge pull request #1316 from WordPress-Coding-Standards/feature/move…
GaryJones Mar 1, 2018
ca98f61
Fixed invalid config path key.
emgk Mar 11, 2018
e134f83
Merge pull request #1324 from emgk/patch-1
jrfnl Mar 11, 2018
cd578f2
ArrayIndentation: fix bug when dealing with multi-line string
jrfnl Mar 14, 2018
9491062
Merge pull request #1326 from WordPress-Coding-Standards/feature/arra…
GaryJones Mar 15, 2018
0f82002
Minor performance optimization
jrfnl Mar 21, 2018
0688361
Merge pull request #1329 from WordPress-Coding-Standards/feature/mino…
GaryJones Mar 22, 2018
606bfbb
EscapeOutput: report correctly on first param of `trigger_error()`
jrfnl Mar 30, 2018
232c469
EscapeOutput: correctly report on unsafe printing functions
jrfnl Mar 30, 2018
ac871c9
EscapeOutput: allow for short arrays
jrfnl Mar 30, 2018
06f6d5c
Merge pull request #1333 from WordPress-Coding-Standards/feature/fix-…
JDGrimes Mar 31, 2018
f1806e3
Don't mark `get_comment_date()` and `get_comment_time()` as safe for …
johnbillion May 7, 2018
dbf84ae
Don't mark `get_template_part()` as safe for output.
johnbillion May 7, 2018
2c75a94
Add `readonly()` to the list of auto escaped functions.
johnbillion May 7, 2018
8dc37e1
Remove `cancel_comment_reply_link()` from the list of auto escaped fu…
johnbillion May 7, 2018
3caf5ab
Merge pull request #1344 from johnbillion/1340-get-template-part
GaryJones May 7, 2018
875a92d
Merge pull request #1345 from johnbillion/1341-readonly
GaryJones May 7, 2018
f55e14c
Merge pull request #1347 from johnbillion/1346-comment-reply-link
GaryJones May 7, 2018
094acfa
Merge pull request #1343 from johnbillion/1339-get-comment
GaryJones May 7, 2018
bf57ad3
Remove several boolean functions from the list of auto escaped functi…
johnbillion May 7, 2018
d8c71e6
Remove `get_bookmark()` from the list of auto escaped functions.
johnbillion May 7, 2018
38a01d2
PrefixAllGlobals: Rename test file 2
jrfnl May 13, 2018
6f62b6c
PrefixAllGlobals: Rename test file 1
jrfnl May 13, 2018
9d0699b
PrefixAllGlobals: bugfix - namespaced testclasses where not ignored
jrfnl May 13, 2018
eeb052a
Merge pull request #1356 from WordPress-Coding-Standards/feature/pref…
JDGrimes May 13, 2018
a319971
Composer: add note about why the DealerDirect plugin is suggested
jrfnl May 16, 2018
119117d
Merge pull request #1357 from WordPress-Coding-Standards/feature/comp…
GaryJones May 16, 2018
4c90e2f
Deprecation messages: Simplify & improve code
jrfnl Apr 15, 2018
10e4f8f
Deprecation messages: fix messages being thrown when they shouldn't be
jrfnl May 19, 2018
a101f54
VIP ruleset: prevent deprecation messages being thrown when sniffs ar…
jrfnl Mar 13, 2018
296d3ce
Deprecated sniffs: Fix two previously missed typos in the test files
jrfnl May 19, 2018
8b7d23d
Fix minor whitespace issue in test file
jrfnl May 19, 2018
fddca72
Clean up: Remove `// end` comments
jrfnl May 24, 2018
e4bee82
Merge pull request #1362 from WordPress-Coding-Standards/feature/remo…
JDGrimes May 24, 2018
c7e0fc3
Merge pull request #1359 from WordPress-Coding-Standards/feature/fix-…
JDGrimes Jun 7, 2018
13541cf
AlternativeFunctions: improve handling of strip_tags() and parse_url()
jrfnl Jun 8, 2018
09a0da7
Fix PHP 7.3 compatibility
jrfnl Jun 9, 2018
e3b71ce
PreparedSQLPlaceholders: minor fix
jrfnl Jun 9, 2018
72e1108
Merge pull request #1369 from WordPress-Coding-Standards/feature/alte…
GaryJones Jun 9, 2018
a571f5e
Merge pull request #1373 from WordPress-Coding-Standards/feature/fix-…
JDGrimes Jun 9, 2018
0652c63
Merge pull request #1372 from WordPress-Coding-Standards/feature/fix-…
JDGrimes Jun 9, 2018
49e7700
AlternativeFunctions: improve handling of file_get_contents()
jrfnl Jun 8, 2018
1acd7c0
:sparkles: New "PregQuoteDelimiter" sniff
jrfnl Jun 9, 2018
16d6b1c
Merge pull request #1375 from WordPress-Coding-Standards/feature/1371…
JDGrimes Jun 9, 2018
3667c9c
I18n: fix bug when translatable content is numeric zero
jrfnl Jun 9, 2018
dfff059
Merge pull request #1376 from WordPress-Coding-Standards/feature/1355…
JDGrimes Jun 12, 2018
475d27f
Merge pull request #1353 from johnbillion/1352-get-bookmark
jrfnl Jun 14, 2018
976657d
PrefixAllGlobals: be more tolerant to non-conventional hook name sepa…
jrfnl Jun 19, 2018
cca93a6
Merge pull request #1381 from WordPress-Coding-Standards/feature/pref…
JDGrimes Jun 22, 2018
f8ab642
ArrayIndentation: fix fixer conflict with multi-line trailing comments
jrfnl Jun 25, 2018
3985ce9
Sniff::$printingFunctions / EscapeOutput: fix words being misidentifi…
jrfnl Jun 25, 2018
cfc54c5
Sniff::get_function_call_parameters(): correctly handle closures when…
jrfnl Jun 25, 2018
2b289dc
Minor documentation fixes
jrfnl Sep 23, 2017
a476cbf
Ruleset whitespace
jrfnl Oct 11, 2017
6844edd
Abstracts: change $exclude property from string to array
jrfnl Jun 25, 2018
8ecba48
Merge pull request #1391 from WordPress-Coding-Standards/feature/vari…
GaryJones Jun 26, 2018
f557fe5
Merge pull request #1387 from WordPress-Coding-Standards/feature/fix-…
JDGrimes Jun 26, 2018
4c3b36e
Merge pull request #1386 from WordPress-Coding-Standards/feature/1385…
JDGrimes Jun 26, 2018
27b7804
Merge pull request #1384 from WordPress-Coding-Standards/feature/phpc…
JDGrimes Jun 26, 2018
559b323
PrefixAllGlobals: improve handling of variable created by global fore…
jrfnl Jun 27, 2018
62d163a
GlobalVariablesOverride: detect WP variable overrides in foreach()
jrfnl Jun 28, 2018
ebde553
GlobalVariablesOverride: improve the usefulness of the error
jrfnl Jun 28, 2018
93f4846
I18n: hardening of the "no translatable content" check
jrfnl Jun 28, 2018
cdb3c5e
README: update output example
jrfnl Jun 27, 2018
43c795e
README: add link to more travis examples
jrfnl Jun 27, 2018
817c151
README: update/correct various links
jrfnl Jun 27, 2018
13579c5
CONTRIBUTING: Update supported PHPUnit versions
jrfnl Jun 27, 2018
a7c71b0
CONTRIBUTING: Update PHPUnit output example
jrfnl Jun 27, 2018
5a192a3
CONTRIBUTING: Fix minor grammatical error
jrfnl Jun 27, 2018
7eed80d
Example ruleset: update for WPCS 1.0.0 and PHPCompatibility best prac…
jrfnl Jun 27, 2018
ec162a4
Merge pull request #1398 from WordPress-Coding-Standards/feature/upda…
GaryJones Jun 28, 2018
39ed2f3
Merge pull request #1399 from WordPress-Coding-Standards/feature/upda…
GaryJones Jun 28, 2018
28be1de
README: add a few more badges
jrfnl Jun 28, 2018
0f4218c
Merge pull request #1400 from WordPress-Coding-Standards/feature/upda…
JDGrimes Jun 28, 2018
5ddc7de
Merge pull request #1397 from WordPress-Coding-Standards/feature/i18n…
JDGrimes Jun 28, 2018
cc67472
Merge pull request #1396 from WordPress-Coding-Standards/feature/glob…
JDGrimes Jun 28, 2018
a2c0a57
Merge pull request #1394 from WordPress-Coding-Standards/feature/1236…
JDGrimes Jun 28, 2018
13d2d82
Merge pull request #1390 from WordPress-Coding-Standards/feature/1368…
GaryJones Jun 29, 2018
df4dd57
README: hide the badges from screen readers
jrfnl Jun 29, 2018
23400e9
Merge pull request #1401 from WordPress-Coding-Standards/feature/read…
JDGrimes Jun 30, 2018
fd72992
CronInterval: make the sniff more code style independent
jrfnl Jun 30, 2018
297acb8
PreparedSQL: make the sniff more code style independent
jrfnl Jul 1, 2018
261b8a7
Merge pull request #1405 from WordPress-Coding-Standards/feature/prep…
GaryJones Jul 2, 2018
6a34196
Merge pull request #1404 from WordPress-Coding-Standards/feature/cron…
GaryJones Jul 2, 2018
5545a81
ValidVariableName: make the sniff more code style independent
jrfnl Jun 30, 2018
b78060b
Merge pull request #1406 from WordPress-Coding-Standards/feature/vali…
jrfnl Jul 2, 2018
664ce9f
Sniff: Add $phpcsCommentTokens array for PHPCS cross-version compatib…
jrfnl Jan 3, 2018
0af3846
Sniff: support combining PHPCS annotations with WPCS whitelist comments
jrfnl Jan 6, 2018
265d810
I18n: add unit test to confirm that PHPCS annotations are handled cor…
jrfnl Jan 6, 2018
6e6dc9c
ArrayDeclarationSpacing: bug fix - allow for PHPCS annotation tokens
jrfnl Jan 3, 2018
bd120c1
CommaAfterArrayItem: bug fix - allow for PHPCS annotation tokens
jrfnl Jan 7, 2018
a581334
ControlStructureSpacing: bug fix - allow for PHPCS annotation tokens
jrfnl Jan 9, 2018
9703965
Various minor fixes
jrfnl Jul 2, 2018
dfa4bd2
PrecisionAlignment: add unit tests to verify that the PHPCS annotatio…
jrfnl Feb 27, 2018
1ce42a6
PrecisionAlignment: examine PHPCS annotations
jrfnl Jan 6, 2018
24efb81
FileName: allow for the new PHPCS annotations
jrfnl Feb 27, 2018
71fc23f
Merge pull request #1374 from WordPress-Coding-Standards/feature/943-…
JDGrimes Jul 2, 2018
627b732
Merge pull request #1408 from WordPress-Coding-Standards/feature/scru…
JDGrimes Jul 2, 2018
91a5cdd
Merge pull request #1407 from WordPress-Coding-Standards/feature/1218…
JDGrimes Jul 2, 2018
a43c80c
Performance: use FQN for global constants
jrfnl Jul 4, 2018
c9a4b04
Travis: add builds to test against minimum supported PHPCS 3.x version
jrfnl Jul 4, 2018
6c7058c
Merge pull request #1412 from WordPress-Coding-Standards/feature/trav…
JDGrimes Jul 5, 2018
7beb279
Merge pull request #1411 from WordPress-Coding-Standards/feature/use-…
GaryJones Jul 5, 2018
083a7ce
AbstractVariableRestrictions: remove superfluous token constant
jrfnl Jul 4, 2018
694c459
Performance: use FQN for functions which can use PHP7 compile time op…
jrfnl Jul 4, 2018
f672e18
Travis/PHPCS: check WPCS own code for PHP cross-version compatibility
jrfnl Jul 5, 2018
81a265a
Merge pull request #1414 from WordPress-Coding-Standards/feature/use-…
GaryJones Jul 6, 2018
38a940e
Merge pull request #1415 from WordPress-Coding-Standards/feature/snif…
GaryJones Jul 6, 2018
ecaa437
Merge pull request #1413 from WordPress-Coding-Standards/feature/bugf…
GaryJones Jul 6, 2018
5585804
Deprecated the VIP FileSystemWritesDisallow Sniff and the Admin Bar …
tomjn Jul 6, 2018
4ae8691
deprecate the VIP Order By Rand sniff
tomjn Jul 6, 2018
ea7493b
Deprecated the VIP RestrictedFunctions Sniff
tomjn Jul 6, 2018
df07c46
deprecated the VIP sniff RestrictedVariables
tomjn Jul 6, 2018
907fd88
deprecates the VIP SessionFunctionsUsage sniff
tomjn Jul 6, 2018
d1272dd
Deprecated the VIP SessionVariableUsageSniff sniff
tomjn Jul 6, 2018
7106b30
Deprecated the VIP sniff SuperGlobalInputUsageSniff
tomjn Jul 6, 2018
42d1ef0
resolve PHPCBF formatting issues by adding commars and removing trail…
tomjn Jul 7, 2018
cafaf2a
update the VIP rulesets description to indicate that it's deprecated,…
tomjn Jul 7, 2018
95581c0
Fixes for the VIP Sniff deprecations based on Juliettes review
tomjn Jul 8, 2018
9faef43
Deprecated AbstractVariableRestrictionsSniff
tomjn Jul 9, 2018
a4db740
deprecated the has_html_open_tag method in Sniff class
tomjn Jul 9, 2018
4b50df5
Remove VIP from the standard WP ruleset
tomjn Jul 9, 2018
ad1c014
unit test fixes
tomjn Jul 9, 2018
9c1e44f
Fixes stray whitespace characters in the WP ruleset, and yoda conditi…
tomjn Jul 9, 2018
e3206b7
Apply spelling and grammar corrections to VIP deprecations
tomjn Jul 10, 2018
20494c4
merges the xml comment in the VIP ruleset into the description
tomjn Jul 10, 2018
ed1365f
Check for deprecated parameter values
grappler Jan 28, 2017
dfc2878
Merge pull request #1366 from grappler/feature/576-deprecated-paramet…
jrfnl Jul 12, 2018
b266502
Added EnqueuedCheck Sniff and Unit tests
Nov 22, 2017
135900b
Introduce method to check for falsy argument value
moorscode Jun 14, 2018
b77c62f
EnqueuedResourceParameters: stabilize the `is_falsy()` method
jrfnl Jul 12, 2018
702f56f
Merge pull request #1378 from moorscode/issue/1146
JDGrimes Jul 12, 2018
2b4cf3c
Fix false positive violation for return type colon
GaryJones Jul 12, 2018
c27ae76
Merge pull request #1421 from WordPress-Coding-Standards/feature/1420…
jrfnl Jul 13, 2018
50c3471
test the exclude parameter deprecation in the deprecated VIP sniff un…
tomjn Jul 13, 2018
50c6d77
Updated the VIP deprecation notice in the readme to read better
tomjn Jul 16, 2018
58b4c23
Merge pull request #1410 from tomjn/vip-migrate-filesystem-write-disa…
jrfnl Jul 16, 2018
1de3a9d
Composer & Readme: update organisation name for PHPCompatibility
jrfnl Jul 18, 2018
46d48ee
Merge pull request #1426 from WordPress-Coding-Standards/feature/comp…
JDGrimes Jul 18, 2018
3353085
Merge pull request #1351 from johnbillion/1350-bools
GaryJones Jul 23, 2018
3cf034e
Contributing: discourage adding new whitelist comments
jrfnl Jul 23, 2018
dfc6d09
Merge pull request #1428 from WordPress-Coding-Standards/feature/cont…
JDGrimes Jul 23, 2018
5f746bf
WordPress ruleset: fix deprecation notices coming through
jrfnl Jul 24, 2018
b6beac8
Merge pull request #1431 from WordPress-Coding-Standards/feature/fix-…
JDGrimes Jul 24, 2018
3d92e2f
Travis: add a new check for early detection of ruleset problems
jrfnl Jul 18, 2018
1a9d8f8
Merge pull request #1430 from WordPress-Coding-Standards/feature/trav…
jrfnl Jul 24, 2018
9edb9d6
Merge branch 'master' into feature/changelog-1.0.0
jrfnl Jul 12, 2018
077a3ea
Changelog for version 1.0.0
jrfnl Jun 27, 2018
3b24b0b
Merge pull request #1423 from WordPress-Coding-Standards/feature/chan…
jrfnl Jul 24, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# https://blog.madewithlove.be/post/gitattributes/
#
/.travis.yml export-ignore
/.phpcs.xml.dist export-ignore
/phpunit.xml.dist export-ignore
/.github export-ignore
/bin export-ignore
Expand Down
35 changes: 23 additions & 12 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Since WPCS employs many sniffs that are part of PHPCS, sometimes an issue will b

## Branches

Ongoing development will be done in the `develop` with merges done into `master` once considered stable.
Ongoing development will be done in the `develop` branch with merges done into `master` once considered stable.

To contribute an improvement to this project, fork the repo and open a pull request to the `develop` branch. Alternatively, if you have push access to this repo, create a feature branch prefixed by `feature/` and then open an intra-repo PR from that branch to `develop`.

Expand All @@ -32,14 +32,24 @@ When you introduce new `public` sniff properties, or your sniff extends a class

## Whitelist comments

> **Important**:
> PHPCS 3.2.0 introduced new selective ignore annotations, which can be considered an improved version of the whitelist mechanism which WPCS contains.
>
> There is a [tentative intention to drop support for the WPCS native whitelist comments](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1048#issuecomment-340698249) in WPCS 2.0.0.
>
> Considering that, the introduction of new whitelist comments is discouraged.
>
> The below information remains as guidance for exceptional cases and to aid in understanding the previous implementation.

Sometimes, a sniff will flag code which upon further inspection by a human turns out to be OK.

If the sniff you are writing is susceptible to this, please consider adding the ability to [whitelist lines of code](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Whitelisting-code-which-flags-errors).

To this end, the `WordPress\Sniff::has_whitelist_comment()` method was introduced.

Example usage:
```php
namespace WordPress\Sniffs\CSRF;
namespace WordPress\Sniffs\Security;

use WordPress\Sniff;

Expand All @@ -66,7 +76,7 @@ When you introduce a new whitelist comment, please don't forget to update the [w
## Pre-requisites
* WordPress-Coding-Standards
* PHP_CodeSniffer 2.9.x or 3.x
* PHPUnit 4.x, 5.x or 6.x
* PHPUnit 4.x, 5.x, 6.x or 7.x

The WordPress Coding Standards use the PHP_CodeSniffer native unit test suite for unit testing the sniffs.

Expand Down Expand Up @@ -103,7 +113,7 @@ The WordPress Coding Standards are compatible with both PHPCS 2.x as well as 3.x

* Make sure you have registered the directory in which you installed WPCS with PHPCS using;
```sh
phpcs --config-set installed_path path/to/WPCS
phpcs --config-set installed_paths path/to/WPCS
```
* Navigate to the directory in which you installed WPCS.
* To run the unit tests with PHPCS 3.x:
Expand All @@ -117,18 +127,19 @@ The WordPress Coding Standards are compatible with both PHPCS 2.x as well as 3.x

Expected output:
```
PHPUnit 4.8.19 by Sebastian Bergmann and contributors.
PHPUnit 6.5.8 by Sebastian Bergmann and contributors.

Runtime: PHP 7.1.3 with Xdebug 2.5.1
Configuration: /WordPressCS/phpunit.xml
Runtime: PHP 7.2.7 with Xdebug 2.6.0
Configuration: /WordPressCS/phpunit.xml

..........................................................
................................................................. 65 / 77 ( 84%)
............ 77 / 77 (100%)

Tests generated 556 unique error codes; 48 were fixable (8.63%)
Tests generated 576 unique error codes; 51 were fixable (8.85%)

Time: 24.08 seconds, Memory: 41.75Mb
Time: 22.93 seconds, Memory: 40.00MB

OK (58 tests, 0 assertions)
OK (77 tests, 0 assertions)
```

[![asciicast](https://asciinema.org/a/98078.png)](https://asciinema.org/a/98078)
Expand Down Expand Up @@ -207,4 +218,4 @@ The `--sniffs=...` directive limits the output to the sniff you are testing.

## Code Standards for this project

The sniffs and test files - not test _case_ files! - for WPCS should be written such that they pass the `WordPress-Extra` and the `WordPress-Docs` code standards using the custom ruleset as found in `/bin/phpcs.xml`.
The sniffs and test files - not test _case_ files! - for WPCS should be written such that they pass the `WordPress-Extra` and the `WordPress-Docs` code standards using the custom ruleset as found in `/.phpcs.xml.dist`.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
vendor
composer.lock
phpunit.xml
phpcs.xml
.phpcs.xml
54 changes: 54 additions & 0 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards">
<description>The Coding standard for the WordPress Coding Standards itself.</description>

<file>.</file>

<arg value="sp"/>
<arg name="extensions" value="php"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any benefit in adding colors (even if it only benefits non-Windows), or parallel etc.?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be fine with those additions, but those can be added any time. They don't necessarily need to be included in this release, especially as they would/should only be added to the WPCS native custom ruleset.


<!-- Exclude the code in the PHPCS 2.x test files copied in from PHPCS. -->
<exclude-pattern>/Test/AllTests.php</exclude-pattern>
<exclude-pattern>/Test/Standards/*.php</exclude-pattern>

<!-- Exclude Composer vendor directory. -->
<exclude-pattern>*/vendor/*</exclude-pattern>

<rule ref="WordPress-Extra">
<exclude name="WordPress.Files.FileName"/>
<exclude name="WordPress.NamingConventions.ValidVariableName"/>
<exclude name="WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition"/>
</rule>

<rule ref="WordPress-Docs"/>

<!-- Enforce PSR1 compatible namespaces. -->
<rule ref="PSR1.Classes.ClassDeclaration"/>

<rule ref="WordPress.Arrays.MultipleStatementAlignment">
<properties>
<property name="alignMultilineItems" value="!=100"/>
</properties>
</rule>

<rule ref="PSR2.Methods.FunctionClosingBrace"/>

<!-- Check code for cross-version PHP compatibility. -->
<config name="testVersion" value="5.3-"/>
<rule ref="PHPCompatibility">
<!-- Exclude PHP constants back-filled by PHPCS. -->
<exclude name="PHPCompatibility.PHP.NewConstants.t_finallyFound"/>
<exclude name="PHPCompatibility.PHP.NewConstants.t_yieldFound"/>
<exclude name="PHPCompatibility.PHP.NewConstants.t_ellipsisFound"/>
<exclude name="PHPCompatibility.PHP.NewConstants.t_powFound"/>
<exclude name="PHPCompatibility.PHP.NewConstants.t_pow_equalFound"/>
<exclude name="PHPCompatibility.PHP.NewConstants.t_spaceshipFound"/>
<exclude name="PHPCompatibility.PHP.NewConstants.t_coalesceFound"/>
<exclude name="PHPCompatibility.PHP.NewConstants.t_coalesce_equalFound"/>
<exclude name="PHPCompatibility.PHP.NewConstants.t_yield_fromFound"/>

<!-- Unclear how, but appears to be back-filled anyhow, could be that PHP did so before the token was in use. -->
<exclude name="PHPCompatibility.PHP.NewConstants.t_traitFound"/>
</rule>

</ruleset>
64 changes: 38 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,74 +19,83 @@ php:

env:
# `master` is now 3.x.
- PHPCS_BRANCH=master LINT=1
- PHPCS_BRANCH="dev-master" LINT=1
# Lowest supported release in the 3.x series with which WPCS is compatible (and which can run the unit tests).
- PHPCS_BRANCH="3.1.0"
# Lowest tagged release in the 2.x series with which WPCS is compatible.
- PHPCS_BRANCH=2.9.0
- PHPCS_BRANCH="2.9.0"

matrix:
fast_finish: true
include:
# Run PHPCS against WPCS. I just picked to run it against 7.0.
- php: 7.0
env: PHPCS_BRANCH=master SNIFF=1
# Run PHPCS against WPCS. I just picked to run it against 7.2.
- php: 7.2
env: PHPCS_BRANCH="dev-master" SNIFF=1
addons:
apt:
packages:
- libxml2-utils

# Run against HHVM.
- php: hhvm
sudo: required
dist: trusty
group: edge
env: PHPCS_BRANCH=master LINT=1

# Test PHP 5.3 only against PHPCS 2.x as PHPCS 3.x has a minimum requirement of PHP 5.4.
- php: 5.3
env: PHPCS_BRANCH=2.9 LINT=1
env: PHPCS_BRANCH="2.9.*" LINT=1
dist: precise
# Test PHP 5.3 with short_open_tags set to On (is Off by default)
- php: 5.3
env: PHPCS_BRANCH=2.9.0 SHORT_OPEN_TAGS=true
env: PHPCS_BRANCH="2.9.0" SHORT_OPEN_TAGS=true
dist: precise

allow_failures:
# Allow failures for unstable builds.
- php: nightly
- php: hhvm

before_install:
# Speed up build time by disabling Xdebug.
# https://johnblackbourn.com/reducing-travis-ci-build-times-for-wordpress-projects/
# https://twitter.com/kelunik/status/954242454676475904
- phpenv config-rm xdebug.ini || echo 'No xdebug config.'
- export XMLLINT_INDENT=" "
- export PHPCS_DIR=/tmp/phpcs
- export PHPUNIT_DIR=/tmp/phpunit
- export PHPCS_BIN=$(if [[ $PHPCS_BRANCH == master ]]; then echo $PHPCS_DIR/bin/phpcs; else echo $PHPCS_DIR/scripts/phpcs; fi)
- mkdir -p $PHPCS_DIR && git clone --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git -b $PHPCS_BRANCH $PHPCS_DIR
- $PHPCS_BIN --config-set installed_paths $(pwd)
# Download PHPUnit 5.x for builds on PHP 7, nightly and HHVM as the PHPCS
- |
if [[ ${PHPCS_BRANCH:0:2} == "2." ]]; then
# --prefer-source is needed to ensure that the PHPCS unit test suite is available in PHPCS 2.9.
composer require squizlabs/php_codesniffer:${PHPCS_BRANCH} --prefer-source --update-no-dev --no-suggest --no-scripts
else
composer require squizlabs/php_codesniffer:${PHPCS_BRANCH} --update-no-dev --no-suggest --no-scripts
fi
- |
if [[ "$SNIFF" == "1" ]]; then
composer install --dev --no-suggest
# The post-install-cmd script takes care of the installed_paths.
else
# The above require already does the install.
$(pwd)/vendor/bin/phpcs --config-set installed_paths $(pwd)
fi
# Download PHPUnit 5.x for builds on PHP 7 and nightly as the PHPCS
# test suite is currently not compatible with PHPUnit 6.x.
# Fixed at a very specific PHPUnit version which is also compatible with HHVM.
# Fixed at a very specific PHPUnit version.
- if [[ ${TRAVIS_PHP_VERSION:0:2} != "5." ]]; then wget -P $PHPUNIT_DIR https://phar.phpunit.de/phpunit-5.7.17.phar && chmod +x $PHPUNIT_DIR/phpunit-5.7.17.phar; fi
# Selectively adjust the ini values for the build image to test ini value dependent sniff features.
- if [[ "$SHORT_OPEN_TAGS" == "true" ]]; then echo "short_open_tag = On" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi

script:
# Lint the PHP files against parse errors.
- if [[ "$LINT" == "1" ]]; then if find . -name "*.php" -exec php -l {} \; | grep "^[Parse error|Fatal error]"; then exit 1; fi; fi
- if [[ "$LINT" == "1" ]]; then if find . -path ./vendor -prune -o -name "*.php" -exec php -l {} \; | grep "^[Parse error|Fatal error]"; then exit 1; fi; fi
# Run the unit tests.
- if [[ ${TRAVIS_PHP_VERSION:0:2} == "5." && ${PHPCS_BRANCH:0:2} == "2." ]]; then phpunit --filter WordPress $(pwd)/Test/AllTests.php; fi
- if [[ ${TRAVIS_PHP_VERSION:0:2} == "5." && ${PHPCS_BRANCH:0:2} != "2." ]]; then phpunit --filter WordPress $PHPCS_DIR/tests/AllTests.php; fi
- if [[ ${TRAVIS_PHP_VERSION:0:2} == "5." && ${PHPCS_BRANCH:0:2} != "2." ]]; then phpunit --filter WordPress $(pwd)/vendor/squizlabs/php_codesniffer/tests/AllTests.php; fi
- if [[ ${TRAVIS_PHP_VERSION:0:2} != "5." && ${PHPCS_BRANCH:0:2} == "2." ]]; then php $PHPUNIT_DIR/phpunit-5.7.17.phar --filter WordPress $(pwd)/Test/AllTests.php; fi
- if [[ ${TRAVIS_PHP_VERSION:0:2} != "5." && ${PHPCS_BRANCH:0:2} != "2." ]]; then php $PHPUNIT_DIR/phpunit-5.7.17.phar --filter WordPress $PHPCS_DIR/tests/AllTests.php; fi
- if [[ ${TRAVIS_PHP_VERSION:0:2} != "5." && ${PHPCS_BRANCH:0:2} != "2." ]]; then php $PHPUNIT_DIR/phpunit-5.7.17.phar --filter WordPress $(pwd)/vendor/squizlabs/php_codesniffer/tests/AllTests.php; fi
# Test for fixer conflicts by running the auto-fixers of the complete WPCS over the test case files.
# This is not an exhaustive test, but should give an early indication for typical fixer conflicts.
# For the first run, the exit code will be 1 (= all fixable errors fixed).
# `travis_retry` should then kick in to run the fixer again which should now return 0 (= no fixable errors found).
# All error codes for the PHPCBF: https://github.com/squizlabs/PHP_CodeSniffer/issues/1270#issuecomment-272768413
- if [[ "$SNIFF" == "1" ]]; then travis_retry $PHPCS_DIR/bin/phpcbf -p ./WordPress/Tests/ --standard=WordPress --extensions=inc --exclude=Generic.PHP.Syntax --report=summary; fi
- if [[ "$SNIFF" == "1" ]]; then travis_retry $(pwd)/vendor/bin/phpcbf -p ./WordPress/Tests/ --standard=WordPress --extensions=inc --exclude=Generic.PHP.Syntax --report=summary; fi
# WordPress Coding Standards.
# @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
# @link http://pear.php.net/package/PHP_CodeSniffer/
- if [[ "$SNIFF" == "1" ]]; then $PHPCS_BIN . --standard=./bin/phpcs.xml --runtime-set ignore_warnings_on_exit 1; fi
- if [[ "$SNIFF" == "1" ]]; then $(pwd)/vendor/bin/phpcs --runtime-set ignore_warnings_on_exit 1; fi
# Validate the xml files.
# @link http://xmlsoft.org/xmllint.html
- if [[ "$SNIFF" == "1" ]]; then xmllint --noout ./*/ruleset.xml; fi
Expand All @@ -98,3 +107,6 @@ script:
- if [[ "$SNIFF" == "1" ]]; then diff -B --tabsize=4 ./WordPress-Extra/ruleset.xml <(xmllint --format "./WordPress-Extra/ruleset.xml"); fi
- if [[ "$SNIFF" == "1" ]]; then diff -B --tabsize=4 ./WordPress-VIP/ruleset.xml <(xmllint --format "./WordPress-VIP/ruleset.xml"); fi
- if [[ "$SNIFF" == "1" ]]; then diff -B --tabsize=4 ./phpcs.xml.dist.sample <(xmllint --format "./phpcs.xml.dist.sample"); fi
# Validate the composer.json file.
# @link https://getcomposer.org/doc/03-cli.md#validate
- if [[ "$LINT" == "1" ]]; then composer validate --no-check-all --strict; fi
Loading