forked from wp-media/wp-rocket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml
122 lines (108 loc) · 6.23 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
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="WP Rocket" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<description>The custom ruleset for WP Rocket.</description>
<!-- For help in understanding this file: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
<!-- For help in using PHPCS: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
<!-- ** WHAT TO SCAN ** -->
<file>.</file>
<!-- Ignoring Files and Folders: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-files-and-folders -->
<exclude-pattern>/inc/deprecated/*</exclude-pattern>
<exclude-pattern>/inc/Engine/Container/*</exclude-pattern>
<exclude-pattern>/inc/Dependencies/*</exclude-pattern>
<exclude-pattern>/inc/classes/dependencies/*</exclude-pattern>
<exclude-pattern>/inc/vendors/*</exclude-pattern>
<exclude-pattern>/tests/*</exclude-pattern>
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/node_modules/*</exclude-pattern>
<!-- ** HOW TO SCAN ** -->
<arg value="sp"/><!-- Show sniff and progress -->
<arg name="colors"/><!-- Show results with colors -->
<arg name="parallel" value="50"/><!-- Enables parallel processing when available for faster results. -->
<arg name="extensions" value="php"/><!-- Limit to PHP files -->
<!-- Rules: Check PHP version compatibility - see https://github.com/PHPCompatibility/PHPCompatibilityWP -->
<rule ref="PHPCompatibility"/>
<config name="testVersion" value="7.0-"/>
<config name="minimum_supported_wp_version" value="5.2"/>
<rule ref="WordPress">
<exclude name="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma"/>
<exclude name="Generic.PHP.NoSilencedErrors.Discouraged"/>
<exclude name="PEAR.Functions.FunctionCallSignature.Indent"/>
<exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace"/>
<exclude name="Squiz.Commenting.FileComment.Missing"/>
<exclude name="Squiz.Commenting.FileComment.MissingPackageTag"/>
<exclude name="Squiz.PHP.CommentedOutCode.Found"/>
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
<exclude name="Generic.Arrays.DisallowShortArraySyntax" />
<!-- Allow cURL. -->
<exclude name="WordPress.WP.AlternativeFunctions.curl_curl_init" />
<exclude name="WordPress.WP.AlternativeFunctions.curl_curl_exec" />
<exclude name="WordPress.WP.AlternativeFunctions.curl_curl_error" />
<exclude name="WordPress.WP.AlternativeFunctions.curl_curl_getinfo" />
<exclude name="WordPress.WP.AlternativeFunctions.curl_curl_close" />
<exclude name="WordPress.WP.AlternativeFunctions.curl_curl_setopt_array" />
<exclude name="WordPress.WP.AlternativeFunctions.curl_curl_setopt" />
</rule>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="rocket" />
</properties>
</rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array" value="rocket,wp_rocket,WPMedia,WPRocket" />
</properties>
</rule>
<rule ref="WordPress.Files.FileName">
<properties>
<property name="strict_class_file_names" value="false" />
</properties>
</rule>
<rule ref="WordPress.WP.AlternativeFunctions.file_system_read_readfile">
<exclude-pattern>inc/classes/buffer/class-cache.php</exclude-pattern>
</rule>
<rule ref="WordPress.PHP.NoSilencedErrors.Discouraged">
<exclude-pattern>inc/admin/admin.php</exclude-pattern>
<exclude-pattern>inc/front/process.php</exclude-pattern>
<exclude-pattern>inc/classes/buffer/class-cache.php</exclude-pattern>
<exclude-pattern>inc/classes/admin/class-logs.php</exclude-pattern>
<exclude-pattern>inc/classes/logger/class-stream-handler.php</exclude-pattern>
<exclude-pattern>inc/classes/logger/class-logger.php</exclude-pattern>
<exclude-pattern>inc/classes/subscriber/third-party/Hostings/class-litespeed-subscriber.php</exclude-pattern>
<exclude-pattern>inc/classes/subscriber/third-party/plugins/ecommerce/class-woocommerce-subscriber.php</exclude-pattern>
<exclude-pattern>inc/classes/subscriber/third-party/plugins/security/class-sucuri-subscriber.php</exclude-pattern>
</rule>
<rule ref="WordPress.DB.DirectDatabaseQuery.DirectQuery">
<exclude-pattern>inc/classes/admin/Database/class-optimization-process.php</exclude-pattern>
<exclude-pattern>inc/classes/admin/Database/class-optimization.php</exclude-pattern>
<exclude-pattern>inc/Engine/Optimization/ContentTrait.php</exclude-pattern>
<exclude-pattern>inc/Engine/Optimization/RUCSS/Database/Query/UsedCSS.php</exclude-pattern>
</rule>
<rule ref="WordPress.DB.DirectDatabaseQuery.NoCaching">
<exclude-pattern>inc/classes/admin/Database/class-optimization-process.php</exclude-pattern>
<exclude-pattern>inc/classes/admin/Database/class-optimization.php</exclude-pattern>
<exclude-pattern>inc/Engine/Optimization/ContentTrait.php</exclude-pattern>
<exclude-pattern>inc/Engine/Optimization/RUCSS/Database/Query/UsedCSS.php</exclude-pattern>
</rule>
<rule ref="WordPress.DB.PreparedSQL.NotPrepared">
<exclude-pattern>inc/classes/admin/Database/class-optimization-process.php</exclude-pattern>
<exclude-pattern>inc/classes/admin/Database/class-optimization.php</exclude-pattern>
<exclude-pattern>inc/Engine/Optimization/RUCSS/Database/Query/UsedCSS.php</exclude-pattern>
</rule>
<rule ref="WordPress.DB.PreparedSQL.InterpolatedNotPrepared">
<exclude-pattern>inc/classes/admin/Database/class-optimization-process.php</exclude-pattern>
<exclude-pattern>inc/Engine/Optimization/ContentTrait.php</exclude-pattern>
</rule>
<rule ref="WordPress-Docs">
<exclude name="Squiz.Commenting.FileComment.Missing"/>
<exclude name="Squiz.Commenting.ClassComment.Missing"/>
</rule>
<!-- Rules: WordPress Coding Standards - see
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
WordPress-Extra includes WordPress-Core -->
<rule ref="WordPress-Extra">
<exclude name="Generic.Arrays.DisallowShortArraySyntax"/>
<exclude name="WordPress.PHP.DisallowShortTernary.Found"/>
</rule>
<!-- Enforce short array syntax: `[]` in place of `array()`. -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax" />
</ruleset>