Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Batcache references in messaging #618

Merged
merged 2 commits into from
Jan 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions WordPress-VIP-Go/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,15 @@
<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>
</rule>
<rule ref="WordPressVIPMinimum.Functions.RestrictedFunctions.cookies_setcookie">
<type>error</type>
<severity>6</severity>
<message>Due to server-side caching, server-side based client related logic might not work. We recommend implementing client side logic in JavaScript instead.</message>
</rule>
<rule ref="WordPressVIPMinimum.Variables.RestrictedVariables.cache_constraints___COOKIE">
<type>error</type>
<severity>6</severity>
<message>Due to server-side caching, server-side based client related logic might not work. We recommend implementing client side logic in JavaScript instead.</message>
</rule>
<rule ref="WordPressVIPMinimum.Variables.RestrictedVariables.cache_constraints___SERVER__HTTP_USER_AGENT__">
<type>error</type>
<severity>6</severity>
<message>Due to server-side caching, server-side based client related logic might not work. We recommend implementing client side logic in JavaScript instead.</message>
</rule>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ public function getGroups() {
// @link WordPress.com: https://lobby.vip.wordpress.com/wordpress-com-documentation/code-review-what-we-look-for/#custom-roles
// @link VIP Go: https://wpvip.com/documentation/vip-go/code-review-blockers-warnings-notices/#cache-constraints
'cookies' => [
'type' => 'warning',
'message' => 'Due to using Batcache, server side based client related logic will not work, use JS instead.',
'type' => 'error',
'message' => 'Due to server-side caching, server-side based client related logic might not work. We recommend implementing client side logic in JavaScript instead.',
'functions' => [
'setcookie',
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function getGroups() {
// @link https://lobby.vip.wordpress.com/wordpress-com-documentation/code-review-what-we-look-for/#caching-constraints
'cache_constraints' => [
'type' => 'warning',
'message' => 'Due to using Batcache, server side based client related logic will not work, use JS instead.',
'message' => 'Due to server-side caching, server-side based client related logic might not work. We recommend implementing client side logic in JavaScript instead.',
'variables' => [
'$_COOKIE',
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ vip_safe_wp_remote_get(); // Ok - VIP recommended version of wp_remote_get().
wp_remote_get( $url ); // Warning.

cookie( $_GET['test'] ); // Ok - similarly-named function to setcookie().
setcookie( 'cookie[three]', 'cookiethree' ); // Warning.
setcookie( 'cookie[three]', 'cookiethree' ); // Error.

get_post( 123 ); // Ok - not using get_posts().
wp_get_recent_post(); // Ok - similarly-named function to wp_get_recent_posts().
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public function getErrorList() {
101 => 1,
104 => 1,
107 => 1,
125 => 1,
141 => 1,
142 => 1,
143 => 1,
Expand Down Expand Up @@ -128,7 +129,6 @@ public function getWarningList() {
118 => 1,
119 => 1,
122 => 1,
125 => 1,
130 => 1,
131 => 1,
132 => 1,
Expand Down