diff --git a/WordPress-VIP-Go/ruleset.xml b/WordPress-VIP-Go/ruleset.xml index a196e658..f0584eea 100644 --- a/WordPress-VIP-Go/ruleset.xml +++ b/WordPress-VIP-Go/ruleset.xml @@ -93,19 +93,15 @@ 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. - error 6 - Due to server-side caching, server-side based client related logic might not work. We recommend implementing client side logic in JavaScript instead. error 6 - Due to server-side caching, server-side based client related logic might not work. We recommend implementing client side logic in JavaScript instead. error 6 - Due to server-side caching, server-side based client related logic might not work. We recommend implementing client side logic in JavaScript instead. diff --git a/WordPressVIPMinimum/Sniffs/Functions/RestrictedFunctionsSniff.php b/WordPressVIPMinimum/Sniffs/Functions/RestrictedFunctionsSniff.php index 74995407..05cce840 100644 --- a/WordPressVIPMinimum/Sniffs/Functions/RestrictedFunctionsSniff.php +++ b/WordPressVIPMinimum/Sniffs/Functions/RestrictedFunctionsSniff.php @@ -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', ], diff --git a/WordPressVIPMinimum/Sniffs/Variables/RestrictedVariablesSniff.php b/WordPressVIPMinimum/Sniffs/Variables/RestrictedVariablesSniff.php index 7b6d7917..f750f660 100644 --- a/WordPressVIPMinimum/Sniffs/Variables/RestrictedVariablesSniff.php +++ b/WordPressVIPMinimum/Sniffs/Variables/RestrictedVariablesSniff.php @@ -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', ], diff --git a/WordPressVIPMinimum/Tests/Functions/RestrictedFunctionsUnitTest.inc b/WordPressVIPMinimum/Tests/Functions/RestrictedFunctionsUnitTest.inc index 7c1ba946..79e3569a 100644 --- a/WordPressVIPMinimum/Tests/Functions/RestrictedFunctionsUnitTest.inc +++ b/WordPressVIPMinimum/Tests/Functions/RestrictedFunctionsUnitTest.inc @@ -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(). diff --git a/WordPressVIPMinimum/Tests/Functions/RestrictedFunctionsUnitTest.php b/WordPressVIPMinimum/Tests/Functions/RestrictedFunctionsUnitTest.php index 493b9270..ada3fd5e 100644 --- a/WordPressVIPMinimum/Tests/Functions/RestrictedFunctionsUnitTest.php +++ b/WordPressVIPMinimum/Tests/Functions/RestrictedFunctionsUnitTest.php @@ -59,6 +59,7 @@ public function getErrorList() { 101 => 1, 104 => 1, 107 => 1, + 125 => 1, 141 => 1, 142 => 1, 143 => 1, @@ -128,7 +129,6 @@ public function getWarningList() { 118 => 1, 119 => 1, 122 => 1, - 125 => 1, 130 => 1, 131 => 1, 132 => 1,