true, 'exclude_from_search' => false ], 'objects' ); $sync_rows = []; $any_unsynced = false; foreach ( $post_types as $slug => $obj ) { $total = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->posts} WHERE post_status = 'publish' AND post_type = %s", $slug ) ); if ( 0 === $total ) continue; $synced = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT p.ID) FROM {$wpdb->posts} p INNER JOIN {$wpdb->postmeta} pm ON pm.post_id = p.ID WHERE p.post_status = 'publish' AND p.post_type = %s AND pm.meta_key = '_ai_search_embedding'", $slug ) ); $pending = max( 0, $total - $synced ); if ( $pending > 0 ) $any_unsynced = true; $sync_rows[] = [ 'slug' => $slug, 'label' => $obj->labels->name ?: $slug, 'total' => $total, 'synced' => $synced, 'pending' => $pending, ]; } $current_threshold = (float) get_option( 'ai_search_similarity_threshold', 0.30 ); $ajax_nonce = wp_create_nonce( 'ai_search_test_query' ); $ajax_url = admin_url( 'admin-ajax.php' ); $indexing_url = admin_url( 'admin.php?page=ai-search&tab=indexing' ); ?>

() / 0 ) : ?> ✓ 0 ) : ?>