$aieo_connector_open ? 'outline' : 'primary', 'type' => 'submit', 'attrs' => array('form' => 'aieo-rooster-signup-form', 'data-aieo-signup-submit' => '1', 'hidden' => true)) ) . ' ' . $aieo_connector_footer; } elseif ($aieo_is_rooster_connected) { $aieo_copy_notice_early = class_exists('AIEO_Rooster_Signup') ? AIEO_Rooster_Signup::copy_notice() : ''; $aieo_pro_footer = \Rooster\Admin\Ui::button( __('Manage your Pro subscription →', 'ai-eshop-optimizer'), array('variant' => 'primary', 'href' => 'https://rooster.systems/get-rooster-one-pro/?utm_source=woo&utm_medium=plugin&utm_campaign=subscription', 'external' => true) ) . ' ' . $aieo_connector_footer . ' ' . \Rooster\Admin\Ui::button( __('Disconnect this site', 'ai-eshop-optimizer'), array('type' => 'submit', 'attrs' => array('form' => 'aieo-rooster-disconnect-form') + \Rooster\Admin\States::confirm_attrs('aieo-rooster-disconnect-confirm')) ) . ('' !== $aieo_copy_notice_early ? ' ' . \Rooster\Admin\Ui::button(__('This is a copy — detach it', 'ai-eshop-optimizer'), array('type' => 'submit', 'attrs' => array('form' => 'aieo-rooster-detach-copy-form') + \Rooster\Admin\States::confirm_attrs('aieo-rooster-detach-confirm'))) : ''); } list($aieo_pro_open, $aieo_pro_close) = AIEO_DMM_UI::card(array( 'anchor' => $aieo_is_rooster_connected ? 'pro-active' : 'get-pro', 'icon' => $aieo_is_rooster_connected ? 'circle-check' : 'rocket', 'title' => $aieo_is_rooster_connected ? __('Rooster One Pro is active', 'ai-eshop-optimizer') : __('Rooster One Pro trial', 'ai-eshop-optimizer'), 'description' => $aieo_is_rooster_connected ? __('This site\'s Rooster One Pro subscription: its plan, its standing and the way to disconnect it.', 'ai-eshop-optimizer') : __('What Rooster One Pro adds, and how to start its trial on this site.', 'ai-eshop-optimizer'), 'footer' => $aieo_pro_footer, )); echo $aieo_pro_open; ?>

— true)); ?> true)); ?> — true)); ?> true)); ?> get_modules() as $aieo_pm) { if (method_exists($aieo_pm, 'is_pro_locked') && $aieo_pm->is_pro_locked()) { $aieo_pro_count++; } } } $aieo_pro_count_text = sprintf( _n( 'All %d Pro admin feature is unlocked on this site. Anthropic chat + Voyage embeddings are proxied through rooster.systems and metered against your AI Credits subscription.', 'All %d Pro admin features are unlocked on this site. Anthropic chat + Voyage embeddings are proxied through rooster.systems and metered against your AI Credits subscription.', $aieo_pro_count, 'ai-eshop-optimizer' ), (int) $aieo_pro_count ); echo \Rooster\Admin\Guidance::text($aieo_pro_count_text); ?>
' . esc_html__('Disconnect this site from its Rooster account? Only this site\'s local connection is removed — your account, sites and subscriptions at rooster.systems stay untouched.', 'ai-eshop-optimizer') . '

', array('confirm' => __('Disconnect this site', 'ai-eshop-optimizer')) ); echo $aieo_disconnect_ask; ?> __('This looks like a copy of another site', 'ai-eshop-optimizer'), 'inline' => true, ) ); echo $aieo_copy_html . $aieo_copy_form; $aieo_detach_ask = \Rooster\Admin\States::confirm( 'aieo-rooster-detach-confirm', 'off', __('Detach this copy?', 'ai-eshop-optimizer'), '

' . esc_html__('Detach this copy? It gives up the key and the licence identity it inherited, and becomes its own install. Your live site, your account and your subscriptions at rooster.systems are not touched.', 'ai-eshop-optimizer') . '

', array('confirm' => __('This is a copy — detach it', 'ai-eshop-optimizer')) ); echo $aieo_detach_ask; ?>

' . esc_html((string) ($aieo_signup_approval['partner'] ?? '')) . '', '' . esc_html($aieo_signup_email) . '' ); ?>

