-
Notifications
You must be signed in to change notification settings - Fork 96
Expand file tree
/
Copy pathplugin-review.xml
More file actions
176 lines (147 loc) · 6.21 KB
/
plugin-review.xml
File metadata and controls
176 lines (147 loc) · 6.21 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
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="WPPluginCheck" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<!-- For more information: https://make.wordpress.org/plugins/handbook/review/ -->
<description>Standards any plugin to be published on wordpress.org should comply with.</description>
<!--
Prevent errors caused by WordPress Coding Standards not supporting PHP 8.0+.
See https://github.com/WordPress/WordPress-Coding-Standards/issues/2035
-->
<ini name="error_reporting" value="E_ALL & ~E_DEPRECATED" />
<arg name="report" value="code"/>
<arg value="s"/>
<!-- Plugins should be compatible with PHP 5.2 and higher. -->
<config name="testVersion" value="5.2-"/>
<exclude-pattern>*/tgm-plugin-activation/*</exclude-pattern>
<exclude-pattern>*/freemius/*</exclude-pattern>
<exclude-pattern>*/dompdf/*</exclude-pattern>
<exclude-pattern>*/cmb2/*</exclude-pattern>
<exclude-pattern>*/redux-framework/*</exclude-pattern>
<exclude-pattern>*/cherry-framework/*</exclude-pattern>
<exclude-pattern>*/titan-framework/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/guzzlehttp/*</exclude-pattern>
<exclude-pattern>*/vendors/*</exclude-pattern>
<exclude-pattern>*/plugin-update-checker/*</exclude-pattern>
<exclude-pattern>*/composer_directory/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<!-- All SQL queries should be prepared as close to the time of querying the database as possible. -->
<rule ref="WordPress.DB.PreparedSQL"/>
<rule ref="WordPress.DB.PreparedSQL.InterpolatedNotPrepared">
<!-- Ideally this wouldn't trigger on "safe" items, but it's triggered on any variable in the SQL. -->
<type>warning</type>
</rule>
<!-- Verify that placeholders in prepared queries are used correctly. -->
<rule ref="WordPress.DB.PreparedSQLPlaceholders"/>
<!-- Nonces. These are triggered on any GET/POST access items. -->
<rule ref="WordPress.Security.NonceVerification">
<!-- This is triggered on all GET/POST access, it can't be an error. -->
<type>warning</type>
</rule>
<!-- Sanitized Input rules -->
<rule ref="WordPress.Security.ValidatedSanitizedInput">
<type>warning</type>
</rule>
<!-- Prohibit the use of the backtick operator. -->
<rule ref="Generic.PHP.BacktickOperator">
<severity>7</severity>
</rule>
<!-- Prohibit the use of HEREDOC or NOWDOC. -->
<rule ref="Squiz.PHP.Heredoc">
<severity>7</severity>
</rule>
<!-- Prohibit the use of the `goto` PHP language construct. -->
<rule ref="Generic.PHP.DiscourageGoto.Found">
<type>error</type>
<severity>7</severity>
<message>The "goto" language construct should not be used.</message>
</rule>
<!-- Check for error logs in plugin -->
<rule ref="WordPress.PHP.DevelopmentFunctions">
<type>warning</type>
</rule>
<!-- No PHP short open tags allowed. -->
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
<rule ref="Generic.PHP.DisallowShortOpenTag.Found">
<severity>7</severity>
</rule>
<rule ref="Generic.PHP.DisallowShortOpenTag.EchoFound">
<severity>7</severity>
</rule>
<!-- Alternative PHP open tags not allowed. -->
<rule ref="Generic.PHP.DisallowAlternativePHPTags">
<severity>7</severity>
</rule>
<!-- Prevent path disclosure when using add_theme_page(). -->
<rule ref="WordPress.Security.PluginMenuSlug">
<severity>6</severity>
</rule>
<!-- While most plugins shouldn't query the database directly, if they do, it should be done correctly. -->
<!-- Don't use the PHP database functions and classes, use the WP abstraction layer instead. -->
<rule ref="WordPress.DB.RestrictedClasses">
<severity>7</severity>
</rule>
<rule ref="WordPress.DB.RestrictedFunctions">
<severity>7</severity>
</rule>
<!-- Check for code WP does better -->
<rule ref="WordPress.WP.AlternativeFunctions">
<type>error</type>
<exclude name="WordPress.WP.AlternativeFunctions.json_encode_json_encode"/>
<exclude name="WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents"/>
<exclude name="WordPress.WP.AlternativeFunctions.file_system_operations_file_put_contents"/>
</rule>
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array">
<element key="move_uploaded_file" value="null"/>
<element key="passthru" value="null"/>
<element key="proc_open" value="null"/>
<element key="create_function" value="null"/>
<element key="eval" value="null"/>
<element key="str_rot13" value="null"/>
</property>
</properties>
<type>error</type>
<severity>7</severity>
</rule>
<rule ref="Squiz.PHP.DiscouragedFunctions">
<properties>
<property name="forbiddenFunctions" type="array">
<element key="set_time_limit" value="null"/>
<element key="ini_set" value="null"/>
<element key="ini_alter" value="null"/>
<element key="dl" value="null"/>
</property>
</properties>
</rule>
<!-- Check for use of deprecated WordPress classes, functions and function parameters. -->
<rule ref="WordPress.WP.DeprecatedClasses"/>
<rule ref="WordPress.WP.DeprecatedFunctions"/>
<rule ref="WordPress.WP.DeprecatedParameters"/>
<rule ref="WordPress.DateTime.RestrictedFunctions"/>
<!-- Check for deprecated WordPress constants. -->
<rule ref="WordPress.WP.DiscouragedConstants">
<type>error</type>
<severity>7</severity>
</rule>
<!-- Check for discouraged WordPress functions. -->
<rule ref="WordPress.WP.DiscouragedFunctions">
<severity>6</severity>
</rule>
<!-- Check for usage of deprecated parameter values in WP functions and provide alternative based on the parameter passed. -->
<rule ref="WordPress.WP.DeprecatedParameterValues">
<severity>7</severity>
</rule>
<!-- No ByteOrderMark allowed - important to prevent issues with content being sent before headers. -->
<rule ref="Generic.Files.ByteOrderMark">
<severity>7</severity>
</rule>
<!-- Call-time pass-by-reference has been deprecated since PHP 5.3 and should not be used. -->
<rule ref="Generic.Functions.CallTimePassByReference">
<severity>7</severity>
</rule>
<!-- Check for missing required function parameters. -->
<rule ref="PluginCheck.CodeAnalysis.RequiredFunctionParameters">
<severity>7</severity>
</rule>
</ruleset>