is_activated(); $options = get_option('mxchat_options', array()); $plugin_url = plugin_dir_url(dirname(__FILE__)); ?>

show_theme_migration_banner(); ?>

mxchat_model_callback(); }, __('Select the AI model your chatbot will use for conversations.', 'mxchat')); // Embedding Model mxchat_render_field_wrapper('embedding_model', __('Embedding Model', 'mxchat'), function() use ($admin_instance) { $admin_instance->embedding_model_callback(); }, __('Vector embedding model for knowledge base matching. Changing models requires reconfiguring knowledge data.', 'mxchat')); // Enable Streaming mxchat_render_field_wrapper('enable_streaming', __('Enable Streaming', 'mxchat'), function() use ($admin_instance) { $admin_instance->enable_streaming_toggle_callback(); }, __('Enable real-time streaming responses for supported models (OpenAI, Claude, DeepSeek, Grok).', 'mxchat')); ?>

system_prompt_instructions_callback(); }, __('Provide system-level instructions to guide the AI\'s behavior and responses.', 'mxchat')); // Similarity Threshold mxchat_render_field_wrapper('similarity_threshold', __('Similarity Threshold', 'mxchat'), function() use ($admin_instance) { $admin_instance->mxchat_similarity_threshold_callback(); }, __('Adjust threshold for content matching. Lower values = more matches, higher values = stricter matching.', 'mxchat')); // Contextual Awareness mxchat_render_field_wrapper('contextual_awareness', __('Contextual Awareness', 'mxchat'), function() use ($admin_instance) { $admin_instance->mxchat_contextual_awareness_callback(); }, __('Allow the chatbot to understand and reference the current page content for more relevant responses.', 'mxchat')); // Frontend Debugger mxchat_render_field_wrapper('frontend_debugger', __('Frontend Debugger', 'mxchat'), function() use ($admin_instance) { $admin_instance->mxchat_frontend_debugger_callback(); }, __('Show debug panel on frontend for admins. Displays similarity scores and query analysis.', 'mxchat')); ?>

mxchat_append_to_body_callback(); }, __('Show chatbot automatically on all pages. Disable to use shortcode [mxchat_chatbot] instead.', 'mxchat')); // Open Links in New Tab mxchat_render_field_wrapper('link_target', __('Open Links in New Tab', 'mxchat'), function() use ($admin_instance) { $admin_instance->mxchat_link_target_toggle_callback(); }, __('Open links clicked in chat responses in a new browser tab.', 'mxchat')); // Chat Persistence mxchat_render_field_wrapper('chat_persistence', __('Chat Persistence', 'mxchat'), function() use ($admin_instance) { $admin_instance->mxchat_chat_persistence_toggle_callback(); }, __('Keep chat history when users navigate or return within 24 hours.', 'mxchat')); ?>

mxchat_top_bar_title_callback(); }, __('Title text shown in the chatbot header.', 'mxchat')); // AI Agent Text mxchat_render_field_wrapper('ai_agent_text', __('AI Agent Text', 'mxchat'), function() use ($admin_instance) { $admin_instance->mxchat_ai_agent_text_callback(); }, __('Text shown for AI agents in the status indicator.', 'mxchat')); // Intro Message mxchat_render_field_wrapper('intro_message', __('Introductory Message', 'mxchat'), function() use ($admin_instance) { $admin_instance->mxchat_intro_message_callback(); }, __('First message shown when chat opens. HTML allowed.', 'mxchat')); // Input Placeholder mxchat_render_field_wrapper('input_copy', __('Input Placeholder', 'mxchat'), function() use ($admin_instance) { $admin_instance->mxchat_input_copy_callback(); }, __('Placeholder text in the chat input field.', 'mxchat')); // Chat Teaser mxchat_render_field_wrapper('pre_chat_message', __('Chat Teaser Pop-up', 'mxchat'), function() use ($admin_instance) { $admin_instance->mxchat_pre_chat_message_callback(); }, __('Message shown before users start chatting.', 'mxchat')); ?>

enable_email_block_callback(); }, __('Require users to enter their email before chatting. Shows for non-logged-in users.', 'mxchat')); // Email Form Content mxchat_render_field_wrapper('email_blocker_header', __('Email Form Content', 'mxchat'), function() use ($admin_instance) { $admin_instance->email_blocker_header_content_callback(); }, __('HTML content shown above the email form.', 'mxchat')); // Email Button Text mxchat_render_field_wrapper('email_blocker_button', __('Submit Button Text', 'mxchat'), function() use ($admin_instance) { $admin_instance->email_blocker_button_text_callback(); }, __('Text for the email form submit button.', 'mxchat')); // Require Name mxchat_render_field_wrapper('enable_name_field', __('Also Require Name', 'mxchat'), function() use ($admin_instance) { $admin_instance->enable_name_field_callback(); }, __('Also require users to enter their name with email.', 'mxchat')); // Name Placeholder mxchat_render_field_wrapper('name_placeholder', __('Name Field Placeholder', 'mxchat'), function() use ($admin_instance) { $admin_instance->name_field_placeholder_callback(); }, __('Placeholder text for the name input field.', 'mxchat')); ?>