' . esc_html($aieo_signup_email) . '', $aieo_trial_days > 0 ? esc_html(sprintf(__('%d-day', 'ai-eshop-optimizer'), $aieo_trial_days)) : esc_html__('free', 'ai-eshop-optimizer') ); ?>

' . esc_html($aieo_code_unknown) . '' ); ?> true, 'attrs' => array('data-aieo-code-unknown' => $aieo_code_unknown))); ?> ' . ( $aieo_signup_approval ? esc_html__('Waiting for the account manager to approve…', 'ai-eshop-optimizer') : esc_html__('Waiting for you to confirm…', 'ai-eshop-optimizer') ) . '', 'mono', array('inline' => true, 'id' => 'aieo-signup-wait') ); ?>

'ghost', 'size' => 'sm', 'type' => 'submit', 'attrs' => array('form' => 'aieo-signup-cancel-form'))); ?>.

get_modules() as $aieo_pm) { if (method_exists($aieo_pm, 'is_pro_locked') && $aieo_pm->is_pro_locked()) { $aieo_pro_locked_count++; } } } $aieo_price = class_exists('AIEO_DMM_Subscription') ? AIEO_DMM_Subscription::price_label() : ''; if ($aieo_pro_locked_count > 0) { $aieo_pitch = sprintf( _n( 'Rooster One Pro (%1$s after the trial) unlocks %2$d more admin screen — every one of them listed above, with what it does.', 'Rooster One Pro (%1$s after the trial) unlocks %2$d more admin screens — every one of them listed above, with what it does.', $aieo_pro_locked_count, 'ai-eshop-optimizer' ), $aieo_price, (int) $aieo_pro_locked_count ); } else { $aieo_pitch = sprintf( __('Rooster One Pro (%s after the trial) unlocks the Pro admin screens, listed above with what each one does.', 'ai-eshop-optimizer'), $aieo_price ); } $aieo_credits = __('Includes AI Credits bundled in. AI features work the moment you connect — no separate purchase, no card needed for the trial.', 'ai-eshop-optimizer'); if (class_exists('\Rooster\Admin\Guidance')) { echo \Rooster\Admin\Guidance::text($aieo_pitch, 'essential'); echo \Rooster\Admin\Guidance::text($aieo_credits, 'essential', array('html' => '' . esc_html($aieo_credits) . '')); } else { echo '

' . esc_html($aieo_pitch) . '

' . esc_html($aieo_credits) . '

'; } ?>
'aieo-signup-email', 'label' => __('Email', 'ai-eshop-optimizer'), 'required' => true, 'control' => \Rooster\Admin\Ui::input('aieo_signup_email', '', array('type' => 'email', 'id' => 'aieo-signup-email', 'required' => true, 'autocomplete' => 'email', 'medium' => true, 'placeholder' => 'you@company.com', 'attrs' => array('spellcheck' => 'false'))), )); $aieo_signup_rows .= \Rooster\Admin\Ui::field_row(array( 'id' => 'aieo-signup-first', 'label' => __('First name', 'ai-eshop-optimizer'), 'required' => true, 'control' => \Rooster\Admin\Ui::input('aieo_signup_first', '', array('id' => 'aieo-signup-first', 'required' => true, 'autocomplete' => 'given-name', 'maxlength' => '120', 'medium' => true)), )); $aieo_signup_rows .= \Rooster\Admin\Ui::field_row(array( 'id' => 'aieo-signup-last', 'label' => __('Surname', 'ai-eshop-optimizer'), 'required' => true, 'control' => \Rooster\Admin\Ui::input('aieo_signup_last', '', array('id' => 'aieo-signup-last', 'required' => true, 'autocomplete' => 'family-name', 'maxlength' => '120', 'medium' => true)), )); $aieo_signup_rows .= \Rooster\Admin\Ui::field_row(array( 'id' => 'aieo-signup-company', 'label' => __('Company', 'ai-eshop-optimizer'), 'required' => true, 'control' => \Rooster\Admin\Ui::input('aieo_signup_company', '', array('id' => 'aieo-signup-company', 'required' => true, 'autocomplete' => 'organization', 'maxlength' => '191', 'medium' => true)), )); $aieo_declared_code = class_exists('AIEO_Rooster_Signup') ? AIEO_Rooster_Signup::declared_partner_code() : ''; if ('' === $aieo_declared_code) { $aieo_signup_rows .= \Rooster\Admin\Ui::field_row(array( 'id' => 'aieo-signup-code', 'label' => __('Partner code (optional)', 'ai-eshop-optimizer'), 'control' => \Rooster\Admin\Ui::input('aieo_signup_code', '', array('id' => 'aieo-signup-code', 'autocomplete' => 'off', 'maxlength' => '40', 'short' => true, 'code' => true)), )); } echo '
' . $aieo_signup_rows . '
'; ?>

