Skip to content

Commit

Permalink
Merge pull request #699 from WordPress/increase-severity-for-rulesets
Browse files Browse the repository at this point in the history
Increase severity for rulesets
  • Loading branch information
ernilambar authored Oct 5, 2024
2 parents 98221d8 + 84d9c53 commit c698590
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions phpcs-rulesets/plugin-review.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,14 @@
</rule>

<!-- Prohibit the use of the backtick operator. -->
<rule ref="Generic.PHP.BacktickOperator"/>
<rule ref="Generic.PHP.BacktickOperator">
<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>

Expand All @@ -67,17 +70,32 @@

<!-- 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"/>
<rule ref="Generic.PHP.DisallowAlternativePHPTags">
<severity>7</severity>
</rule>

<!-- Prevent path disclosure when using add_theme_page(). -->
<rule ref="WordPress.Security.PluginMenuSlug"/>
<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"/>
<rule ref="WordPress.DB.RestrictedFunctions"/>
<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">
Expand Down Expand Up @@ -120,9 +138,12 @@
<!-- Check for deprecated WordPress constants. -->
<rule ref="WordPress.WP.DiscouragedConstants">
<type>error</type>
<severity>7</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"/>
<rule ref="WordPress.WP.DeprecatedParameterValues">
<severity>7</severity>
</rule>

</ruleset>

0 comments on commit c698590

Please sign in to comment.