Skip to content

Commit

Permalink
Merge pull request #647 from Automattic/remove_get_super_admin
Browse files Browse the repository at this point in the history
RestrictedFunctionsSniff: Remove get_super_admins group
  • Loading branch information
rebeccahum authored Apr 6, 2021
2 parents 71e109b + 164d67f commit 35f3305
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 15 deletions.
3 changes: 0 additions & 3 deletions WordPress-VIP-Go/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,6 @@
<rule ref="WordPressVIPMinimum.Variables.RestrictedVariables.user_meta__wpdb__usermeta">
<severity>0</severity>
</rule>
<rule ref="WordPressVIPMinimum.Functions.RestrictedFunctions.get_super_admins_get_super_admins">
<severity>0</severity>
</rule>
<rule ref="Generic.PHP.DisallowShortOpenTag.EchoFound">
<severity>0</severity>
</rule>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@ public function getGroups() {
'opcache_get_configuration',
],
],
'get_super_admins' => [
'type' => 'error',
'message' => '`%s` is prohibited on the WordPress.com VIP platform.',
'functions' => [
'get_super_admins',
],
],
'internal' => [
'type' => 'error',
'message' => '`%1$s()` is for internal use only.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ opcache_get_status(); // Error.
opcache_get_status( false ); // Error.
opcache_get_configuration(); // Error.

get_super_admin(); // Ok - similarly-named function to get_super_admins().
get_super_admins(); // Error.



vip_irc(); // Ok - similarly-named function to wpcom_vip_irc().
wpcom_vip_irc(); // Error.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public function getErrorList() {
32 => 1,
33 => 1,
34 => 1,
37 => 1,
40 => 1,
43 => 1,
46 => 1,
Expand Down
2 changes: 1 addition & 1 deletion WordPressVIPMinimum/ruleset-test.inc
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ opcache_compile_file( $var ); // Error.
opcache_is_script_cached( 'test_script.php' ); // Error.
opcache_get_status(); // Error.
opcache_get_configuration(); // Error.
get_super_admins(); // Error.

wpcom_vip_irc(); // Error.
flush_rewrite_rules(); // Error.
$wp_rewrite->flush_rules(); // Error.
Expand Down
1 change: 0 additions & 1 deletion WordPressVIPMinimum/ruleset-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
315 => 1,
316 => 1,
317 => 1,
318 => 1,
319 => 1,
320 => 1,
321 => 1,
Expand Down

0 comments on commit 35f3305

Please sign in to comment.