PluginProbe
Fluent Support – Helpdesk & Customer Support Ticket System / 2.4.5
Fluent Support – Helpdesk & Customer Support Ticket System v2.4.5
2.4.5 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 All 69 releases
← All changes | database/Migrations/MetaMigrator.php +12 -7 2.3.0 → 2.4.5 View file →
@@ -24,9 +24,10 @@
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`)
28 + INDEX `idx_key` (`key`),
29 + INDEX `idx_object_type_created_at` (`object_type`, `created_at`)
29 30 ) $charsetCollate;";
30 31 $created = dbDelta($sql);
31 32 return $created;
32 33 } else {
@@ -59,19 +60,23 @@
59 60 }
60 61
61 62 // Desired indexes — keys and values are all hardcoded string literals.
62 63 $indexes = [
63 - 'idx_object_type' => 'object_type',
64 - 'idx_object_id' => 'object_id',
65 - 'idx_key' => 'key',
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'],
66 70 ];
67 71
68 72 // Add missing indexes. $table is esc_sql()'d above; $index_name and
69 - // $column_name are hardcoded array literals — no user input reaches this query.
70 - foreach ($indexes as $index_name => $column_name) {
73 + // $columns are hardcoded array literals — no user input reaches this query.
74 + foreach ($indexes as $index_name => $columns) {
71 75 if (!in_array($index_name, $existing_index_names)) {
76 + $columnList = '`' . implode('`, `', $columns) . '`';
72 77 // phpcs:ignore PluginCheck.Security.DirectDB.UnescapedDBParameter,WordPress.DB.PreparedSQL.NotPrepared -- all identifiers are either esc_sql()'d or hardcoded literals.
73 - $wpdb->query("ALTER TABLE `{$table}` ADD INDEX `{$index_name}` (`{$column_name}`)");
78 + $wpdb->query("ALTER TABLE `{$table}` ADD INDEX `{$index_name}` ({$columnList})");
74 79 }
75 80 }
76 81 }
77 82 }