Skip to content

Commit 46962db

Browse files
committed
WordPress-VIP-Go: Remove WordPress.WP.GlobalVariablesOverride.Prohibited
1 parent 998c726 commit 46962db

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

WordPress-VIP-Go/ruleset-test.inc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,10 @@ _ex( $some_nasty_var, 'context' ); // Error.
182182
echo esc_html_x( 'Something', 'context' ); // Ok.
183183
echo esc_html_x( $some_nasty_var, 'context' ); // Ok.
184184

185-
// WordPress.WP.GlobalVariablesOverride.OverrideProhibited
186-
global $wpdb;
187-
$wpdb = 'test'; // Error.
188-
$GLOBALS['domain']['subkey'] = 'something else'; // Error.
185+
186+
187+
188+
189189

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

299299
// WordPressVIPMinimum.Variables.RestrictedVariables.user_meta__wpdb__usermeta
300-
$query = "SELECT * FROM $wpdb->usermeta"; // Ok.
300+
global $wpdb; $query = "SELECT * FROM $wpdb->usermeta"; // Ok.
301301

302302
// WordPressVIPMinimum.Functions.RestrictedFunctions.site_option_delete_site_option
303303
delete_site_option( $foo ); // Ok.

WordPress-VIP-Go/ruleset-test.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
165 => 1,
2424
180 => 1,
2525
181 => 1,
26-
187 => 1,
27-
188 => 1,
2826
252 => 1,
2927
255 => 1,
3028
256 => 1,

WordPress-VIP-Go/ruleset.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,6 @@
210210
<!-- We trust that translations are safe on VIP Go -->
211211
<severity>1</severity>
212212
</rule>
213-
<rule ref="WordPress.WP.GlobalVariablesOverride.Prohibited">
214-
<!-- This is often a false positive. Still nice to flag for a check -->
215-
<severity>3</severity>
216-
</rule>
217213
<rule ref="WordPress.WP.EnqueuedResources.NonEnqueuedScript">
218214
<type>warning</type>
219215
<severity>3</severity>

0 commit comments

Comments
 (0)