diff --git a/WordPress-VIP-Go/ruleset-test.inc b/WordPress-VIP-Go/ruleset-test.inc index 4a36e262..bd7e3de6 100644 --- a/WordPress-VIP-Go/ruleset-test.inc +++ b/WordPress-VIP-Go/ruleset-test.inc @@ -130,9 +130,9 @@ get_next_post(); // Warning. get_previous_post_link(); // Warning. get_next_post_link(); // Warning. -// WordPressVIPMinimum.Functions.RestrictedFunctions.get_page_by_title_get_page_by_title -wpcom_vip_get_page_by_title(); // Ok. -get_page_by_title( $page_title ); // Warning + Message. + + + // WordPressVIPMinimum.Functions.RestrictedFunctions.get_posts_get_children get_child(); // Ok. diff --git a/WordPress-VIP-Go/ruleset-test.php b/WordPress-VIP-Go/ruleset-test.php index 053d9a86..d8701db4 100644 --- a/WordPress-VIP-Go/ruleset-test.php +++ b/WordPress-VIP-Go/ruleset-test.php @@ -154,7 +154,6 @@ 129 => 1, 130 => 1, 131 => 1, - 135 => 1, 139 => 1, 142 => 1, 146 => 1, @@ -304,9 +303,6 @@ 123 => [ 'attachment_url_to_postid() is uncached, please use wpcom_vip_attachment_url_to_postid() instead.', ], - 135 => [ - 'get_page_by_title() is uncached, please use wpcom_vip_get_page_by_title() instead.', - ], 139 => [ 'get_children() is uncached and performs a no limit query. Please use get_posts or WP_Query instead. Please see: https://docs.wpvip.com/technical-references/caching/uncached-functions/', ], diff --git a/WordPress-VIP-Go/ruleset.xml b/WordPress-VIP-Go/ruleset.xml index f8952dcb..8cd531c3 100644 --- a/WordPress-VIP-Go/ruleset.xml +++ b/WordPress-VIP-Go/ruleset.xml @@ -152,10 +152,6 @@ warning - - warning - %s() is uncached, please use wpcom_vip_get_page_by_title() instead. - warning 3 diff --git a/WordPressVIPMinimum/Sniffs/Functions/RestrictedFunctionsSniff.php b/WordPressVIPMinimum/Sniffs/Functions/RestrictedFunctionsSniff.php index 8f81f4cf..152f4499 100644 --- a/WordPressVIPMinimum/Sniffs/Functions/RestrictedFunctionsSniff.php +++ b/WordPressVIPMinimum/Sniffs/Functions/RestrictedFunctionsSniff.php @@ -80,13 +80,6 @@ public function getGroups() { 'switch_to_blog', ], ], - 'get_page_by_title' => [ - 'type' => 'error', - 'message' => '%s() is prohibited, please use wpcom_vip_get_page_by_title() instead.', - 'functions' => [ - 'get_page_by_title', - ], - ], 'url_to_postid' => [ 'type' => 'error', 'message' => '%s() is prohibited, please use wpcom_vip_url_to_postid() instead.', diff --git a/WordPressVIPMinimum/Tests/Functions/RestrictedFunctionsUnitTest.inc b/WordPressVIPMinimum/Tests/Functions/RestrictedFunctionsUnitTest.inc index b4366c98..10851408 100644 --- a/WordPressVIPMinimum/Tests/Functions/RestrictedFunctionsUnitTest.inc +++ b/WordPressVIPMinimum/Tests/Functions/RestrictedFunctionsUnitTest.inc @@ -55,8 +55,8 @@ $wp_rewrite->flush_rules(); // Error. switch_blog(); // Ok - similarly-named function to switch_to_blog(). switch_to_blog( $blogid ); // Warning. -wpcom_vip_get_page_by_title(); // Ok - VIP recommended version of get_page_by_title(). -get_page_by_title( $page_title ); // Error. + + wpcom_vip_url_to_postid( $url ); // Ok - VIP recommended version of url_to_postid(). url_to_postid( $url ); // Error. diff --git a/WordPressVIPMinimum/Tests/Functions/RestrictedFunctionsUnitTest.php b/WordPressVIPMinimum/Tests/Functions/RestrictedFunctionsUnitTest.php index bb5236cb..036bd4f7 100644 --- a/WordPressVIPMinimum/Tests/Functions/RestrictedFunctionsUnitTest.php +++ b/WordPressVIPMinimum/Tests/Functions/RestrictedFunctionsUnitTest.php @@ -35,7 +35,6 @@ public function getErrorList() { 43 => 1, 46 => 1, 50 => 1, - 59 => 1, 62 => 1, 75 => 1, 76 => 1, diff --git a/WordPressVIPMinimum/ruleset-test.inc b/WordPressVIPMinimum/ruleset-test.inc index fd0567c6..a20a8494 100644 --- a/WordPressVIPMinimum/ruleset-test.inc +++ b/WordPressVIPMinimum/ruleset-test.inc @@ -322,7 +322,7 @@ $wp_rewrite->flush_rules(); // Error. attachment_url_to_postid( $url ); // Error. switch_to_blog( $blogid ); // Warning. -get_page_by_title( $page_title ); // Error. + url_to_postid( $url ); // Error. \add_role(); // Error. diff --git a/WordPressVIPMinimum/ruleset-test.php b/WordPressVIPMinimum/ruleset-test.php index 71016e82..e78ae6a7 100644 --- a/WordPressVIPMinimum/ruleset-test.php +++ b/WordPressVIPMinimum/ruleset-test.php @@ -92,7 +92,6 @@ 320 => 1, 321 => 1, 322 => 1, - 325 => 1, 326 => 1, 327 => 1, 333 => 1,