diff --git a/WordPress/Sniffs/VIP/RestrictedFunctionsSniff.php b/WordPress/Sniffs/VIP/RestrictedFunctionsSniff.php index 41914ec235..c1b768b157 100644 --- a/WordPress/Sniffs/VIP/RestrictedFunctionsSniff.php +++ b/WordPress/Sniffs/VIP/RestrictedFunctionsSniff.php @@ -63,13 +63,11 @@ public function getGroups() { ), ), - 'get_term_link' => array( + 'wpcom_vip_get_term_link' => array( 'type' => 'error', - 'message' => '%s() is prohibited, please use wpcom_vip_get_term_link() instead.', + 'message' => '%s() is deprecated, please use get_term_link(), get_tag_link(), or get_category_link() instead.', 'functions' => array( - 'get_term_link', - 'get_tag_link', - 'get_category_link', + 'wpcom_vip_get_term_link', ), ), @@ -89,20 +87,19 @@ public function getGroups() { ), ), - 'get_term_by' => array( + 'wpcom_vip_get_term_by' => array( 'type' => 'error', - 'message' => '%s() is prohibited, please use wpcom_vip_get_term_by() instead.', + 'message' => '%s() is deprecated, please use get_term_by() or get_cat_ID() instead.', 'functions' => array( - 'get_term_by', - 'get_cat_ID', + 'wpcom_vip_get_term_by', ), ), - 'get_category_by_slug' => array( + 'wpcom_vip_get_category_by_slug' => array( 'type' => 'error', - 'message' => '%s() is prohibited, please use wpcom_vip_get_category_by_slug() instead.', + 'message' => '%s() is deprecated, please use get_category_by_slug() instead.', 'functions' => array( - 'get_category_by_slug', + 'wpcom_vip_get_category_by_slug', ), ), diff --git a/WordPress/Tests/VIP/RestrictedFunctionsUnitTest.inc b/WordPress/Tests/VIP/RestrictedFunctionsUnitTest.inc index 2d2982c47a..8a8b2420a9 100644 --- a/WordPress/Tests/VIP/RestrictedFunctionsUnitTest.inc +++ b/WordPress/Tests/VIP/RestrictedFunctionsUnitTest.inc @@ -31,24 +31,24 @@ $y = Bar::add_role(); // Ok. \add_role(); // Error. -get_term_link( $term ); // Error. +wpcom_vip_get_term_link( $term ); // Error. get_page_by_path( $path ); // Error. get_page_by_title( $page_title ); // Error. -get_term_by( $field, $value, $taxonomy ); // Error. +wpcom_vip_get_term_by( $field, $value, $taxonomy ); // Error. -get_category_by_slug( $slug ); // Error. +wpcom_vip_get_category_by_slug( $slug ); // Error. url_to_postid( $url ); // Error. attachment_url_to_postid( $url ); // Error. wpcom_vip_attachment_url_to_postid( $url ); // Ok. -get_tag_link(); // Error. -get_category_link(); // Error. -get_cat_ID(); // Error. +get_tag_link(); // Ok. +get_category_link(); // Ok. +get_cat_ID(); // Ok. url_to_post_id(); // Error. get_posts(); // Warning. diff --git a/WordPress/Tests/VIP/RestrictedFunctionsUnitTest.php b/WordPress/Tests/VIP/RestrictedFunctionsUnitTest.php index 341e85e9e0..9853667bda 100644 --- a/WordPress/Tests/VIP/RestrictedFunctionsUnitTest.php +++ b/WordPress/Tests/VIP/RestrictedFunctionsUnitTest.php @@ -38,9 +38,6 @@ public function getErrorList() { 42 => 1, 44 => 1, 46 => 1, - 49 => 1, - 50 => 1, - 51 => 1, 52 => 1, 62 => 1, 63 => 1,