Skip to content

Commit

Permalink
WordPress-VIP-Go: Remove WordPress.WP.GlobalVariablesOverride.Prohibited
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccahum committed Mar 9, 2021
1 parent 998c726 commit 7587f57
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
10 changes: 5 additions & 5 deletions WordPress-VIP-Go/ruleset-test.inc
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ _ex( $some_nasty_var, 'context' ); // Error.
echo esc_html_x( 'Something', 'context' ); // Ok.
echo esc_html_x( $some_nasty_var, 'context' ); // Ok.

// WordPress.WP.GlobalVariablesOverride.OverrideProhibited
global $wpdb;
$wpdb = 'test'; // Error.
$GLOBALS['domain']['subkey'] = 'something else'; // Error.





// WordPress.WP.EnqueuedResources.NonEnqueuedScript
echo wp_kses( '<script src="' . esc_url( $url ) . '">', [ 'script' => [ 'src' => [], ], ] ); // Warning + Message.
Expand Down Expand Up @@ -297,7 +297,7 @@ get_user_meta(); // Ok.
update_user_meta( $bar, '123', $foo ); // Ok.

// WordPressVIPMinimum.Variables.RestrictedVariables.user_meta__wpdb__usermeta
$query = "SELECT * FROM $wpdb->usermeta"; // Ok.
$query = "SELECT * FROM $wpdb->usermeta"; // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis

// WordPressVIPMinimum.Functions.RestrictedFunctions.site_option_delete_site_option
delete_site_option( $foo ); // Ok.
Expand Down
2 changes: 0 additions & 2 deletions WordPress-VIP-Go/ruleset-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
165 => 1,
180 => 1,
181 => 1,
187 => 1,
188 => 1,
252 => 1,
255 => 1,
256 => 1,
Expand Down
4 changes: 0 additions & 4 deletions WordPress-VIP-Go/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,6 @@
<!-- We trust that translations are safe on VIP Go -->
<severity>1</severity>
</rule>
<rule ref="WordPress.WP.GlobalVariablesOverride.Prohibited">
<!-- This is often a false positive. Still nice to flag for a check -->
<severity>3</severity>
</rule>
<rule ref="WordPress.WP.EnqueuedResources.NonEnqueuedScript">
<type>warning</type>
<severity>3</severity>
Expand Down

0 comments on commit 7587f57

Please sign in to comment.