pink gradient, * rounded corners, subtle shadow) with: * * 1. A pill grid, one per post type, showing total + pending counts. * 2. A feature strip summarising auto-detected fields and Woo terms. * 3. A quota row when available. * 4. The "Sync content" gradient pill button. * 5. A hidden circular progress ring that takes over once the button * is pressed. The ring re-uses the same card - no reflow, the * button just hides and the ring fades in. * 6. A "done" state with a check-mark animation and CTAs. * * Variables in scope from display_wizard_page(): * $scan - result of AI_Search_Setup_Wizard::scan_content() * $is_woo - class_exists( 'WooCommerce' ) */ if ( ! defined( 'ABSPATH' ) ) exit; require_once plugin_dir_path( dirname( dirname( __FILE__ ) ) ) . 'class-quota-manager.php'; $quota_manager = new AI_Search_Quota_Manager(); $quota = $quota_manager->get_quota_data(); $provider = get_option( 'ai_search_provider', 'ai_service' ); $is_openai = ( $provider === 'openai' ); $quota_is_known = is_array( $quota ); $pending_total = intval( $scan['pending'] ); $total = intval( $scan['total'] ); $already = max( 0, $total - $pending_total ); $advanced_url = admin_url( 'admin.php?page=ai-search&tab=content' ); $test_url = admin_url( 'admin.php?page=ai-search&tab=test' ); // Total custom field count across all post types, for the summary line. $field_count = 0; foreach ( $scan['post_types'] as $meta ) { $field_count += count( $meta['fields'] ); } $daily_exhausted = false; if ( $quota_is_known ) { $daily_used = intval( $quota['daily_usage'] ); $daily_limit = intval( $quota['daily_limit'] ); $daily_left = max( 0, $daily_limit - $daily_used ); $daily_exhausted = ! empty( $quota['daily_quota_exceeded'] ); $total_left = max( 0, intval( $quota['total_embeddings_limit'] ) - intval( $quota['total_embeddings_used'] ) ); } ?>
0 ) : ?>

' . number_format_i18n( $total ) . '' ); ?>

$meta ) : $preview_fields = array_slice( $meta['fields'], 0, 4 ); $more_fields = max( 0, count( $meta['fields'] ) - count( $preview_fields ) ); ?>
✓
0 ) { /* translators: %s: number of items pending sync */ printf( esc_html__( '%s pending', 'ai-search' ), number_format_i18n( $meta['pending'] ) ); } else { esc_html_e( 'already synced', 'ai-search' ); } ?>
0 /
0 ) : ?> +
0 ) : ?>

' . number_format_i18n( $total_left ) . '', '' . number_format_i18n( $daily_left ) . '' ); ?>

✨

0%
0 /
✓

0 ) : ?>