Repository navigation
Expand file tree
/
Copy pathphpcs.xml
More file actions
210 lines (184 loc) · 7.75 KB
/
Copy pathphpcs.xml
File metadata and controls
210 lines (184 loc) · 7.75 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
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="WordPress Plugin Coding Standards">
<description>WordPress coding standards</description>
<!-- Files to check -->
<file>.</file>
<!-- Exclude patterns -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/.private/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/.git/*</exclude-pattern>
<exclude-pattern>*/.github/*</exclude-pattern>
<exclude-pattern>*/css/*</exclude-pattern>
<exclude-pattern>*/stubs/*</exclude-pattern>
<exclude-pattern>*.css</exclude-pattern>
<exclude-pattern>*.js</exclude-pattern>
<!-- Use WordPress-Extra coding standards (includes WordPress-Core) -->
<rule ref="WordPress-Extra">
<!-- Allow short array syntax [] instead of array() -->
<exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
<!-- Allow longer lines for readability -->
<exclude name="Generic.Files.LineLength"/>
</rule>
<!-- WordPress VIP Go coding standards. -->
<rule ref="WordPress-VIP-Go">
<!-- VIPCS 3 registers JS sniffs that PHPCS 3.13 marks deprecated. -->
<exclude name="WordPressVIPMinimum.JS.DangerouslySetInnerHTML"/>
<exclude name="WordPressVIPMinimum.JS.HTMLExecutingFunctions"/>
<exclude name="WordPressVIPMinimum.JS.InnerHTML"/>
<exclude name="WordPressVIPMinimum.JS.StringConcat"/>
<exclude name="WordPressVIPMinimum.JS.StrippingTags"/>
<exclude name="WordPressVIPMinimum.JS.Window"/>
</rule>
<!--
WordPress-VIP-Go switches the checks below off, because they do not matter on the VIP
platform. This plugin runs on other hosts as well, so each one gets its default severity back.
-->
<rule ref="Generic.PHP.DisallowShortOpenTag.EchoFound">
<severity>5</severity>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines">
<severity>5</severity>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndLine">
<severity>5</severity>
</rule>
<rule ref="VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable">
<severity>5</severity>
</rule>
<rule ref="WordPress.DB.SlowDBQuery.slow_db_query_meta_key">
<severity>5</severity>
</rule>
<rule ref="WordPress.PHP.DevelopmentFunctions.prevent_path_disclosure_error_reporting">
<severity>5</severity>
</rule>
<rule ref="WordPress.Security.EscapeOutput.ExceptionNotEscaped">
<severity>5</severity>
</rule>
<rule ref="WordPress.Security.ValidatedSanitizedInput.MissingUnslash">
<severity>5</severity>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents">
<severity>5</severity>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_system_operations_chgrp">
<severity>5</severity>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_system_operations_chmod">
<severity>5</severity>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_system_operations_chown">
<severity>5</severity>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_system_operations_fclose">
<severity>5</severity>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_system_operations_file_put_contents">
<severity>5</severity>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_system_operations_fputs">
<severity>5</severity>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_system_operations_fwrite">
<severity>5</severity>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_system_operations_is_writable">
<severity>5</severity>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_system_operations_is_writeable">
<severity>5</severity>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_system_operations_mkdir">
<severity>5</severity>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_system_operations_readfile">
<severity>5</severity>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_system_operations_rmdir">
<severity>5</severity>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_system_operations_touch">
<severity>5</severity>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.rename_rename">
<severity>5</severity>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.strip_tags_strip_tags">
<severity>5</severity>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.unlink_unlink">
<severity>5</severity>
</rule>
<!-- WordPress documentation standards -->
<rule ref="WordPress-Docs"/>
<!-- Additional WordPress-specific spacing rules -->
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing"/>
<rule ref="WordPress.WhiteSpace.OperatorSpacing"/>
<!-- Enforce WordPress indentation standards -->
<rule ref="WordPress.Arrays.ArrayIndentation"/>
<rule ref="WordPress.Arrays.MultipleStatementAlignment"/>
<!-- WordPress function call formatting -->
<rule ref="PEAR.Functions.FunctionCallSignature">
<properties>
<property name="allowMultipleArguments" value="false"/>
</properties>
</rule>
<!-- WordPress class and method formatting -->
<rule ref="PSR2.Classes.ClassDeclaration"/>
<rule ref="PSR2.Methods.MethodDeclaration"/>
<!-- File formatting -->
<rule ref="Generic.Files.ByteOrderMark"/>
<rule ref="Generic.Files.LineEndings">
<properties>
<property name="eolChar" value="\n"/>
</properties>
</rule>
<!-- WordPress security and best practices -->
<rule ref="WordPress.Security"/>
<!-- WordPress internationalization configuration -->
<rule ref="WordPress.WP.I18n">
<properties>
<!-- Set the text domain for internationalization -->
<property name="text_domain" type="array">
<element value="optimizations-ace-mc"/>
</property>
</properties>
</rule>
<!-- Every function, class, constant, global variable and hook that the plugin declares starts with its prefix. -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array">
<element value="optimizations_ace_mc"/>
</property>
</properties>
</rule>
<!-- WordPress naming conventions (snake_case) -->
<rule ref="WordPress.NamingConventions.ValidFunctionName"/>
<rule ref="WordPress.NamingConventions.ValidVariableName"/>
<rule ref="WordPress.NamingConventions.ValidHookName"/>
<!-- WordPress PHP compatibility -->
<rule ref="PHPCompatibilityWP">
<include-pattern>*\.php$</include-pattern>
</rule>
<!-- PHPCSExtra standards for additional code quality checks -->
<rule ref="Modernize"/>
<!-- Allow PHP short array syntax. -->
<rule ref="Universal.Arrays.DisallowShortArraySyntax">
<severity>0</severity>
</rule>
<rule ref="NormalizedArrays">
<exclude name="Universal.Arrays.DisallowShortArraySyntax"/>
</rule>
<!-- Set minimum WordPress version for deprecated function checks -->
<config name="minimum_wp_version" value="7.0"/>
<config name="testVersion" value="8.2-"/>
<!-- Report every message, including those that a standard rates below the default severity of 5. -->
<arg name="severity" value="1"/>
<!-- Show progress -->
<arg value="p"/>
<!-- Show sniff codes in all reports -->
<arg value="s"/>
<!-- Use colors in output -->
<arg name="colors"/>
</ruleset>