From 6b5b88b27aea8aa28690971fa0824cdee9fd5507 Mon Sep 17 00:00:00 2001 From: Jack Lenox Date: Tue, 27 Feb 2018 14:16:28 +0000 Subject: [PATCH 1/5] Add severities for certain sniffs --- WordPressVIPMinimum/ruleset.xml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/WordPressVIPMinimum/ruleset.xml b/WordPressVIPMinimum/ruleset.xml index 6a8276ee..b4acbb0f 100644 --- a/WordPressVIPMinimum/ruleset.xml +++ b/WordPressVIPMinimum/ruleset.xml @@ -13,7 +13,12 @@ - + + 3 + + + 1 + @@ -21,7 +26,9 @@ - + + 3 + @@ -114,8 +121,19 @@ %s() is highly discouraged, please use vip_safe_wp_remote_get() instead. + + 1 + + + + 3 + error %1$s() performs a no-LIMIT query by default, make sure to set a reasonable posts_per_page. %1$s() will do a -1 query by default, a maximum of 100 should be used. + + 2 + + From 7ede1d3ef6ef8a724ecb66d39671b7c4bc2b2f11 Mon Sep 17 00:00:00 2001 From: Henrique Mouta Date: Tue, 27 Feb 2018 14:03:18 +0000 Subject: [PATCH 2/5] Changes to the message and error type of several functions --- WordPressVIPMinimum/ruleset.xml | 55 ++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/WordPressVIPMinimum/ruleset.xml b/WordPressVIPMinimum/ruleset.xml index 6a8276ee..9f66517f 100644 --- a/WordPressVIPMinimum/ruleset.xml +++ b/WordPressVIPMinimum/ruleset.xml @@ -114,8 +114,61 @@ %s() is highly discouraged, please use vip_safe_wp_remote_get() instead. + - error + warning %1$s() performs a no-LIMIT query by default, make sure to set a reasonable posts_per_page. %1$s() will do a -1 query by default, a maximum of 100 should be used. + 2 + + + warning + 2 + + + warning + 2 + + + + warning + + + + warning + + + + + warning + %s() is uncached, please use wpcom_vip_get_page_by_path() instead. + + + + warning + %s() is uncached, please use wpcom_vip_get_page_by_title() instead. + + + warning + %s() is uncached, please use wpcom_vip_url_to_postid() instead. + + + + warning + %s() is uncached. If this is being used to query a remote file please use wpcom_vip_file_get_contents() instead. + + + + warning + %s() is uncached, please use wpcom_vip_attachment_url_to_postid() instead. + + + + warning + + + + warning + + From 81cfda803573de12465d475e58220dc53b2fa256 Mon Sep 17 00:00:00 2001 From: Henrique Mouta Date: Tue, 27 Feb 2018 14:39:59 +0000 Subject: [PATCH 3/5] Including missing tag. --- WordPressVIPMinimum/ruleset.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/WordPressVIPMinimum/ruleset.xml b/WordPressVIPMinimum/ruleset.xml index 75b49140..41cb2284 100644 --- a/WordPressVIPMinimum/ruleset.xml +++ b/WordPressVIPMinimum/ruleset.xml @@ -187,5 +187,6 @@ warning + From 7c515a953c15fc7ee7df9483d00ca6e2d8be5c05 Mon Sep 17 00:00:00 2001 From: Henrique Mouta Date: Wed, 7 Mar 2018 14:53:05 +0000 Subject: [PATCH 4/5] Resetting WordPressVIPMinimum ruleset.xml to the original --- WordPressVIPMinimum/ruleset.xml | 79 ++------------------------------- 1 file changed, 4 insertions(+), 75 deletions(-) diff --git a/WordPressVIPMinimum/ruleset.xml b/WordPressVIPMinimum/ruleset.xml index 41cb2284..9155dc77 100644 --- a/WordPressVIPMinimum/ruleset.xml +++ b/WordPressVIPMinimum/ruleset.xml @@ -13,12 +13,7 @@ - - 3 - - - 1 - + @@ -26,9 +21,7 @@ - - 3 - + @@ -121,72 +114,8 @@ %s() is highly discouraged, please use vip_safe_wp_remote_get() instead. - - 1 - - - - 3 - - - - 2 - - - warning + error %1$s() performs a no-LIMIT query by default, make sure to set a reasonable posts_per_page. %1$s() will do a -1 query by default, a maximum of 100 should be used. - 2 - - - warning - 2 - - - warning - 2 - - - - warning - - - - warning - - - - - warning - %s() is uncached, please use wpcom_vip_get_page_by_path() instead. - - - - warning - %s() is uncached, please use wpcom_vip_get_page_by_title() instead. - - - - warning - %s() is uncached, please use wpcom_vip_url_to_postid() instead. - - - - warning - %s() is uncached. If this is being used to query a remote file please use wpcom_vip_file_get_contents() instead. - - - warning - %s() is uncached, please use wpcom_vip_attachment_url_to_postid() instead. - - - - warning - - - - warning - - - + \ No newline at end of file From 8a3d87afc536e56bc4dd0a8c0e4913b07257952a Mon Sep 17 00:00:00 2001 From: Henrique Mouta Date: Wed, 7 Mar 2018 14:53:36 +0000 Subject: [PATCH 5/5] Add new WordPress-VIP-Go ruleset with different levels of severity, error type, and different messages. --- WordPress-VIP-Go/ruleset.xml | 86 ++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 WordPress-VIP-Go/ruleset.xml diff --git a/WordPress-VIP-Go/ruleset.xml b/WordPress-VIP-Go/ruleset.xml new file mode 100644 index 00000000..6753bfe7 --- /dev/null +++ b/WordPress-VIP-Go/ruleset.xml @@ -0,0 +1,86 @@ + + + WordPress VIP Go Coding Standards + + + + + + 3 + + + 1 + + + + 3 + + + + 1 + + + + 3 + + + + 2 + + + + warning + 2 + + + warning + 2 + + + warning + 2 + + + + warning + + + + warning + + + + warning + + + + warning + + + + + warning + %s() is uncached, please use wpcom_vip_get_page_by_path() instead. + + + + warning + %s() is uncached, please use wpcom_vip_get_page_by_title() instead. + + + + warning + %s() is uncached, please use wpcom_vip_url_to_postid() instead. + + + + warning + %s() is uncached. If this is being used to query a remote file please use wpcom_vip_file_get_contents() instead. + + + + warning + %s() is uncached, please use wpcom_vip_attachment_url_to_postid() instead. + + +