prefix . 'mux_caption_queue'; $charset_collate = $wpdb->get_charset_collate(); $safe_table_name = esc_sql($table_name); require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange if ($wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s", $safe_table_name)) != $table_name) { // phpcs:disable WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- plugin activation routine creating its own custom table via dbDelta(). $sql = "CREATE TABLE $table_name ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, upload_id varchar(255) NOT NULL, asset_id varchar(255) DEFAULT NULL, caption_type varchar(50) NOT NULL DEFAULT 'auto', language_code varchar(10) NOT NULL DEFAULT 'en', closed_captions tinyint(1) NOT NULL DEFAULT 0, caption_file_path varchar(255) DEFAULT NULL, caption_file_url varchar(255) DEFAULT NULL, status varchar(50) NOT NULL DEFAULT 'pending', created_at datetime NOT NULL, updated_at datetime NOT NULL, error_message text DEFAULT NULL, attempts smallint(5) unsigned NOT NULL DEFAULT 0, PRIMARY KEY (id), KEY upload_id (upload_id), KEY asset_id (asset_id), KEY status (status) ) $charset_collate;"; $result = dbDelta( $sql ); // phpcs:enable return $result; } return false; }