0, 'pending' => 0, 'is_running' => false, 'last_indexed' => null, ) ); $total_chunks = (int) ( $index_status['total_chunks'] ?? 0 ); $indexed_posts = (int) ( $index_status['indexed_posts'] ?? 0 ); $pending = (int) ( $index_status['pending'] ?? 0 ); $is_running = (bool) ( $index_status['is_running'] ?? false ); $last_indexed = $index_status['last_indexed'] ?? null; // Processing mode (frontend = this page drives the queue; background = the // server drives itself via loopback requests + WP-Cron). $indexing_mode = (string) Attendant_Plugin::get_setting( 'indexing_mode', 'frontend' ); // Initial activity log entries (JS refreshes these live). $initial_activity = ATTENDANT_Index_Manager::get_activity(); // Count failed queue items for the warning display. global $wpdb; $failed_count = (int) $wpdb->get_var( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching "SELECT COUNT(*) FROM `{$wpdb->prefix}attendant_queue` WHERE status = 'failed'" ); // Count the total posts across all configured post types (for context). $configured_types = (array) Attendant_Plugin::get_setting( 'index_post_types', array( 'post', 'page' ) ); $total_posts = 0; foreach ( $configured_types as $pt ) { $total_posts += ATTENDANT_Content_Fetcher::count_published( sanitize_key( (string) $pt ) ); } ?>

0 ) : ?>

 

>

>