Skip to content

Commit

Permalink
Merge pull request #168 from Automattic/vip-go
Browse files Browse the repository at this point in the history
Add the new VIP Go ruleset
  • Loading branch information
sboisvert authored Mar 29, 2018
2 parents 67e4675 + eea7ea2 commit 5017a12
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 1 deletion.
86 changes: 86 additions & 0 deletions WordPress-VIP-Go/ruleset.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0"?>
<ruleset name="WordPress VIP Go">
<description>WordPress VIP Go Coding Standards</description>

<!-- Include the base VIP Minimum ruleset -->
<rule ref="WordPressVIPMinimum" />

<rule ref="WordPress.XSS.EscapeOutput">
<severity>3</severity>
</rule>
<rule ref="WordPress.XSS.EscapeOutput._e">
<severity>1</severity>
</rule>

<rule ref="WordPress.Functions.DontExtract">
<severity>3</severity>
</rule>

<rule ref="WordPress.VIP.RestrictedFunctions.get_posts">
<severity>1</severity>
</rule>

<rule ref="WordPressVIPMinimum.VIP.RestrictedFunctions.file_get_contents">
<severity>3</severity>
</rule>

<rule ref="WordPressVIPMinimum.Files.IncludingFile">
<severity>2</severity>
</rule>

<rule ref="WordPressVIPMinimum.VIP.RestrictedFunctions.get_posts_get_children">
<type>warning</type>
<severity>2</severity>
</rule>
<rule ref="WordPressVIPMinimum.VIP.RestrictedFunctions.get_posts_get_posts">
<type>warning</type>
<severity>2</severity>
</rule>
<rule ref="WordPressVIPMinimum.VIP.RestrictedFunctions.get_posts_wp_get_recent_posts">
<type>warning</type>
<severity>2</severity>
</rule>

<rule ref="WordPressVIPMinimum.VIP.RestrictedFunctions.switch_to_blog_switch_to_blog">
<type>warning</type>
</rule>

<rule ref="WordPress.VIP.SuperGlobalInputUsage.AccessDetected">
<type>warning</type>
</rule>

<rule ref="WordPressVIPMinimum.VIP.RestrictedFunctions.wp_old_slug_redirect_wp_old_slug_redirect">
<type>warning</type>
</rule>

<rule ref="WordPressVIPMinimum.VIP.RestrictedFunctions.get_adjacent_post_get_adjacent_post">
<type>warning</type>
</rule>

<!-- VIP Uncached warnings -->
<rule ref="WordPressVIPMinimum.VIP.RestrictedFunctions.get_page_by_path_get_page_by_path">
<type>warning</type>
<message>%s() is uncached, please use wpcom_vip_get_page_by_path() instead.</message>
</rule>

<rule ref="WordPressVIPMinimum.VIP.RestrictedFunctions.get_page_by_title_get_page_by_title">
<type>warning</type>
<message>%s() is uncached, please use wpcom_vip_get_page_by_title() instead.</message>
</rule>

<rule ref="WordPressVIPMinimum.VIP.RestrictedFunctions.url_to_postid_url_to_postid">
<type>warning</type>
<message>%s() is uncached, please use wpcom_vip_url_to_postid() instead.</message>
</rule>

<rule ref="WordPressVIPMinimum.VIP.RestrictedFunctions.file_get_contents_file_get_contents">
<type>warning</type>
<message>%s() is uncached. If this is being used to query a remote file please use wpcom_vip_file_get_contents() instead.</message>
</rule>

<rule ref="WordPressVIPMinimum.VIP.RestrictedFunctions.attachment_url_to_postid_attachment_url_to_postid">
<type>warning</type>
<message>%s() is uncached, please use wpcom_vip_attachment_url_to_postid() instead.</message>
</rule>

</ruleset>
2 changes: 1 addition & 1 deletion WordPressVIPMinimum/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@
<type>error</type>
<message>`%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.</message>
</rule>
</ruleset>
</ruleset>

0 comments on commit 5017a12

Please sign in to comment.