Skip to content

Commit e1eb7c9

Browse files
authored
Merge pull request #692 from Automattic/remove/dbDelta
Remove dbDelta Warning
2 parents f6a4a16 + 75ece92 commit e1eb7c9

File tree

8 files changed

+5
-19
lines changed

8 files changed

+5
-19
lines changed

WordPress-VIP-Go/ruleset-test.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ filter_var_array( $array, FILTER_SANITIZE_STRING ); // Ok.
111111
filter_input_array( $array,FILTER_SANITIZE_STRING ); // Ok.
112112
filter_input( INPUT_GET, 'foo', FILTER_DEFAULT ); // Warning.
113113

114-
// WordPressVIPMinimum.Functions.RestrictedFunctions.dbDelta_dbdelta
115-
dbDelta( $query, true ); // Warning.
114+
115+
116116

117117
// WordPressVIPMinimum.Functions.RestrictedFunctions.wp_mail_wp_mail
118118
wp_mail(); // Warning.

WordPress-VIP-Go/ruleset-test.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@
147147
108 => 1,
148148
109 => 1,
149149
112 => 1,
150-
115 => 1,
151150
118 => 1,
152151
119 => 1,
153152
123 => 1,

WordPress-VIP-Go/ruleset.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,6 @@
132132
<rule ref="WordPressVIPMinimum.Security.PHPFilterFunctions">
133133
<severity>10</severity>
134134
</rule>
135-
<rule ref="WordPressVIPMinimum.Functions.RestrictedFunctions.dbDelta_dbdelta">
136-
<type>warning</type>
137-
<severity>7</severity>
138-
</rule>
139135
<rule ref="WordPressVIPMinimum.Functions.RestrictedFunctions.wp_mail_wp_mail">
140136
<severity>7</severity>
141137
</rule>

WordPressVIPMinimum/Sniffs/Functions/RestrictedFunctionsSniff.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,6 @@ public function getGroups() {
7474
'attachment_url_to_postid',
7575
],
7676
],
77-
'dbDelta' => [
78-
'type' => 'error',
79-
'message' => 'All database modifications have to approved by the WordPress.com VIP team.',
80-
'functions' => [
81-
'dbDelta',
82-
],
83-
],
8477
// @link https://docs.wpvip.com/technical-references/code-review/vip-notices/#h-switch_to_blog
8578
'switch_to_blog' => [
8679
'type' => 'warning',

WordPressVIPMinimum/Tests/Functions/RestrictedFunctionsUnitTest.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ flush_rules(); // Ok - not in global class.
4949
$wp_write->flush_rules(); // Ok - not in global class $wp_rewrite.
5050
$wp_rewrite->flush_rules(); // Error.
5151

52-
db_delta(); // Ok - similarly-named function to dbDelta().
53-
dbDelta(); // Error.
52+
53+
5454

5555
switch_blog(); // Ok - similarly-named function to switch_to_blog().
5656
switch_to_blog( $blogid ); // Warning.

WordPressVIPMinimum/Tests/Functions/RestrictedFunctionsUnitTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ public function getErrorList() {
3737
43 => 1,
3838
46 => 1,
3939
50 => 1,
40-
53 => 1,
4140
59 => 1,
4241
62 => 1,
4342
75 => 1,

WordPressVIPMinimum/ruleset-test.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ wpcom_vip_irc(); // Error.
320320
flush_rewrite_rules(); // Error.
321321
$wp_rewrite->flush_rules(); // Error.
322322
attachment_url_to_postid( $url ); // Error.
323-
dbDelta(); // Error.
323+
324324
switch_to_blog( $blogid ); // Warning.
325325
get_page_by_title( $page_title ); // Error.
326326
url_to_postid( $url ); // Error.

WordPressVIPMinimum/ruleset-test.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@
9292
320 => 1,
9393
321 => 1,
9494
322 => 1,
95-
323 => 1,
9695
325 => 1,
9796
326 => 1,
9897
327 => 1,

0 commit comments

Comments
 (0)