prefix . 'aicom_backups'; // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter $count_sql = "SELECT COUNT(*) FROM $table WHERE $where_sql"; // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter $total = empty( $params ) ? (int) $wpdb->get_var( $count_sql ) : (int) $wpdb->get_var( $wpdb->prepare( $count_sql, ...$params ) ); $data_params = array_merge( $params, [ $per_page, $offset ] ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter $data_sql = "SELECT id, created_at, tool_name, target_type, target_id, manifest_json FROM $table WHERE $where_sql ORDER BY created_at DESC LIMIT %d OFFSET %d"; // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter $backups = $wpdb->get_results( $wpdb->prepare( $data_sql, ...$data_params ), ARRAY_A ); $num_pages = (int) ceil( $total / $per_page ); $type_options = [ '' => __( 'All Types', 'aicom' ), 'post' => __( 'Post', 'aicom' ), 'term' => __( 'Term', 'aicom' ), 'elementor_page' => __( 'Elementor Page', 'aicom' ), ]; ?>