' . esc_html($aieo_declared_code) . '' ); ?>

'aieo-signup-fold')); ?>

'remote-transfer', 'icon' => 'arrow-right-left', 'title' => __('Remote Transfer', 'ai-eshop-optimizer'), 'description' => __('Sends the shop\'s orders to our servers for the relationship analysis a shop\'s own hosting cannot run.', 'ai-eshop-optimizer'), 'footer' => \Rooster\Admin\Ui::button( __('Remote Transfer of Orders', 'ai-eshop-optimizer'), array('variant' => 'primary', 'type' => 'submit', 'disabled' => 'Pro' !== $aieo_account_type, 'attrs' => array('form' => 'aieo-remote-transfer-form'), 'reason' => 'Pro' !== $aieo_account_type ? __('Only a Pro account can transfer orders.', 'ai-eshop-optimizer') : '') ), )); echo $aieo_pro_open; ?>
'aieo-rooster-delta-job', 'state' => 'idle', 'run' => __('Sync New Orders', 'ai-eshop-optimizer'), 'primary' => false, 'run_attrs' => array('id' => 'aieo-rooster-transfer-btn'), )); $aieo_rt_full = \Rooster\Admin\States::job(array( 'id' => 'aieo-rooster-full-job', 'state' => 'idle', 'run' => __('Full Sync (replace all)', 'ai-eshop-optimizer'), 'primary' => false, 'run_attrs' => array('id' => 'aieo-rooster-full-sync-btn'), 'confirm' => 'aieo-rooster-full-confirm', )); echo '
' . $aieo_rt_delta . '
' . $aieo_rt_full . '
'; $aieo_rt_pause = \Rooster\Admin\Ui::button(__('Pause', 'ai-eshop-optimizer'), array('size' => 'sm', 'attrs' => array('id' => 'aieo-rooster-pause', 'hidden' => true))); $aieo_rt_stop = \Rooster\Admin\Ui::button(__('Stop', 'ai-eshop-optimizer'), array('size' => 'sm', 'icon' => 'square', 'attrs' => array('id' => 'aieo-rooster-stop', 'hidden' => true))); echo '

' . $aieo_rt_pause . ' ' . $aieo_rt_stop . '

'; $last_sync = get_option('aieo_rooster_last_sync'); if ($last_sync) { $aieo_rt_last = \Rooster\Admin\States::result_head(trim(__('Last sync: ', 'ai-eshop-optimizer')), array('after' => (string) $last_sync)); echo $aieo_rt_last; } global $wpdb; $aieo_rt_prev = $wpdb->suppress_errors(true); $aieo_rt_orders = (int) $wpdb->get_var('SELECT COUNT(*) FROM `' . $wpdb->prefix . 'aieo_temp_orders`'); $wpdb->suppress_errors($aieo_rt_prev); $aieo_rt_full_ask = \Rooster\Admin\States::confirm( 'aieo-rooster-full-confirm', 'replace', __('Run a full sync?', 'ai-eshop-optimizer'), '

' . sprintf( esc_html__('This will delete all existing data on the Hub and re-transfer all %s orders. Continue?', 'ai-eshop-optimizer'), esc_html(number_format_i18n($aieo_rt_orders)) ) . '

', array('confirm' => __('Full Sync (replace all)', 'ai-eshop-optimizer')) ); echo $aieo_rt_full_ask; $aieo_rt_stop_ask = \Rooster\Admin\States::confirm( 'aieo-rooster-stop-confirm', 'reset', __('Stop the transfer?', 'ai-eshop-optimizer'), '

' . esc_html__('Stop the transfer? Data already sent will be kept.', 'ai-eshop-optimizer') . '

', array('confirm' => __('Stop', 'ai-eshop-optimizer')) ); echo $aieo_rt_stop_ask; ?>