mxchat_privacy_toggle_callback(); }, __('Show privacy notice below the chat widget.', 'mxchat')); // Complianz mxchat_render_field_wrapper('complianz_toggle', __('Complianz Integration', 'mxchat'), function() use ($admin_instance) { $admin_instance->mxchat_complianz_toggle_callback(); }, __('Apply Complianz consent logic to the chatbot (requires Complianz plugin).', 'mxchat')); ?>

mxchat_popular_question_1_callback(); }); // Quick Question 2 mxchat_render_field_wrapper('popular_question_2', __('Quick Question 2', 'mxchat'), function() use ($admin_instance) { $admin_instance->mxchat_popular_question_2_callback(); }); // Quick Question 3 mxchat_render_field_wrapper('popular_question_3', __('Quick Question 3', 'mxchat'), function() use ($admin_instance) { $admin_instance->mxchat_popular_question_3_callback(); }); // Additional Questions mxchat_render_field_wrapper('additional_questions', __('Additional Questions', 'mxchat'), function() use ($admin_instance) { $admin_instance->mxchat_additional_popular_questions_callback(); }, __('Add as many quick questions as you need.', 'mxchat')); ?>

{limit}, {timeframe}, {count}, {remaining}
[Link text](https://example.com)

' . esc_html__('documentation page', 'mxchat') . '' ); ?>

__('AI Theme Generator', 'mxchat'), 'description' => __('Learn how to instantly restyle your chatbot using plain English prompts with real-time previews.', 'mxchat'), 'url' => 'https://www.youtube.com/watch?v=rSQDW2qbtRU&t' ), array( 'title' => __('MxChat Forms', 'mxchat'), 'description' => __('Create and manage smart forms that automatically trigger during chat conversations.', 'mxchat'), 'url' => 'https://www.youtube.com/watch?v=3MrWy5dRalA' ), array( 'title' => __('Admin Assistant Add-on', 'mxchat'), 'description' => __('Bring a ChatGPT-like experience directly inside your WordPress dashboard.', 'mxchat'), 'url' => 'https://youtu.be/AdEA1k-UCFM' ), array( 'title' => __('Intent Tester Guide', 'mxchat'), 'description' => __('Fine-tune your chatbot\'s responses and ensure accurate query understanding.', 'mxchat'), 'url' => 'https://www.youtube.com/watch?v=uTr14tn59Hc' ), array( 'title' => __('Theme Customizer', 'mxchat'), 'description' => __('Customize appearance with real-time previews to match your brand.', 'mxchat'), 'url' => 'https://youtu.be/MfbB9mZi6ag' ), array( 'title' => __('WooCommerce Integration', 'mxchat'), 'description' => __('Provide product recommendations and shopping assistance to customers.', 'mxchat'), 'url' => 'https://www.youtube.com/watch?v=WsqAppHRGdA' ), array( 'title' => __('Knowledge Base Setup', 'mxchat'), 'description' => __('Set up your knowledge base using PDFs, sitemaps, and manual entries.', 'mxchat'), 'url' => 'https://www.youtube.com/watch?v=8Ztjs66-VTo' ), array( 'title' => __('Document Chat', 'mxchat'), 'description' => __('Chat with PDF and Word documents for enhanced document analysis.', 'mxchat'), 'url' => 'https://www.youtube.com/watch?v=j_c45WWCTG0' ), array( 'title' => __('Perplexity Integration', 'mxchat'), 'description' => __('Enable real-time web search capabilities for your chatbot.', 'mxchat'), 'url' => 'https://youtu.be/wpKkbt24-bo' ), array( 'title' => __('Brave Search Intent', 'mxchat'), 'description' => __('Leverage Brave Search for improved query understanding.', 'mxchat'), 'url' => 'https://www.youtube.com/watch?v=7vDL5H7vToc' ), array( 'title' => __('Loops Email Capture', 'mxchat'), 'description' => __('Set up email capture with Loops to grow your mailing list.', 'mxchat'), 'url' => 'https://www.youtube.com/watch?v=CNgm5TYDyTc' ), array( 'title' => __('AI Agent Testing', 'mxchat'), 'description' => __('Evaluate and improve your chatbot\'s performance and accuracy.', 'mxchat'), 'url' => 'https://www.youtube.com/watch?v=A0jowbpyX54' ), ); foreach ($tutorials as $tutorial): ?>

__('Per Hour', 'mxchat'), 'daily' => __('Per Day', 'mxchat'), 'weekly' => __('Per Week', 'mxchat'), 'monthly' => __('Per Month', 'mxchat') ); $roles = wp_roles()->get_names(); $roles['logged_out'] = __('Logged Out Users', 'mxchat'); echo '
'; foreach ($roles as $role_id => $role_name) { $default_limit = ($role_id === 'logged_out') ? '10' : '100'; $default_timeframe = 'daily'; $default_message = __('Rate limit exceeded. Please try again later.', 'mxchat'); $selected_limit = isset($all_options['rate_limits'][$role_id]['limit']) ? $all_options['rate_limits'][$role_id]['limit'] : $default_limit; $selected_timeframe = isset($all_options['rate_limits'][$role_id]['timeframe']) ? $all_options['rate_limits'][$role_id]['timeframe'] : $default_timeframe; $custom_message = isset($all_options['rate_limits'][$role_id]['message']) ? $all_options['rate_limits'][$role_id]['message'] : $default_message; $timeframe_label = isset($timeframes[$selected_timeframe]) ? $timeframes[$selected_timeframe] : $selected_timeframe; ?>
'; }