forked from awesomemotive/all-in-one-seo-pack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml
135 lines (109 loc) · 5.31 KB
/
phpcs.xml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?xml version="1.0"?>
<ruleset name="AIOSEOP">
<!-- See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-Ruleset -->
<!-- See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Customisable-Sniff-Properties -->
<!-- See https://github.com/WordPress/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
<description>AIOSEOP rules for PHP_CodeSnifferr</description>
<!-- Pass some flags to PHPCS:
p flag: Show progress of the run.
s flag: Show sniff codes in all reports.
v flag: Print verbose output.
n flag: Do not print warnings.
-->
<arg value="psv"/>
<file>.</file>
<!-- Ignore directories -->
<exclude-pattern>node_modules/*</exclude-pattern>
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>lib/*</exclude-pattern>
<exclude-pattern>*/index.php</exclude-pattern>
<exclude-pattern>src/*</exclude-pattern>
<exclude-pattern>build/*</exclude-pattern>
<!-- Minimum WP version supported -->
<config name="minimum_supported_wp_version" value="4.6"/>
<!-- TODO Change to alternate functions. -->
<!-- <rule ref="WordPress.WP.AlternativeFunctions" />-->
<rule ref="WordPress.WP.DeprecatedFunctions" />
<rule ref="WordPress.WP.DeprecatedClasses" />
<rule ref="WordPress.WP.DeprecatedParameters" />
<rule ref="WordPress.WP.DeprecatedParameterValues" />
<rule ref="WordPress-Core">
<!-- TODO (Maybe) Change class filenames with "class-" prepended. -->
<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<!-- TODO Change plugin filenames to use Hyphens instead of Underscores. -->
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
<!-- TODO Clean ( OR disable/ignore ) commented out code. -->
<exclude name="Squiz.PHP.CommentedOutCode" />
<!-- TODO Add `// translators: *` comments to `__()`. -->
<exclude name="WordPress.WP.I18n.MissingTranslatorsComment" />
<!-- TODO Change ( OR disable/ignore ) classname naming convention. -->
<exclude name="PEAR.NamingConventions.ValidClassName.Invalid" />
<!-- these can be removed once the initial part of #1003 is closed -->
<!-- TODO Fix missing param comments in phpDoc. -->
<exclude name="Squiz.Commenting.FunctionComment" />
<!-- these can be removed once #2335 is closed -->
<exclude name="WordPress.PHP.StrictComparisons.LooseComparison" />
<exclude name="WordPress.CodeAnalysis.AssignmentInCondition.Found" />
<exclude name="WordPress.PHP.StrictInArray.MissingTrueStrict" />
<exclude name="WordPress.DateTime.RestrictedFunctions" />
<exclude name="WordPress.NamingConventions" />
</rule>
<rule ref="WordPress-Docs" />
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="all-in-one-seo-pack" />
<property name="check_translator_comments" value="true"/>
</properties>
</rule>
<rule ref="WordPress.DB.RestrictedClasses" />
<rule ref="WordPress.DB.RestrictedFunctions" />
<!-- Using meta_key is required. -->
<!-- <rule ref="WordPress.DB.SlowDBQuery" />-->
<!-- TODO Change to alternate functions/operations. -->
<!-- <rule ref="WordPress.PHP.DevelopmentFunctions" />-->
<!-- TODO Change functions to alternate functions, or phpcs:disable rule. -->
<!-- TODO Change query_posts() to wp_query. -->
<!-- <rule ref="WordPress.PHP.DiscouragedPHPFunctions" />-->
<rule ref="WordPress.PHP.DontExtract" />
<rule ref="WordPress.PHP.POSIXFunctions" />
<rule ref="WordPress.PHP.RestrictedPHPFunctions" />
<rule ref="WordPress.Security.SafeRedirect" />
<!-- TODO Change to alternate functions/operations; serialize() is discouraged. -->
<!-- <rule ref="WordPress.WP.DiscouragedFunctions" />-->
<rule ref="WordPress.WP.PostsPerPage">
<properties>
<property name="posts_per_page" value="50000" />
</properties>
</rule>
<!-- TODO Prefix globals and hooks. -->
<!-- <rule ref="WordPress.NamingConventions.PrefixAllGlobals">-->
<!-- <properties>-->
<!-- <property name="prefixes" type="array">-->
<!-- <element value="aioseop_" />-->
<!-- <element value="aiosp_" />-->
<!-- </property>-->
<!-- <exclude-pattern>*\tests\*</exclude-pattern>-->
<!-- </properties>-->
<!-- </rule>-->
<rule ref="Squiz.Commenting.FileComment">
<!-- Prevents File Header documentation -->
<exclude-pattern>*/index.php</exclude-pattern>
<exclude-pattern>/all_in_one_seo_pack.php</exclude-pattern>
</rule>
<rule ref="PHPCompatibility">
<!-- Remove this once minimum PHP version is 5.4 (as PHPUnit doesn't support < v5.4) . -->
<exclude-pattern>tests/</exclude-pattern>
<exclude name="PHPCompatibility.ParameterValues.NewHTMLEntitiesEncodingDefault.NotSet" />
</rule>
<!-- Check for cross-version support for PHP 5.2 and higher. -->
<config name="testVersion" value="5.2-"/>
<rule ref="PSR2">
<exclude name="PSR2" />
</rule>
<rule ref="PEAR">
<exclude name="PEAR" />
</rule>
<rule ref="Squiz">
<exclude name="Squiz" />
</rule>
</ruleset>