addons_config = array( 'mxchat-pinecone' => array( 'title' => __('Pinecone DB Manager', 'mxchat'), 'description' => __('Seamlessly manage your vectorized content in Pinecone\'s vector database directly from your WordPress dashboard. This integration provides an efficient alternative to the default WordPress database storage.', 'mxchat'), 'license' => 'free', 'accent' => '#fa73e6', 'url' => 'https://quickdeploywp.com/plugin/mxchat-pinecone/', 'plugin_file' => 'mxchat-pinecone/pinecone-manager.php', 'config_page' => 'mxchat-pinecone' ), 'mxchat-forms' => array( 'title' => __('MxChat Forms', 'mxchat'), 'description' => __('Create and manage smart forms that automatically trigger during chat conversations. Build custom forms with multiple field types, collect submissions, and export data—all seamlessly integrated with MxChat\'s intent system. No coding required, just intuitive form building for enhanced chat interactions.', 'mxchat'), 'license' => 'MxChat PRO', 'accent' => '#fa73e6', 'url' => 'https://quickdeploywp.com/plugin/mxchat-forms/', 'plugin_file' => 'mxchat-forms/mxchat-forms.php', 'config_page' => 'mxchat-forms' ), 'mxchat-theme' => array( 'title' => __('MxChat Theme Customizer', 'mxchat'), 'description' => __('MxChat Theme Customizer is a powerful add-on for MxChat Pro that makes it effortless to personalize your chatbot’s appearance. With an intuitive color picker, you can instantly adjust background colors, and interface elements—all with real-time previews. No coding required, just simple, live customization to match your brand’s look.', 'mxchat'), 'license' => 'MxChat PRO', 'accent' => '#fa73e6', 'url' => 'https://quickdeploywp.com/plugin/mxchat-theme/', 'plugin_file' => 'mxchat-theme/mxchat-theme.php', 'config_page' => 'mxchat-theme-settings' ), 'mxchat-moderation' => array( 'title' => __('MxChat Moderation', 'mxchat'), 'description' => __('MxChat Moderation is the ultimate add-on for MxChat, giving you full control over who interacts with your chatbot. Effortlessly block spammers, trolls, or unwanted users using IP and email-based bans—keeping your chat clean, safe, and enjoyable. Say goodbye to disruptive users and hello to a smoother, more secure chatbot experience!', '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' ), ); } /** * Register the stylesheets for the admin area. */ public function enqueue_styles() { $plugin_version = '2.0.3'; wp_enqueue_style( 'mxchat-addons', plugin_dir_url(__FILE__) . '../css/admin-add-ons.css', array(), $plugin_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(); ?>

Power Up Your Chatbot

addons_config as $slug => $addon) { $this->render_addon_card($slug, $addon); } ?>
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'; ?>