get_quota_info(); $sub_plan = is_array( $sub_quota ) && isset( $sub_quota['plan'] ) ? $sub_quota['plan'] : null; $sub_sub = is_array( $sub_quota ) && isset( $sub_quota['subscription'] ) ? $sub_quota['subscription'] : null; $plan_key = is_array( $sub_plan ) && isset( $sub_plan['key'] ) ? (string) $sub_plan['key'] : 'free'; $plan_label = is_array( $sub_plan ) && isset( $sub_plan['label'] ) ? (string) $sub_plan['label'] : ucfirst( $plan_key ); $is_paid = ( 'free' !== $plan_key ) && is_array( $sub_sub ); // Auto-dismiss the reindex reminder once every indexed post is on the // paid model. Same guard as before; cheap indexed COUNT(*). if ( $is_paid && get_option( 'ai_search_upgrade_pending_reindex', false ) ) { global $wpdb; $ais_needs_regen = (int) $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->postmeta} pm LEFT JOIN {$wpdb->postmeta} mm ON mm.post_id = pm.post_id AND mm.meta_key = '_ai_search_embedding_model' WHERE pm.meta_key = '_ai_search_embedding' AND ( mm.meta_value IS NULL OR mm.meta_value != 'text-embedding-3-large' )" ); if ( 0 === $ais_needs_regen ) { delete_option( 'ai_search_upgrade_pending_reindex' ); } } if ( $is_paid && get_option( 'ai_search_upgrade_pending_reindex', false ) ) : ?>

' . esc_html__( 'This site is back on the Free plan. Paste the same activation key on another WordPress install to use it there.', 'ai-search' ) . '

'; } $claim_error = get_transient( 'ai_search_claim_error' ); if ( $claim_error && is_array( $claim_error ) ) { delete_transient( 'ai_search_claim_error' ); echo '

' . esc_html__( 'Activation failed.', 'ai-search' ) . ' ' . esc_html( $claim_error['message'] ) . '

'; } ?>
__( 'monthly', 'ai-search' ), 'annual' => __( 'annual', 'ai-search' ), ]; ?>

' . esc_html( $period_human ) . '' ); elseif ( $will_cancel && $period_human ) : printf( /* translators: %s: end of billing period */ esc_html__( 'Cancelling - active until %s, then this site drops back to the Free plan.', 'ai-search' ), '' . esc_html( $period_human ) . '' ); elseif ( 'past_due' === $status_key ) : esc_html_e( 'Payment failed on the last charge. Update your card in the billing portal to keep the plan active.', 'ai-search' ); elseif ( $period_human ) : printf( /* translators: 1: 'monthly' or 'annual', 2: next renewal date */ esc_html__( 'Renews %1$s on %2$s.', 'ai-search' ), esc_html( isset( $cycle_labels[ $cycle_key ] ) ? $cycle_labels[ $cycle_key ] : $cycle_key ), '' . esc_html( $period_human ) . '' ); endif; ?>

', '' ); ?>