# mxchat-basic/3.2.1/includes/class-mxchat-addons.php

MxChat – AI Chatbot &amp; Content Generation for WordPress, version 3.2.1. 681 lines.

- Page: https://pluginprobe.com/plugins/mxchat-basic/3.2.1/code/includes/class-mxchat-addons.php
- Raw: https://pluginprobe.com/plugins/mxchat-basic/3.2.1/raw/includes/class-mxchat-addons.php
- Modified: 2026-04-17T12:55:44+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/mxchat-basic/3.2.1/code/includes/class-mxchat-addons.php#L10-L20`.

```php
<?php
/**
 * The admin-specific functionality for the Add Ons page.
 *
 * @package    MxChat
 * @subpackage MxChat/admin
 */
class MxChat_Addons {
    /**
     * Store add-on configuration data
     *
     * @var array
     */
    private $addons_config;

    /**
     * Initialize the class and set its properties.
     */
    public function __construct() {
        $this->addons_config = array(

            'mxchat-advanced-content' => array(
                'title' => __('MxChat Advanced Content Editor', 'mxchat'),
                'sidebar_title' => __('Content Gen.', 'mxchat'),
                'description' => __('Supercharge your AI content generation workflow. Add advanced editing tools, image management, SEO meta controls, and internal linking to the MxChat Content Generator—turning simple prompts into publish-ready posts and landing pages.', 'mxchat'),
                'key_benefits' => array(
                    __('AI-powered image regeneration & uploads', 'mxchat'),
                    __('SEO meta title, description & excerpt editor', 'mxchat'),
                    __('Automatic internal linking between posts', 'mxchat')
                ),
                'license' => 'MxChat PRO',
                'accent' => '#6366f1',
                'url' => 'https://mxchat.ai/documentation-bot/',
                'download_url' => 'https://mxchat.ai/advanced-content-editor/',
                'plugin_file' => 'mxchat-advanced-content/mxchat-advanced-content.php',
                'config_page' => 'mxchat-content',
                'hero_features' => array(
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>',
                        'title' => __('Image Management', 'mxchat'),
                        'desc' => __('Regenerate, upload, and swap AI images', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>',
                        'title' => __('SEO Meta Editor', 'mxchat'),
                        'desc' => __('Title, description & excerpt controls', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg>',
                        'title' => __('Internal Linking', 'mxchat'),
                        'desc' => __('Auto-link to related posts & pages', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z"/></svg>',
                        'title' => __('Chat-Based Editing', 'mxchat'),
                        'desc' => __('Refine content through conversation', 'mxchat'),
                    ),
                ),
            ),

            'mxchat-theme' => array(
                'title' => __('MxChat Chat Themes', 'mxchat'),
                'description' => __('Make your chatbot uniquely yours. Generate beautiful themes instantly using simple descriptions or customize manually with precise color controls—zero coding required. Perfect for matching your brand identity.', 'mxchat'),
                'key_benefits' => array(
                    __('AI-powered theme generator', 'mxchat'),
                    __('Live preview customizer', 'mxchat'),
                    __('One-click theme application', 'mxchat')
                ),
                'license' => 'MxChat PRO',
                'accent' => '#fa73e6',
                'url' => 'https://mxchat.ai/ai-theme-customizer/',
                'plugin_file' => 'mxchat-theme/mxchat-theme.php',
                'config_page' => 'mxchat-theme-settings',
                'hero_features' => array(
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="13.5" cy="6.5" r="2.5"/><path d="M17.5 10.5l4-4"/><circle cx="6" cy="12" r="2"/><path d="M2 14l2-2"/><circle cx="10.5" cy="17.5" r="2.5"/><path d="M14 21l-1-3"/></svg>',
                        'title' => __('AI Theme Generator', 'mxchat'),
                        'desc' => __('Describe your style, AI creates it', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M3 9h18"/><path d="M9 21V9"/></svg>',
                        'title' => __('Live Preview', 'mxchat'),
                        'desc' => __('See changes in real-time', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2v4"/><path d="m16.2 7.8 2.9-2.9"/><path d="M18 12h4"/><path d="m16.2 16.2 2.9 2.9"/><path d="M12 18v4"/><path d="m4.9 19.1 2.9-2.9"/><path d="M2 12h4"/><path d="m4.9 4.9 2.9 2.9"/></svg>',
                        'title' => __('Color Controls', 'mxchat'),
                        'desc' => __('Fine-tune every color precisely', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>',
                        'title' => __('One-Click Apply', 'mxchat'),
                        'desc' => __('Apply themes instantly', 'mxchat'),
                    ),
                ),
            ),

            'mxchat-admin-assistant' => array(
                'title' => __('MxChat Admin Assistant', 'mxchat'),
                'description' => __('Your AI powerhouse inside WordPress. Chat with multiple AI models, generate images, research the web, and boost productivity—all without leaving your dashboard.', 'mxchat'),
                'key_benefits' => array(
                    __('ChatGPT-like admin interface', 'mxchat'),
                    __('Generate images & research web', 'mxchat'),
                    __('Searchable chat history', 'mxchat')
                ),
                'license' => 'MxChat PRO',
                'accent' => '#fa73e6',
                'url' => 'https://mxchat.ai/ai-admin-assistant/',
                'plugin_file' => 'mxchat-admin-chat/mxchat-admin-chat.php',
                'config_page' => 'mxchat-admin-chat',
                'hero_features' => array(
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>',
                        'title' => __('Admin Chat UI', 'mxchat'),
                        'desc' => __('ChatGPT-like dashboard interface', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>',
                        'title' => __('Image Generation', 'mxchat'),
                        'desc' => __('Create images with AI prompts', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>',
                        'title' => __('Web Research', 'mxchat'),
                        'desc' => __('Search the web from your dashboard', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="22 12 16 12 14 15 10 9 8 12 2 12"/></svg>',
                        'title' => __('Chat History', 'mxchat'),
                        'desc' => __('Searchable conversation archive', 'mxchat'),
                    ),
                ),
            ),

            'mxchat-veo' => array(
                'title' => __('MxChat Video Generation', 'mxchat'),
                'description' => __('Generate stunning AI videos using Google Veo 2 and Veo 3 models directly from your WordPress dashboard. Create high-quality videos from text prompts with audio, multiple aspect ratios, and optimized generation speeds.', 'mxchat'),
                'key_benefits' => array(
                    __('Multiple Veo models (Veo 2, 3, 3 Fast)', 'mxchat'),
                    __('8-second videos with native audio', 'mxchat'),
                    __('Media library integration', 'mxchat')
                ),
                'license' => 'MxChat PRO',
                'accent' => '#ff6b35',
                'url' => 'https://mxchat.ai/mxchat-veo-video-generation/',
                'plugin_file' => 'mxchat-veo/mxchat-veo.php',
                'config_page' => 'mxchat-veo',
                'hero_features' => array(
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="23 7 16 12 23 17 23 7"/><rect x="1" y="5" width="15" height="14" rx="2" ry="2"/></svg>',
                        'title' => __('AI Video Creation', 'mxchat'),
                        'desc' => __('Generate videos from text prompts', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/></svg>',
                        'title' => __('Native Audio', 'mxchat'),
                        'desc' => __('Videos with built-in audio tracks', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3h7a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-7m0-18H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h7m0-18v18"/></svg>',
                        'title' => __('Aspect Ratios', 'mxchat'),
                        'desc' => __('Multiple size options available', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/></svg>',
                        'title' => __('Media Library', 'mxchat'),
                        'desc' => __('Save directly to WordPress media', 'mxchat'),
                    ),
                ),
            ),

            'mxchat-image-analysis' => array(
                'title' => __('MxChat Image Analysis', 'mxchat'),
                'description' => __('Enhance your chatbot with AI-powered image analysis. Users can upload images for intelligent descriptions, OCR text extraction, and get answers about visual content using OpenAI Vision and Grok APIs.', 'mxchat'),
                'key_benefits' => array(
                    __('Multiple AI vision models', 'mxchat'),
                    __('Drag & drop image uploads', 'mxchat'),
                    __('Custom analysis prompts', 'mxchat')
                ),
                'license' => 'MxChat PRO',
                'accent' => '#fa73e6',
                'url' => 'https://mxchat.ai/image-analysis/',
                'plugin_file' => 'mxchat-vision/mxchat-vision.php',
                'config_page' => 'mxchat-vision',
                'hero_features' => array(
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>',
                        'title' => __('Vision AI Models', 'mxchat'),
                        'desc' => __('OpenAI Vision & Grok analysis', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 16 12 12 8 16"/><line x1="12" y1="12" x2="12" y2="21"/><path d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"/></svg>',
                        'title' => __('Drag & Drop', 'mxchat'),
                        'desc' => __('Easy image upload in chat', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg>',
                        'title' => __('OCR Extraction', 'mxchat'),
                        'desc' => __('Extract text from images', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="4" y1="21" x2="4" y2="14"/><line x1="4" y1="10" x2="4" y2="3"/><line x1="12" y1="21" x2="12" y2="12"/><line x1="12" y1="8" x2="12" y2="3"/><line x1="20" y1="21" x2="20" y2="16"/><line x1="20" y1="12" x2="20" y2="3"/><line x1="1" y1="14" x2="7" y2="14"/><line x1="9" y1="8" x2="15" y2="8"/><line x1="17" y1="16" x2="23" y2="16"/></svg>',
                        'title' => __('Custom Prompts', 'mxchat'),
                        'desc' => __('Tailor analysis instructions', 'mxchat'),
                    ),
                ),
            ),

            'mxchat-forms' => array(
                'title' => __('MxChat Forms', 'mxchat'),
                'description' => __('Convert conversations into data collection. Create smart forms that trigger during chats, collect user information, and turn casual visitors into qualified leads.', 'mxchat'),
                'key_benefits' => array(
                    __('No-code form builder', 'mxchat'),
                    __('Intent-triggered activation', 'mxchat'),
                    __('Export lead data easily', 'mxchat')
                ),
                'license' => 'MxChat PRO',
                'accent' => '#fa73e6',
                'url' => 'https://mxchat.ai/forms-action/',
                'plugin_file' => 'mxchat-forms/mxchat-forms.php',
                'config_page' => 'mxchat-forms',
                'hero_features' => array(
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><line x1="9" y1="9" x2="15" y2="9"/><line x1="9" y1="13" x2="15" y2="13"/><line x1="9" y1="17" x2="12" y2="17"/></svg>',
                        'title' => __('Form Builder', 'mxchat'),
                        'desc' => __('No-code drag & drop builder', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>',
                        'title' => __('Smart Triggers', 'mxchat'),
                        'desc' => __('Show forms based on intent', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/></svg>',
                        'title' => __('Lead Capture', 'mxchat'),
                        'desc' => __('Turn visitors into contacts', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>',
                        'title' => __('Data Export', 'mxchat'),
                        'desc' => __('Export leads to CSV easily', 'mxchat'),
                    ),
                ),
            ),
            
            'mxchat-multi-bot' => array(
                'title' => __('MxChat Multi-Bot Manager', 'mxchat'),
                'description' => __('Create unlimited specialized chatbots for every purpose. Deploy dedicated bots with separate knowledge bases, custom personalities, and page-specific assignments—perfect for support, sales, and department-specific assistance.', 'mxchat'),
                'key_benefits' => array(
                    __('Unlimited specialized chatbots', 'mxchat'),
                    __('Separate Pinecone knowledge bases', 'mxchat'),
                    __('Page-specific bot assignments', 'mxchat')
                ),
                'license' => 'MxChat PRO',
                'accent' => '#8b5cf6',
                'url' => 'https://mxchat.ai/multi-bot/',
                'plugin_file' => 'mxchat-multi-bot/mxchat-multi-bot.php',
                'config_page' => 'mxchat-multi-bot',
                'hero_features' => array(
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="3" width="20" height="14" rx="2" ry="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/></svg>',
                        'title' => __('Unlimited Bots', 'mxchat'),
                        'desc' => __('Create specialized chatbots', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"/><path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"/></svg>',
                        'title' => __('Separate Knowledge', 'mxchat'),
                        'desc' => __('Unique knowledge per bot', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>',
                        'title' => __('Page Assignments', 'mxchat'),
                        'desc' => __('Assign bots to specific pages', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>',
                        'title' => __('Custom Personas', 'mxchat'),
                        'desc' => __('Unique personality per bot', 'mxchat'),
                    ),
                ),
            ),

            'mxchat-trigger' => array(
                'title' => __('MxChat Trigger', 'mxchat'),
                'description' => __('Turn any element into a conversation starter. Add chat trigger buttons and links throughout your website that open MxChat and send predefined messages—perfect for CTAs, support links, and guided experiences.', 'mxchat'),
                'key_benefits' => array(
                    __('Simple data attribute triggers', 'mxchat'),
                    __('Multi-Bot targeting support', 'mxchat'),
                    __('Built-in button styles & animations', 'mxchat')
                ),
                'license' => 'MxChat PRO',
                'accent' => '#3ac9d1',
                'url' => 'https://mxchat.ai/triggers/',
                'plugin_file' => 'mxchat-trigger/mxchat-trigger.php',
                'config_page' => 'mxchat-triggers',
                'hero_features' => array(
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="16"/><line x1="8" y1="12" x2="16" y2="12"/></svg>',
                        'title' => __('Element Triggers', 'mxchat'),
                        'desc' => __('Turn any element into a trigger', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>',
                        'title' => __('Preset Messages', 'mxchat'),
                        'desc' => __('Auto-send predefined prompts', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="3" width="20" height="14" rx="2" ry="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/></svg>',
                        'title' => __('Multi-Bot Targeting', 'mxchat'),
                        'desc' => __('Route to specific bots', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><path d="M12 8v8"/><path d="M8 12h8"/></svg>',
                        'title' => __('Button Styles', 'mxchat'),
                        'desc' => __('Built-in styles & animations', 'mxchat'),
                    ),
                ),
            ),

            'mxchat-anywhere' => array(
                'title' => __('MxChat Anywhere', 'mxchat'),
                'sidebar_title' => __('MxChat Anywhere', 'mxchat'),
                'description' => __('Deploy your AI chatbot on any website with a single script tag. Works on static HTML, Shopify, Squarespace, Wix, and custom web apps — no WordPress required on the target site. Full feature parity with Shadow DOM style isolation.', 'mxchat'),
                'key_benefits' => array(
                    __('One script tag — works on any website', 'mxchat'),
                    __('Shadow DOM prevents CSS conflicts', 'mxchat'),
                    __('Domain-validated security keys', 'mxchat')
                ),
                'license' => 'MxChat PRO',
                'accent' => '#10b981',
                'url' => 'https://mxchat.ai/mxchat-anywhere-deploy-your-ai-chatbot-on-any-website-with-one-script-tag/',
                'download_url' => 'https://mxchat.ai/mxchat-anywhere-deploy-your-ai-chatbot-on-any-website-with-one-script-tag/',
                'plugin_file' => 'mxchat-embed/mxchat-embed.php',
                'config_page' => 'mxchat-embed',
                'hero_features' => array(
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>',
                        'title' => __('Universal Embed', 'mxchat'),
                        'desc' => __('One script tag on any website', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>',
                        'title' => __('Style Isolation', 'mxchat'),
                        'desc' => __('Shadow DOM prevents CSS conflicts', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>',
                        'title' => __('Domain Security', 'mxchat'),
                        'desc' => __('Validated keys per domain', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>',
                        'title' => __('Zero Dependencies', 'mxchat'),
                        'desc' => __('Vanilla JS, no impact on Core Web Vitals', 'mxchat'),
                    ),
                ),
            ),

            'mxchat-woo' => array(
                'title' => __('MxChat WooCommerce', 'mxchat'),
                'description' => __('Boost sales with AI-powered shopping assistance. Help customers find products, manage carts, and complete purchases—all through natural conversation.', 'mxchat'),
                'key_benefits' => array(
                    __('Smart product recommendations', 'mxchat'),
                    __('Cart & checkout assistance', 'mxchat'),
                    __('Order history access', 'mxchat')
                ),
                'license' => 'MxChat PRO',
                'accent' => '#fa73e6',
                'url' => 'https://mxchat.ai/woocommerce/',
                'plugin_file' => 'mxchat-woo/mxchat-woo.php',
                'config_page' => 'mxchat-woo',
                'hero_features' => array(
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="21" r="1"/><circle cx="20" cy="21" r="1"/><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"/></svg>',
                        'title' => __('Cart Assistant', 'mxchat'),
                        'desc' => __('Manage cart through conversation', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"/><line x1="8" y1="12" x2="21" y2="12"/><line x1="8" y1="18" x2="21" y2="18"/><line x1="3" y1="6" x2="3.01" y2="6"/><line x1="3" y1="12" x2="3.01" y2="12"/><line x1="3" y1="18" x2="3.01" y2="18"/></svg>',
                        'title' => __('Product Search', 'mxchat'),
                        'desc' => __('Smart product recommendations', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="1" y="4" width="22" height="16" rx="2" ry="2"/><line x1="1" y1="10" x2="23" y2="10"/></svg>',
                        'title' => __('Checkout Help', 'mxchat'),
                        'desc' => __('Guide customers to purchase', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/></svg>',
                        'title' => __('Order History', 'mxchat'),
                        'desc' => __('Look up past orders in chat', 'mxchat'),
                    ),
                ),
            ),

            'mxchat-assistant-api' => array(
                'title' => __('MxChat Assistant API', 'mxchat'),
                'description' => __('Unlock the full power of OpenAI Assistants. Bypass MxChat\'s knowledge base and connect directly to your custom OpenAI Assistant for advanced AI capabilities and specialized responses.', 'mxchat'),
                'key_benefits' => array(
                    __('Custom OpenAI Assistant integration', 'mxchat'),
                    __('Advanced AI capabilities', 'mxchat'),
                    __('24-hour conversation persistence', 'mxchat')
                ),
                'license' => 'MxChat PRO',
                'accent' => '#00d4aa',
                'url' => 'https://mxchat.ai/openai-assistants-api/',
                'plugin_file' => 'mxchat-assistant-api/mxchat-assistant-api.php',
                'config_page' => 'mxchat-assistant-api',
                'hero_features' => array(
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>',
                        'title' => __('OpenAI Assistants', 'mxchat'),
                        'desc' => __('Connect your custom Assistant', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2L2 7l10 5 10-5-10-5z"/><path d="M2 17l10 5 10-5"/><path d="M2 12l10 5 10-5"/></svg>',
                        'title' => __('Advanced AI', 'mxchat'),
                        'desc' => __('Full Assistant API capabilities', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>',
                        'title' => __('24hr Persistence', 'mxchat'),
                        'desc' => __('Conversations persist all day', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg>',
                        'title' => __('Direct Connect', 'mxchat'),
                        'desc' => __('Bypass MxChat knowledge base', 'mxchat'),
                    ),
                ),
            ),

            'mxchat-perplexity' => array(
                'title' => __('MxChat Perplexity', 'mxchat'),
                'description' => __('Give your chatbot real-time knowledge. Add powerful web search capabilities so your bot can answer questions about current events and time-sensitive information.', 'mxchat'),
                'key_benefits' => array(
                    __('Real-time web search', 'mxchat'),
                    __('Intent-triggered research', 'mxchat'),
                    __('Up-to-date information', 'mxchat')
                ),
                'license' => 'MxChat PRO',
                'accent' => '#fa73e6',
                'url' => 'https://quickdeploywp.com/plugin/mxchat-perplexity/',
                'plugin_file' => 'mxchat-perplexity/mxchat-perplexity.php',
                'config_page' => 'mxchat-perplexity',
                'hero_features' => array(
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>',
                        'title' => __('Web Search', 'mxchat'),
                        'desc' => __('Real-time internet searching', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>',
                        'title' => __('Intent Triggers', 'mxchat'),
                        'desc' => __('Auto-search when needed', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>',
                        'title' => __('Live Data', 'mxchat'),
                        'desc' => __('Up-to-date information always', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>',
                        'title' => __('Seamless Chat', 'mxchat'),
                        'desc' => __('Results blend into conversation', 'mxchat'),
                    ),
                ),
            ),

            'mxchat-moderation' => array(
                'title' => __('MxChat Moderation', 'mxchat'),
                'description' => __('Keep your chat clean and professional. Block unwanted users, filter inappropriate content, and ensure your chatbot represents your brand properly.', 'mxchat'),
                'key_benefits' => array(
                    __('IP & email-based blocking', 'mxchat'),
                    __('Content filtering', 'mxchat'),
                    __('Spam protection', 'mxchat')
                ),
                'license' => 'MxChat PRO',
                'accent' => '#fa73e6',
                'url' => 'https://quickdeploywp.com/plugin/mxchat-moderation/',
                'plugin_file' => 'mxchat-moderation/mx-chat-moderation.php',
                'config_page' => 'mx-chat-moderation',
                'hero_features' => array(
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>',
                        'title' => __('Content Filter', 'mxchat'),
                        'desc' => __('Block inappropriate content', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="4.93" y1="4.93" x2="19.07" y2="19.07"/></svg>',
                        'title' => __('User Blocking', 'mxchat'),
                        'desc' => __('IP & email-based bans', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/></svg>',
                        'title' => __('Spam Protection', 'mxchat'),
                        'desc' => __('Detect and prevent spam', 'mxchat'),
                    ),
                    array(
                        'icon' => '<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="8.5" cy="7" r="4"/><line x1="20" y1="8" x2="20" y2="14"/><line x1="23" y1="11" x2="17" y2="11"/></svg>',
                        'title' => __('Brand Safety', 'mxchat'),
                        'desc' => __('Keep chat professional', 'mxchat'),
                    ),
                ),
            ),

        );
    }

    /**
     * Get the addons configuration array
     *
     * @return array The addons configuration
     */
    public function get_addons_config() {
        return $this->addons_config;
    }

    /**
     * Register the stylesheets for the admin area.
     */
    public function enqueue_styles() {
        wp_enqueue_style(
            'mxchat-addons',
            plugin_dir_url(__FILE__) . '../css/admin-add-ons.css',
            array(),
            MXCHAT_VERSION,
            'all'
        );
    }

    /**
     * Check if an addon is installed and active
     *
     * @param string $plugin_file The plugin's main file path
     * @return array Status information
     */
    private function get_addon_status($plugin_file) {
        if (!function_exists('get_plugins')) {
            require_once ABSPATH . 'wp-admin/includes/plugin.php';
        }

        $all_plugins = get_plugins();
        $active_plugins = get_option('active_plugins', array());

        // Find the addon by iterating through configs
        $config_page = '';
        foreach ($this->addons_config as $slug => $addon) {
            if ($addon['plugin_file'] === $plugin_file) {
                $config_page = $addon['config_page'];
                break;
            }
        }

        if (isset($all_plugins[$plugin_file])) {
            if (in_array($plugin_file, $active_plugins)) {
                return array(
                    'status' => 'active',
                    'action_url' => admin_url('admin.php?page=' . $config_page),
                    'action_text' => __('Configure', 'mxchat')
                );
            } else {
                return array(
                    'status' => 'inactive',
                    'action_url' => wp_nonce_url(
                        admin_url('plugins.php?action=activate&plugin=' . $plugin_file),
                        'activate-plugin_' . $plugin_file
                    ),
                    'action_text' => __('Activate', 'mxchat')
                );
            }
        }

        return array(
            'status' => 'not-installed',
            'action_url' => '',
            'action_text' => __('Get Extension', 'mxchat')
        );
    }

    /**
     * Render the Add Ons page content.
     */
    public function render_page() {
        $this->enqueue_styles();
        // Remove the sorting logic and just use the original order
        $sorted_addons = $this->addons_config;
        
        ?>
        <div class="wrap mxchat-addons-wrapper">
                <div class="mxchat-addons-hero">
                    <h1 class="mxchat-main-title">
                        <span class="mxchat-gradient-text">Power Up</span> Your Chatbot
                    </h1>
                    <p class="mxchat-hero-subtitle">
                        <?php esc_html_e('Extend MxChat with these powerful extensions and unlock advanced features.', 'mxchat'); ?>
                    </p>
                </div>
                
                <div class="mxchat-addons-section">
                    <div class="mxchat-addons-grid">
                        <?php foreach ($sorted_addons as $slug => $addon): ?>
                            <?php $this->render_addon_card($slug, $addon); ?>
                        <?php endforeach; ?>
                    </div>
                </div>
                
                <div class="mxchat-cta-section">
                    <h2><?php esc_html_e('Ready to take your chatbot to the next level?', 'mxchat'); ?></h2>
                    <p><?php esc_html_e('Get MxChat PRO today and access all premium extensions at one low price.', 'mxchat'); ?></p>
                    <a href="https://mxchat.ai/" class="mxchat-cta-button" target="_blank"><?php esc_html_e('Learn More', 'mxchat'); ?></a>
                </div>
            </div>
            <?php
        }

    /**
     * Render individual add-on card
     *
     * @param string $slug The addon slug
     * @param array  $addon The addon configuration array
     */
    private function render_addon_card($slug, $addon) {
        $status_info = $this->get_addon_status($addon['plugin_file']);
        $button_url = $status_info['status'] === 'not-installed' ? $addon['url'] : $status_info['action_url'];
        $button_target = $status_info['status'] === 'not-installed' ? '_blank' : '_self';
        
        // Check if addon is deprecated
        $is_deprecated = isset($addon['status']) && $addon['status'] === 'deprecated';
        ?>
        <div class="mxchat-addon-card <?php echo $is_deprecated ? 'deprecated' : ''; ?>" style="--card-accent: <?php echo esc_attr($addon['accent']); ?>">
            <div class="mxchat-addon-badge">
                <?php if ($is_deprecated): ?>
                    <?php esc_html_e('Deprecated', 'mxchat'); ?>
                <?php else: ?>
                    <?php echo esc_html(ucfirst($addon['license'])); ?>
                <?php endif; ?>
            </div>
            <div class="mxchat-addon-content">
                <h3 class="mxchat-addon-title"><?php echo esc_html($addon['title']); ?></h3>
                <p class="mxchat-addon-description"><?php echo esc_html($addon['description']); ?></p>
                
                <?php if (!empty($addon['key_benefits'])): ?>
                <div class="mxchat-benefits-list">
                    <?php foreach ($addon['key_benefits'] as $benefit): ?>
                        <div class="mxchat-benefit-item">
                            <span class="mxchat-benefit-icon">✓</span>
                            <?php echo esc_html($benefit); ?>
                        </div>
                    <?php endforeach; ?>
                </div>
                <?php endif; ?>
                
                <div class="mxchat-addon-footer">
                    <?php if ($is_deprecated): ?>
                        <div class="mxchat-status-indicator deprecated">
                            <?php esc_html_e('Now Built-in', 'mxchat'); ?>
                        </div>
                        <a href="<?php echo esc_url(admin_url('admin.php?page=mxchat-prompts')); ?>"
                           class="mxchat-action-button deprecated"
                           target="_self">
                            <?php esc_html_e('Go to Knowledge Tab', 'mxchat'); ?>
                        </a>
                    <?php else: ?>
                        <div class="mxchat-status-indicator <?php echo esc_attr($status_info['status']); ?>">
                            <?php echo esc_html(ucfirst(str_replace('-', ' ', $status_info['status']))); ?>
                        </div>
                        <a href="<?php echo esc_url($button_url); ?>"
                           class="mxchat-action-button"
                           target="<?php echo esc_attr($button_target); ?>"
                           data-action="<?php echo esc_attr($status_info['status']); ?>">
                            <?php echo esc_html($status_info['action_text']); ?>
                        </a>
                    <?php endif; ?>
                </div>
            </div>
        </div>
        <?php
    }

}
```
