Skip to content

Commit 37c5059

Browse files
authored
Merge pull request #443 from Automattic/rebecca/edit_admin_removal_go
WordPress-VIP-Go: Downgrade to "Warning" level for AdminBarRemovalSniff
2 parents b3e134c + fc0ae5f commit 37c5059

File tree

3 files changed

+31
-21
lines changed

3 files changed

+31
-21
lines changed

WordPress-VIP-Go/ruleset-test.inc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,11 @@ function foo_bar_foo() {
218218
}
219219

220220
// WordPressVIPMinimum.UserExperience.AdminBarRemoval
221-
add_filter( 'show_admin_bar', '__return_false' ); // Error.
221+
add_filter( 'show_admin_bar', '__return_false' ); // Warning.
222222
add_filter( 'show_admin_bar', '__return_true' ); // Ok.
223-
show_admin_bar( false ); // Error.
223+
show_admin_bar( false ); // Warning.
224224
show_admin_bar( true ); // Ok.
225-
add_filter( 'show_admin_bar', 'my_own_return_false' ); // Error.
225+
add_filter( 'show_admin_bar', 'my_own_return_false' ); // Warning.
226226
echo '<style type="text/css">
227227
#wpadminbar {
228228
visibility: hidden; /* Error. */
@@ -232,19 +232,19 @@ echo '<style type="text/css">
232232
</style>';
233233
?> <style type="text/css">
234234
#wpadminbar {
235-
visibility: hidden; /* Error. */
236-
display: none; /* Error. */
237-
opacity: 0; /* Error. */
235+
visibility: hidden; /* Warning. */
236+
display: none; /* Warning. */
237+
opacity: 0; /* Warning. */
238238
}
239239
#not-wpadminbar {
240240
visibility: hidden; /* OK. */
241241
display: none; /* OK. */
242242
opacity: 0; /* OK. */
243243
}
244244
.show-admin-bar {
245-
visibility: hidden; /* Error. */
246-
display: none; /* Error. */
247-
opacity: 0; /* Error. */
245+
visibility: hidden; /* Warning. */
246+
display: none; /* Warning. */
247+
opacity: 0; /* Warning. */
248248
}
249249
</style> <?php
250250

WordPress-VIP-Go/ruleset-test.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,6 @@
2525
181 => 1,
2626
187 => 1,
2727
188 => 1,
28-
221 => 1,
29-
223 => 1,
30-
225 => 1,
31-
228 => 1,
32-
229 => 1,
33-
230 => 1,
34-
235 => 1,
35-
236 => 1,
36-
237 => 1,
37-
245 => 1,
38-
246 => 1,
39-
247 => 1,
4028
252 => 1,
4129
255 => 1,
4230
256 => 1,
@@ -197,6 +185,18 @@
197185
208 => 1,
198186
212 => 1,
199187
217 => 1,
188+
221 => 1,
189+
223 => 1,
190+
225 => 1,
191+
228 => 1,
192+
229 => 1,
193+
230 => 1,
194+
235 => 1,
195+
236 => 1,
196+
237 => 1,
197+
245 => 1,
198+
246 => 1,
199+
247 => 1,
200200
265 => 1,
201201
269 => 1,
202202
273 => 1,

WordPress-VIP-Go/ruleset.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,16 @@
8282
<severity>6</severity>
8383
<message>File system operations only work on the `/tmp/` and `wp-content/uploads/` directories. To avoid unexpected results, please use helper functions like `get_temp_dir()` or `wp_get_upload_dir()` to get the proper directory path when using functions such as %s(). For more details, please see: https://wpvip.com/documentation/vip-go/writing-files-on-vip-go/</message>
8484
</rule>
85+
<rule ref="WordPressVIPMinimum.UserExperience.AdminBarRemoval.RemovalDetected">
86+
<type>warning</type>
87+
<severity>6</severity>
88+
<message>Removal of admin bar is highly discouraged for user roles of "administrator" and "vip_support" -- if these roles are already excluded, this warning can be ignored.</message>
89+
</rule>
90+
<rule ref="WordPressVIPMinimum.UserExperience.AdminBarRemoval.HidingDetected">
91+
<type>warning</type>
92+
<severity>6</severity>
93+
<message>Hiding of admin bar is highly discouraged for user roles of "administrator" and "vip_support" -- if these roles are already excluded, this warning can be ignored.</message>
94+
</rule>
8595
<rule ref="WordPressVIPMinimum.Functions.RestrictedFunctions.cookies_setcookie">
8696
<type>error</type>
8797
<severity>6</severity>

0 commit comments

Comments
 (0)