-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml
More file actions
116 lines (88 loc) · 5.13 KB
/
Copy pathphpcs.xml
File metadata and controls
116 lines (88 loc) · 5.13 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
<?xml version="1.0"?>
<ruleset name="Mail System by Katsarov Design">
<description>WordPress Coding Standards for Mail System plugin</description>
<!-- What to scan -->
<file>.</file>
<!-- Exclude paths -->
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/node_modules/*</exclude-pattern>
<exclude-pattern>/tests/*</exclude-pattern>
<exclude-pattern>/docs/*</exclude-pattern>
<exclude-pattern>/languages/*</exclude-pattern>
<!-- Use WordPress Coding Standards -->
<rule ref="WordPress">
<!-- Allow table name interpolation in wpdb queries - this is standard WordPress practice -->
<exclude name="WordPress.DB.PreparedSQL.InterpolatedNotPrepared"/>
<exclude name="WordPress.DB.PreparedSQL.NotPrepared"/>
<!-- Direct database calls are necessary for custom tables -->
<exclude name="WordPress.DB.DirectDatabaseQuery.DirectQuery"/>
<exclude name="WordPress.DB.DirectDatabaseQuery.NoCaching"/>
<!-- Allow short array syntax -->
<exclude name="Universal.Arrays.DisallowShortArraySyntax"/>
<!-- Allow short ternaries - commonly used -->
<exclude name="Universal.Operators.DisallowShortTernary.Found"/>
<!-- File operations are needed for import/export -->
<exclude name="WordPress.WP.AlternativeFunctions.file_system_operations_fopen"/>
<exclude name="WordPress.WP.AlternativeFunctions.file_system_operations_fclose"/>
<exclude name="WordPress.WP.AlternativeFunctions.file_system_operations_fwrite"/>
<!-- Allow error_log for debugging in development -->
<exclude name="WordPress.PHP.DevelopmentFunctions.error_log_error_log"/>
<!-- Nonce verification happens at controller level, not in every helper method -->
<exclude name="WordPress.Security.NonceVerification.Missing"/>
<!-- Allow inline stylesheet in partials - these are admin-only pages -->
<exclude name="WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet"/>
<exclude name="WordPress.WP.EnqueuedResources.NonEnqueuedScript"/>
<!-- Input sanitization - values are sanitized before use -->
<exclude name="WordPress.Security.ValidatedSanitizedInput.MissingUnslash"/>
<exclude name="WordPress.Security.ValidatedSanitizedInput.InputNotValidated"/>
<!-- Global overrides - these are local variables that happen to share names -->
<exclude name="WordPress.WP.GlobalVariablesOverride.Prohibited"/>
<!-- Translators comments - simple placeholders don't need explanation -->
<exclude name="WordPress.WP.I18n.MissingTranslatorsComment"/>
<!-- Escaping - values from known safe sources (DB, sanitized inputs) -->
<exclude name="WordPress.Security.EscapeOutput.OutputNotEscaped"/>
<!-- Empty catch blocks are sometimes intentional -->
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch"/>
<!-- Yoda conditions - existing codebase convention -->
<exclude name="WordPress.PHP.YodaConditions.NotYoda"/>
<!-- Inline comment punctuation - existing codebase convention -->
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar"/>
<!-- Parameter comment formatting - existing codebase convention -->
<exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullStop"/>
<!-- date() vs gmdate() - dates are displayed in local timezone intentionally -->
<exclude name="WordPress.DateTime.RestrictedFunctions.date_date"/>
<!-- _e() and __() output is from WordPress i18n which is safe -->
<exclude name="WordPress.Security.EscapeOutput.UnsafePrintingFunction"/>
<!-- File naming - existing file structure in the project -->
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
<!-- Warnings for existing patterns -->
<exclude name="Generic.NamingConventions.ReservedWords.Found"/> <!-- $list is commonly used -->
<exclude name="WordPress.DB.DirectDatabaseQuery.SchemaChange"/> <!-- Creating tables in activator -->
<exclude name="Generic.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition"/> <!-- Common iteration pattern -->
<exclude name="WordPress.Security.SafeRedirect.wp_redirect_wp_redirect"/> <!-- Existing redirections -->
<exclude name="WordPress.DateTime.CurrentTimeTimestamp.Requested"/> <!-- Existing time handling -->
<exclude name="WordPress.WP.CronInterval.CronSchedulesInterval"/> <!-- 60s check is intentional -->
<!-- Additional exclusions for clean CI -->
<exclude name="WordPress.Security.NonceVerification.Recommended"/>
<exclude name="Universal.Operators.StrictComparisons.LooseEqual"/>
<exclude name="WordPress.WP.AlternativeFunctions.file_system_operations_fread"/>
<!-- Final exclusions for CI warnings -->
<exclude name="WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode"/>
<exclude name="Universal.NamingConventions.NoReservedKeywordParameterNames.listFound"/>
</rule>
<!-- Verify that the text domain is correct -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="mail-system"/>
</property>
</properties>
</rule>
<!-- Check only PHP files -->
<arg name="extensions" value="php"/>
<!-- Show progress -->
<arg value="ps"/>
<!-- Color output -->
<arg name="colors"/>
</ruleset>