PluginProbe
Fluent Support – Helpdesk & Customer Support Ticket System / 2.1.0
Fluent Support – Helpdesk & Customer Support Ticket System v2.1.0
2.4.0 2.3.2 2.3.1 2.3.0 2.2.1 2.2.0 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.4.0 1.4.1 1.4.2 1.4.5 1.4.6 1.4.7 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 All 68 releases
← All changes | database/Migrations/MetaMigrator.php +7 -12 trunk2.1.0 View file →
@@ -24,10 +24,9 @@
24 24 `created_at` TIMESTAMP NULL,
25 25 `updated_at` TIMESTAMP NULL,
26 26 INDEX `idx_object_type` (`object_type`),
27 27 INDEX `idx_object_id` (`object_id`),
28 - INDEX `idx_key` (`key`),
29 - INDEX `idx_object_type_created_at` (`object_type`, `created_at`)
28 + INDEX `idx_key` (`key`)
30 29 ) $charsetCollate;";
31 30 $created = dbDelta($sql);
32 31 return $created;
33 32 } else {
@@ -60,23 +59,19 @@
60 59 }
61 60
62 61 // Desired indexes — keys and values are all hardcoded string literals.
63 62 $indexes = [
64 - 'idx_object_type' => ['object_type'],
65 - 'idx_object_id' => ['object_id'],
66 - 'idx_key' => ['key'],
67 - // Serves CleanupHandler::cleanExpiredAuthChallenges(), which purges
68 - // rows by object_type + created_at on every hourly cron run.
69 - 'idx_object_type_created_at' => ['object_type', 'created_at'],
63 + 'idx_object_type' => 'object_type',
64 + 'idx_object_id' => 'object_id',
65 + 'idx_key' => 'key',
70 66 ];
71 67
72 68 // Add missing indexes. $table is esc_sql()'d above; $index_name and
73 - // $columns are hardcoded array literals — no user input reaches this query.
74 - foreach ($indexes as $index_name => $columns) {
69 + // $column_name are hardcoded array literals — no user input reaches this query.
70 + foreach ($indexes as $index_name => $column_name) {
75 71 if (!in_array($index_name, $existing_index_names)) {
76 - $columnList = '`' . implode('`, `', $columns) . '`';
77 72 // phpcs:ignore PluginCheck.Security.DirectDB.UnescapedDBParameter,WordPress.DB.PreparedSQL.NotPrepared -- all identifiers are either esc_sql()'d or hardcoded literals.
78 - $wpdb->query("ALTER TABLE `{$table}` ADD INDEX `{$index_name}` ({$columnList})");
73 + $wpdb->query("ALTER TABLE `{$table}` ADD INDEX `{$index_name}` (`{$column_name}`)");
79 74 }
80 75 }
81 76 }
82 77 }