'unavailable', 'message' => __('License manager is unavailable.', 'ai-flash-tune'), 'data' => []]; $entitled_addons = is_array($status_data['data'] ?? null) ? $status_data['data'] : []; $installed_plugins = get_plugins(); $update_manifest = []; $update_manifest_error = ''; if (class_exists('AIFLT_License_Manager') && method_exists('AIFLT_License_Manager', 'get_update_manifest')) { $update_manifest_response = AIFLT_License_Manager::get_update_manifest(true); // Addon Manager page checks CDN on page open. if (is_wp_error($update_manifest_response)) { $update_manifest_error = $update_manifest_response->get_error_message(); } elseif (is_array($update_manifest_response)) { $update_manifest = $update_manifest_response; } } $all_possible_addons = [ 'ai-flash-tune-ai-action-center' => ['name'=>__('AI Action Center','ai-flash-tune'),'description'=>__('Turns funnel, cart, checkout, product, and speed signals into one prioritized conversion plan.','ai-flash-tune'),'symbol'=>'✦','category'=>__('Conversion command center','ai-flash-tune'),'target_page'=>'aiftac-action-center','buy_url'=>'https://aiflashtune.com/pricing#ai-action-center'], 'ai-flash-tune-product-optimizer' => ['name'=>__('Product Optimizer','ai-flash-tune'),'description'=>__('Diagnose weak product pages, improve copy safely, clarify CTA, and strengthen trust without inventing claims.','ai-flash-tune'),'symbol'=>'↯','category'=>__('Product conversion','ai-flash-tune'),'target_page'=>'aiftpo-product-optimizer','buy_url'=>'https://aiflashtune.com/pricing#product-optimizer'], 'ai-flash-tune-cart-recovery' => ['name'=>__('Cart Recovery & Abandonment Intelligence','ai-flash-tune'),'description'=>__('Review abandoned carts, identify likely reasons, plan recovery messages, and protect revenue.','ai-flash-tune'),'symbol'=>'✉','category'=>__('Cart recovery','ai-flash-tune'),'target_page'=>'aiftcr-recovery-center','buy_url'=>'https://aiflashtune.com/pricing#cart-recovery'], 'ai-flash-tune-checkout-optimizer' => ['name'=>__('Checkout Optimizer','ai-flash-tune'),'description'=>__('Audit checkout friction and safely apply field, trust, and UX improvements with review-first controls.','ai-flash-tune'),'symbol'=>'▰','category'=>__('Checkout friction','ai-flash-tune'),'target_page'=>'aiftco-optimizer-dashboard','buy_url'=>'https://aiflashtune.com/pricing#checkout-optimizer'], 'ai-flash-tune-advanced-segmentation' => ['name'=>__('Advanced Segmentation','ai-flash-tune'),'description'=>__('Compare desktop vs mobile, guest vs registered, product/category behavior, and funnel groups.','ai-flash-tune'),'symbol'=>'◿','category'=>__('Behavior comparison','ai-flash-tune'),'target_page'=>'aiftas-segmentation','buy_url'=>'https://aiflashtune.com/pricing#segmentation'], 'ai-flash-tune-alert-center' => ['name'=>__('Alert Center','ai-flash-tune'),'description'=>__('Track urgent conversion risks such as checkout friction, abandoned-cart pressure, and slow-page warnings.','ai-flash-tune'),'symbol'=>'!','category'=>__('Risk monitoring','ai-flash-tune'),'target_page'=>'aiftal-alert-center','buy_url'=>'https://aiflashtune.com/pricing#alerts'], 'ai-flash-tune-reports' => ['name'=>__('Reports & Exports','ai-flash-tune'),'description'=>__('Export weekly summaries, CSV files, and client-ready performance reports.','ai-flash-tune'),'symbol'=>'≡','category'=>__('Reporting','ai-flash-tune'),'target_page'=>'aiftrp-reports','buy_url'=>'https://aiflashtune.com/pricing#reports'], ]; $license_status = $status_data['status'] ?? 'unavailable'; $license_all_modules = ($license_status === 'success') && (!empty($status_data['all_modules']) || empty($entitled_addons)); if ($license_all_modules) { $entitled_addons = array_fill_keys(array_keys($all_possible_addons), ['enabled' => true, 'source' => 'pro_license']); } function aiflt_addon_card_state($addon_slug, $installed_plugins) { $state = ['installed'=>false,'active'=>false,'plugin_file'=>'','version'=>'']; foreach ($installed_plugins as $file => $details) { if (strpos($file, $addon_slug . '/') === 0) { $state['installed'] = true; $state['plugin_file'] = $file; $state['version'] = $details['Version'] ?? ''; $state['active'] = is_plugin_active($file); break; } } return $state; } $module_states = []; $active_count = 0; $installed_count = 0; $update_available_count = 0; $manifest_products = is_array($update_manifest['products'] ?? null) ? $update_manifest['products'] : []; foreach ($all_possible_addons as $slug => $addon) { $state = aiflt_addon_card_state($slug, $installed_plugins); $release = is_array($manifest_products[$slug] ?? null) ? $manifest_products[$slug] : []; $latest_version = isset($release['latest_version']) ? (string) $release['latest_version'] : ''; $state['latest_version'] = $latest_version; $state['update_available'] = $state['installed'] && $state['version'] !== '' && $latest_version !== '' && version_compare($latest_version, $state['version'], '>'); $state['release'] = $release; $module_states[$slug] = $state; if ($state['installed']) $installed_count++; if ($state['active']) $active_count++; if ($state['update_available']) $update_available_count++; } $total_count = count($all_possible_addons); ?>

i
✓
!
0) : ?>
↑
!

$addon) : ?>