Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions WordPressVIPMinimum/ruleset-test.inc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ $args = array(
_query_posts( 'posts_per_page=999' ); // Warning.
$query_args['posts_per_page'] = 999; // Warning.

// WordPress.WP.TimezoneChange
// WordPress.DateTime.RestrictedFunctions
date_default_timezone_set( 'FooBar' ); // Error.

// WordPress.DB.PreparedSQL
Expand All @@ -50,10 +50,10 @@ $b = function () {
$listofthings = wp_cache_get( $listofthings );
if ( ! $listofthings ) {
$foo = "column = 'test'";

$listofthings = $wpdb->query( 'SELECT something FROM somewhere WHERE ' . $foo ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery -- Error.
wp_cache_set( 'foo', $listofthings );
}
}
};

// WordPress.DB.DirectDatabaseQuery
Expand Down Expand Up @@ -124,7 +124,7 @@ class TestClass extends MyClass {
?> <?= esc_html( $var ); // Error.

// Squiz.PHP.CommentedOutCode <!-- Warning. -->
// if (empty($this)) {echo 'This is will not work';}
// if (empty($this)) {echo 'This is will not work';}

// Squiz.PHP.Eval
eval('$var = 4;'); // Error + Message.
Expand Down Expand Up @@ -430,7 +430,7 @@ $args = array(
);
$query_args['orderby'] = 'rand'; // Error.

// WordPressVIPMinimum.Performance.RegexpCompare
// WordPressVIPMinimum.Performance.RegexpCompare
$query_args = array(
'posts_per_page' => 1,
'post_status' => 'draft',
Expand Down Expand Up @@ -515,7 +515,7 @@ str_replace( 'foo', array( 'bar', 'foo' ), 'foobar' ); // Error.

// WordPressVIPMinimum.Security.Underscorejs
echo "<script>
_.templateSettings = {
_.templateSettings = {
interpolate: /\{\{(.+?)\}\}/g" . // Warning.
"};
</script>";
Expand Down
2 changes: 1 addition & 1 deletion WordPressVIPMinimum/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<rule ref="WordPress.Security.PluginMenuSlug"/>
<rule ref="WordPress.WP.EnqueuedResources"/>
<rule ref="WordPress.WP.PostsPerPage"/>
<rule ref="WordPress.WP.TimezoneChange"/>
<rule ref="WordPress.DateTime.RestrictedFunctions"/>
<rule ref="WordPress.DB.PreparedSQL"/>
<rule ref="WordPress.DB.DirectDatabaseQuery"/>
<rule ref="WordPress.DB.SlowDBQuery"/>
Expand Down