-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
68 lines (58 loc) · 2.58 KB
/
Copy pathphpcs.xml.dist
File metadata and controls
68 lines (58 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?xml version="1.0"?>
<ruleset name="FancyBox for WordPress">
<description>
Correctness rules for FancyBox for WordPress: escaping, sanitisation, nonces,
i18n and PHP cross-version compatibility.
Deliberately NOT the full WordPress standard. A first run of `WordPress`
against this codebase reports 293 violations, every one of them whitespace,
array alignment or a missing docblock - and zero security, i18n or
compatibility problems. Reflowing ~250 lines across a plugin with 30k active
installs buys nothing and makes every future diff harder to review, so the
rules below are the ones kept enforceable and green.
To adopt full formatting later: `composer phpcbf -- --standard=WordPress`
in its own commit, then swap the rules here for `<rule ref="WordPress"/>`.
</description>
<file>.</file>
<!-- Vendored libraries, build output and tooling are not ours to restyle. -->
<exclude-pattern>*/assets/js/jquery.fancybox*.js</exclude-pattern>
<exclude-pattern>*/assets/js/purify*.js</exclude-pattern>
<exclude-pattern>*/languages/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/build/*</exclude-pattern>
<arg name="extensions" value="php"/>
<arg name="basepath" value="."/>
<arg name="colors"/>
<arg value="sp"/>
<arg name="parallel" value="8"/>
<config name="minimum_wp_version" value="5.6"/>
<config name="testVersion" value="7.4-"/>
<!--
The sniffs that catch real defects. Every one of these fired on 3.3.7 and was
fixed in 3.4.0: unescaped output, unsanitised input, missing nonce checks,
a deprecated load_plugin_textdomain() argument and a text domain that did not
match the slug.
-->
<rule ref="WordPress.Security"/>
<rule ref="WordPress.DB"/>
<rule ref="WordPress.WP.DeprecatedFunctions"/>
<rule ref="WordPress.WP.DeprecatedParameters"/>
<rule ref="WordPress.WP.DeprecatedParameterValues"/>
<rule ref="WordPress.WP.EnqueuedResourceParameters"/>
<rule ref="WordPress.WP.GlobalVariablesOverride"/>
<rule ref="WordPress.PHP.NoSilencedErrors"/>
<rule ref="WordPress.PHP.DevelopmentFunctions"/>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="fancybox-for-wordpress"/>
</property>
</properties>
</rule>
<!-- Would have caught the PHP 8 breakage before it reached users. -->
<rule ref="PHPCompatibilityWP"/>
<!-- Cheap correctness sniffs with no reformatting cost. -->
<rule ref="Generic.PHP.DeprecatedFunctions"/>
<rule ref="Generic.PHP.ForbiddenFunctions"/>
<rule ref="Squiz.PHP.NonExecutableCode"/>
</ruleset>