PluginProbe
MxChat – AI Chatbot & Content Generation for WordPress / 3.1.1
MxChat – AI Chatbot & Content Generation for WordPress v3.1.1
3.2.21 3.2.20 3.2.19 3.2.18 3.2.17 3.2.16 3.2.15 3.2.14 3.2.12 3.2.13 3.2.11 3.2.10 3.2.9 3.2.8 3.2.7 3.2.6 3.2.5 3.2.4 3.2.3 3.2.2 3.2.1 2.0.3 2.0.4 2.0.5 2.0.6 All 152 releases
mxchat-basic / includes / admin-content-page.php

admin-content-page.php in MxChat – AI Chatbot & Content Generation for WordPress 3.1.1, at includes/admin-content-page.php

734 lines 61.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * MxChat Content Generator Page
4 *
5 * Admin page template with sidebar navigation for content generation.
6 *
7 * @package MxChat
8 * @since 3.1.0
9 */
10
11 if (!defined('ABSPATH')) {
12 exit;
13 }
14
15 function mxchat_render_content_page($admin_instance) {
16 $is_activated = $admin_instance->is_activated();
17 $options = get_option('mxchat_options', array());
18 $plugin_url = plugin_dir_url(dirname(__FILE__));
19
20 // Pro feature checks — add-on plugins hook into this filter to unlock
21 $pro_internal_linking = apply_filters('mxchat_content_pro_feature', false, 'internal_linking');
22 $pro_tool_use = apply_filters('mxchat_content_pro_feature', false, 'tool_use');
23 $pro_image_management = apply_filters('mxchat_content_pro_feature', false, 'image_management');
24 $pro_meta_management = apply_filters('mxchat_content_pro_feature', false, 'meta_management');
25 $pro_gsc_integration = apply_filters('mxchat_content_pro_feature', false, 'gsc_integration');
26 ?>
27 <div class="mxch-admin-wrapper">
28 <!-- Mobile Header -->
29 <header class="mxch-mobile-header">
30 <a href="#" class="mxch-mobile-logo">
31 <div class="mxch-mobile-logo-icon">
32 <img src="<?php echo esc_url($plugin_url . 'images/icon-128x128.png'); ?>" alt="MxChat">
33 </div>
34 <span class="mxch-mobile-logo-text">MxChat</span>
35 </a>
36 <button type="button" class="mxch-mobile-menu-btn" aria-label="<?php esc_attr_e('Open menu', 'mxchat'); ?>">
37 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="1"/><circle cx="12" cy="5" r="1"/><circle cx="12" cy="19" r="1"/></svg>
38 </button>
39 </header>
40
41 <!-- Mobile Menu Overlay -->
42 <div class="mxch-mobile-overlay"></div>
43
44 <!-- Mobile Menu Modal -->
45 <div class="mxch-mobile-menu">
46 <div class="mxch-mobile-menu-header">
47 <span class="mxch-mobile-menu-title"><?php esc_html_e('Content', 'mxchat'); ?></span>
48 <button type="button" class="mxch-mobile-menu-close" aria-label="<?php esc_attr_e('Close menu', 'mxchat'); ?>">
49 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
50 </button>
51 </div>
52 <nav class="mxch-mobile-menu-nav">
53 <div class="mxch-mobile-nav-section">
54 <div class="mxch-mobile-nav-section-title"><?php esc_html_e('Content', 'mxchat'); ?></div>
55 <button class="mxch-mobile-nav-link active" data-target="content-generate">
56 <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" 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>
57 <span><?php esc_html_e('Generate', 'mxchat'); ?></span>
58 </button>
59 <button class="mxch-mobile-nav-link" data-target="content-history">
60 <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" 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>
61 <span><?php esc_html_e('History', 'mxchat'); ?></span>
62 </button>
63 <button class="mxch-mobile-nav-link" data-target="content-settings">
64 <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"/></svg>
65 <span><?php esc_html_e('Settings', 'mxchat'); ?></span>
66 </button>
67 <button class="mxch-mobile-nav-link" data-target="content-seo">
68 <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20V10"/><path d="M18 20V4"/><path d="M6 20v-4"/></svg>
69 <span><?php esc_html_e('SEO', 'mxchat'); ?></span>
70 </button>
71 </div>
72 </nav>
73 </div>
74
75 <!-- Sidebar Navigation -->
76 <aside class="mxch-sidebar">
77 <div class="mxch-sidebar-header">
78 <a href="#" class="mxch-sidebar-logo">
79 <div class="mxch-sidebar-logo-icon">
80 <img src="<?php echo esc_url($plugin_url . 'images/icon-128x128.png'); ?>" alt="MxChat">
81 </div>
82 <span class="mxch-sidebar-logo-text">MxChat</span>
83 <span class="mxch-sidebar-version">v<?php echo esc_html(MXCHAT_VERSION ?? '3.1.0'); ?></span>
84 </a>
85 </div>
86
87 <nav class="mxch-sidebar-nav">
88 <div class="mxch-nav-section">
89 <div class="mxch-nav-section-title"><?php esc_html_e('Content', 'mxchat'); ?></div>
90
91 <div class="mxch-nav-item" data-section="content-generate">
92 <button class="mxch-nav-link active" data-target="content-generate">
93 <span class="mxch-nav-link-icon">
94 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" 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>
95 </span>
96 <span class="mxch-nav-link-text"><?php esc_html_e('Generate', 'mxchat'); ?></span>
97 </button>
98 </div>
99
100 <div class="mxch-nav-item" data-section="content-history">
101 <button class="mxch-nav-link" data-target="content-history">
102 <span class="mxch-nav-link-icon">
103 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" 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>
104 </span>
105 <span class="mxch-nav-link-text"><?php esc_html_e('History', 'mxchat'); ?></span>
106 </button>
107 </div>
108
109 <div class="mxch-nav-item" data-section="content-settings">
110 <button class="mxch-nav-link" data-target="content-settings">
111 <span class="mxch-nav-link-icon">
112 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>
113 </span>
114 <span class="mxch-nav-link-text"><?php esc_html_e('Settings', 'mxchat'); ?></span>
115 </button>
116 </div>
117
118 <div class="mxch-nav-item" data-section="content-seo">
119 <button class="mxch-nav-link" data-target="content-seo">
120 <span class="mxch-nav-link-icon">
121 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20V10"/><path d="M18 20V4"/><path d="M6 20v-4"/></svg>
122 </span>
123 <span class="mxch-nav-link-text"><?php esc_html_e('SEO', 'mxchat'); ?></span>
124 </button>
125 </div>
126 </div>
127 </nav>
128 </aside>
129
130 <!-- Main Content Area -->
131 <main class="mxch-content">
132
133 <!-- ========================================
134 GENERATE
135 ======================================== -->
136 <div id="content-generate" class="mxch-section active">
137
138 <!-- Toolbar -->
139 <div class="mxch-cg-toolbar mxch-cg-toolbar-minimal">
140 <div class="mxch-cg-toolbar-left">
141 <button type="button" id="mxch-cg-new-btn" class="mxch-cg-generate-btn">
142 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" 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>
143 <span><?php esc_html_e('Generate', 'mxchat'); ?></span>
144 </button>
145 <h2 id="mxch-cg-preview-title" class="mxch-cg-toolbar-title"><?php esc_html_e('Content Generator', 'mxchat'); ?></h2>
146 <div id="mxch-cg-status-dropdown" class="mxch-cg-status-dropdown" style="display:none;">
147 <button type="button" id="mxch-cg-status-badge" class="mxch-cg-status-badge" title="<?php esc_attr_e('Change status', 'mxchat'); ?>">
148 <span class="mxch-cg-status-badge-text"></span>
149 <svg class="mxch-cg-status-chevron" xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>
150 </button>
151 <div class="mxch-cg-status-menu" style="display:none;">
152 <button type="button" class="mxch-cg-status-option" data-status="draft">
153 <span class="mxch-cg-status-dot mxch-cg-dot-draft"></span>
154 <?php esc_html_e('Draft', 'mxchat'); ?>
155 </button>
156 <button type="button" class="mxch-cg-status-option" data-status="publish">
157 <span class="mxch-cg-status-dot mxch-cg-dot-publish"></span>
158 <?php esc_html_e('Published', 'mxchat'); ?>
159 </button>
160 <button type="button" class="mxch-cg-status-option" data-status="future">
161 <span class="mxch-cg-status-dot mxch-cg-dot-future"></span>
162 <?php esc_html_e('Scheduled', 'mxchat'); ?>
163 </button>
164 <div class="mxch-cg-status-schedule-row" style="display:none;">
165 <input type="datetime-local" id="mxch-cg-status-schedule-input" class="mxch-cg-input mxch-cg-status-schedule-input">
166 <button type="button" id="mxch-cg-status-schedule-confirm" class="mxch-cg-status-schedule-confirm">
167 <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>
168 </button>
169 </div>
170 </div>
171 </div>
172 </div>
173 <div class="mxch-cg-toolbar-right" style="display:none;">
174 <div class="mxch-cg-viewport-toggle">
175 <button type="button" class="mxch-cg-viewport-btn active" data-viewport="desktop" title="<?php esc_attr_e('Desktop', 'mxchat'); ?>">
176 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" 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>
177 </button>
178 <button type="button" class="mxch-cg-viewport-btn" data-viewport="mobile" title="<?php esc_attr_e('Mobile', 'mxchat'); ?>">
179 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="5" y="2" width="14" height="20" rx="2" ry="2"/><line x1="12" y1="18" x2="12.01" y2="18"/></svg>
180 </button>
181 </div>
182 <a id="mxch-cg-view-post" href="#" target="_blank" class="mxch-cg-action-btn">
183 <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>
184 <?php esc_html_e('View', 'mxchat'); ?>
185 </a>
186 <button type="button" id="mxch-cg-chat-toggle" class="mxch-cg-action-btn" title="<?php esc_attr_e('Edit with AI', 'mxchat'); ?>">
187 <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" 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>
188 <?php esc_html_e('AI Edit', 'mxchat'); ?>
189 </button>
190 </div>
191 </div>
192
193 <!-- Full-Width Preview -->
194 <div class="mxch-cg-preview-wrap">
195 <div id="mxch-cg-preview-container" class="mxch-cg-preview-container">
196 <!-- Inline Generation Form -->
197 <div id="mxch-cg-inline-form" class="mxch-cg-inline-form">
198 <div class="mxch-cg-inline-form-inner">
199 <div class="mxch-cg-inline-form-header">
200 <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>
201 <div>
202 <h3><?php esc_html_e('Generate Content', 'mxchat'); ?></h3>
203 <p><?php esc_html_e('Describe what you want and let AI create it for you.', 'mxchat'); ?></p>
204 </div>
205 </div>
206 <div class="mxch-cg-form">
207 <textarea id="mxch-cg-prompt" class="mxch-cg-prompt" rows="3" placeholder="<?php esc_attr_e('Describe the content you want to generate...', 'mxchat'); ?>"></textarea>
208 <div class="mxch-cg-options">
209 <div class="mxch-cg-option">
210 <label class="mxch-cg-option-label" for="mxch-cg-type"><?php esc_html_e('Type', 'mxchat'); ?></label>
211 <select id="mxch-cg-type" class="mxch-cg-select">
212 <option value="post"><?php esc_html_e('Blog Post', 'mxchat'); ?></option>
213 <option value="page"><?php esc_html_e('Landing Page', 'mxchat'); ?></option>
214 </select>
215 </div>
216 <div class="mxch-cg-option">
217 <label class="mxch-cg-option-label" for="mxch-cg-status"><?php esc_html_e('Status', 'mxchat'); ?></label>
218 <select id="mxch-cg-status" class="mxch-cg-select">
219 <option value="draft"><?php esc_html_e('Draft', 'mxchat'); ?></option>
220 <option value="future"><?php esc_html_e('Scheduled', 'mxchat'); ?></option>
221 <option value="publish"><?php esc_html_e('Publish', 'mxchat'); ?></option>
222 </select>
223 </div>
224 <div class="mxch-cg-option mxch-cg-schedule-wrap" style="display:none;">
225 <label class="mxch-cg-option-label" for="mxch-cg-schedule"><?php esc_html_e('Schedule', 'mxchat'); ?></label>
226 <input type="datetime-local" id="mxch-cg-schedule" class="mxch-cg-input">
227 </div>
228 </div>
229 <div class="mxch-cg-options">
230 <div class="mxch-cg-option">
231 <label class="mxch-cg-option-label" for="mxch-cg-layout"><?php esc_html_e('Layout', 'mxchat'); ?></label>
232 <select id="mxch-cg-layout" class="mxch-cg-select">
233 <option value="default"><?php esc_html_e('Theme Default', 'mxchat'); ?></option>
234 <option value="fullwidth" selected><?php esc_html_e('Fullwidth (No Padding)', 'mxchat'); ?></option>
235 </select>
236 </div>
237 <div class="mxch-cg-option">
238 <label class="mxch-cg-option-label" for="mxch-cg-title-display"><?php esc_html_e('Post Title', 'mxchat'); ?></label>
239 <select id="mxch-cg-title-display" class="mxch-cg-select">
240 <option value="show"><?php esc_html_e('Show', 'mxchat'); ?></option>
241 <option value="hide" selected><?php esc_html_e('Hide (title in content)', 'mxchat'); ?></option>
242 </select>
243 </div>
244 </div>
245 <button type="button" id="mxch-cg-generate-btn" class="mxch-cg-generate-btn mxch-cg-generate-btn-full">
246 <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" 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>
247 <span><?php esc_html_e('Generate Content', 'mxchat'); ?></span>
248 </button>
249 </div>
250 <!-- Progress (shown during generation) -->
251 <div id="mxch-cg-progress" class="mxch-cg-progress" style="display:none;">
252 <div class="mxch-cg-progress-bar">
253 <div class="mxch-cg-progress-fill" style="width:0%"></div>
254 </div>
255 <p class="mxch-cg-progress-text"><?php esc_html_e('Starting...', 'mxchat'); ?></p>
256 </div>
257 </div>
258 </div>
259 <!-- Loading indicator (shown during async generation) -->
260 <div id="mxch-cg-loading-indicator" class="mxch-cg-loading-indicator" style="display:none;">
261 <div class="mxch-cg-loading-spinner">
262 <div class="mxch-cg-loading-spinner-ring"></div>
263 <div class="mxch-cg-loading-spinner-ring"></div>
264 <div class="mxch-cg-loading-spinner-ring"></div>
265 <svg class="mxch-cg-loading-spinner-icon" xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>
266 </div>
267 <p id="mxch-cg-loading-phrase" class="mxch-cg-loading-phrase"></p>
268 <div class="mxch-cg-loading-progress-mini">
269 <div class="mxch-cg-loading-progress-mini-bar">
270 <div id="mxch-cg-loading-progress-fill" class="mxch-cg-loading-progress-mini-fill" style="width:0%"></div>
271 </div>
272 <p id="mxch-cg-loading-progress-text" class="mxch-cg-loading-progress-mini-text"><?php esc_html_e('Starting...', 'mxchat'); ?></p>
273 </div>
274 </div>
275 <iframe id="mxch-cg-preview-iframe" class="mxch-cg-preview-iframe" style="display:none;" sandbox="allow-same-origin allow-scripts"></iframe>
276 </div>
277 </div>
278
279 <!-- Mini Chat Panel (slides up from bottom, hidden by default) -->
280 <div id="mxch-cg-chat" class="mxch-cg-chat-panel mxch-cg-chat-panel--with-images" style="display:none;">
281
282 <!-- Left Column: Images + Meta (Tabbed) -->
283 <div class="mxch-cg-images-col<?php echo $pro_image_management ? '' : ' mxch-cg-pro-locked'; ?>">
284 <!-- Tab Navigation -->
285 <div class="mxch-cg-left-tabs">
286 <button type="button" class="mxch-cg-left-tab active" data-tab="images">
287 <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" 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>
288 <?php esc_html_e('Images', 'mxchat'); ?>
289 <?php if (!$pro_image_management): ?>
290 <span class="mxch-cg-pro-badge"><?php echo $is_activated ? esc_html__('ADD-ON', 'mxchat') : esc_html__('PRO', 'mxchat'); ?></span>
291 <?php endif; ?>
292 </button>
293 <button type="button" class="mxch-cg-left-tab" data-tab="meta">
294 <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 7V4h16v3"/><path d="M9 20h6"/><path d="M12 4v16"/></svg>
295 <?php esc_html_e('Meta', 'mxchat'); ?>
296 <?php if (!$pro_meta_management): ?>
297 <span class="mxch-cg-pro-badge"><?php echo $is_activated ? esc_html__('ADD-ON', 'mxchat') : esc_html__('PRO', 'mxchat'); ?></span>
298 <?php endif; ?>
299 </button>
300 <button type="button" class="mxch-cg-left-tab" data-tab="seo">
301 <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" 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>
302 <?php esc_html_e('SEO', 'mxchat'); ?>
303 </button>
304 </div>
305
306 <!-- Images Panel (default visible) -->
307 <div class="mxch-cg-left-panel active" id="mxch-cg-panel-images">
308 <div class="mxch-cg-images-grid" id="mxch-cg-images-grid">
309 <div class="mxch-cg-images-empty" id="mxch-cg-images-empty">
310 <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" 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>
311 <span><?php esc_html_e('Images will appear here after generation', 'mxchat'); ?></span>
312 </div>
313 </div>
314 </div>
315
316 <!-- Meta Panel (hidden by default) -->
317 <div class="mxch-cg-left-panel" id="mxch-cg-panel-meta" style="position:relative;">
318 <div class="mxch-cg-meta-form<?php echo $pro_meta_management ? '' : ' mxch-cg-meta-locked'; ?>">
319 <div class="mxch-cg-meta-field">
320 <label for="mxch-cg-meta-title"><?php esc_html_e('Title', 'mxchat'); ?></label>
321 <input type="text" id="mxch-cg-meta-title" class="mxch-cg-meta-input" placeholder="<?php esc_attr_e('Post title...', 'mxchat'); ?>"<?php echo $pro_meta_management ? '' : ' disabled readonly'; ?>>
322 </div>
323 <div class="mxch-cg-meta-field">
324 <label for="mxch-cg-meta-description"><?php esc_html_e('Meta Description', 'mxchat'); ?></label>
325 <textarea id="mxch-cg-meta-description" class="mxch-cg-meta-input" rows="3" placeholder="<?php esc_attr_e('Meta description...', 'mxchat'); ?>"<?php echo $pro_meta_management ? '' : ' disabled readonly'; ?>></textarea>
326 <span class="mxch-cg-meta-charcount">0 / 160</span>
327 </div>
328 <div class="mxch-cg-meta-field">
329 <label for="mxch-cg-meta-keyword"><?php esc_html_e('Focus Keyword', 'mxchat'); ?></label>
330 <input type="text" id="mxch-cg-meta-keyword" class="mxch-cg-meta-input" placeholder="<?php esc_attr_e('Primary keyword...', 'mxchat'); ?>"<?php echo $pro_meta_management ? '' : ' disabled readonly'; ?>>
331 </div>
332 <div class="mxch-cg-meta-field">
333 <label for="mxch-cg-meta-excerpt"><?php esc_html_e('Excerpt', 'mxchat'); ?></label>
334 <textarea id="mxch-cg-meta-excerpt" class="mxch-cg-meta-input" rows="3" placeholder="<?php esc_attr_e('Post excerpt...', 'mxchat'); ?>"<?php echo $pro_meta_management ? '' : ' disabled readonly'; ?>></textarea>
335 </div>
336 </div>
337 <?php if (!$pro_meta_management): ?>
338 <div class="mxch-cg-meta-lock-overlay">
339 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" 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>
340 <span><?php echo $is_activated ? esc_html__('Install Add-on', 'mxchat') : esc_html__('Upgrade to Pro', 'mxchat'); ?></span>
341 </div>
342 <?php endif; ?>
343 </div>
344
345 <!-- SEO Panel -->
346 <div class="mxch-cg-left-panel" id="mxch-cg-panel-seo">
347 <div class="mxch-seo-panel">
348 <!-- Score Header -->
349 <div class="mxch-seo-score-header">
350 <div class="mxch-seo-score-ring">
351 <svg viewBox="0 0 60 60">
352 <circle class="mxch-seo-ring-bg" cx="30" cy="30" r="26" />
353 <circle class="mxch-seo-ring-fill" id="mxch-seo-ring" cx="30" cy="30" r="26" stroke-dasharray="163.36" stroke-dashoffset="163.36" />
354 </svg>
355 <span class="mxch-seo-score-num" id="mxch-seo-score">&mdash;</span>
356 </div>
357 <div class="mxch-seo-score-info">
358 <span class="mxch-seo-score-label" id="mxch-seo-score-label"><?php esc_html_e('SEO Score', 'mxchat'); ?></span>
359 <span class="mxch-seo-score-summary" id="mxch-seo-score-summary"><?php esc_html_e('Generate content to analyze', 'mxchat'); ?></span>
360 </div>
361 <button type="button" class="mxch-seo-analyze-btn" id="mxch-seo-analyze" title="<?php esc_attr_e('Analyze', 'mxchat'); ?>">
362 <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/><path d="M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16"/><path d="M16 16h5v5"/></svg>
363 </button>
364 </div>
365 <!-- Checklist -->
366 <div class="mxch-seo-checklist" id="mxch-seo-checklist">
367 <div class="mxch-seo-empty" id="mxch-seo-empty">
368 <svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" 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>
369 <span><?php esc_html_e('SEO analysis will appear here after content is generated', 'mxchat'); ?></span>
370 </div>
371 </div>
372 <!-- AI Optimize -->
373 <div class="mxch-seo-actions" id="mxch-seo-actions" style="display:none;">
374 <button type="button" class="mxch-seo-fix-btn" id="mxch-seo-ai-optimize" title="<?php esc_attr_e('AI generates optimized meta description, title, and slug', 'mxchat'); ?>">
375 <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m12 3-1.9 5.8a2 2 0 0 1-1.287 1.288L3 12l5.8 1.9a2 2 0 0 1 1.288 1.287L12 21l1.9-5.8a2 2 0 0 1 1.287-1.288L21 12l-5.8-1.9a2 2 0 0 1-1.288-1.287Z"/></svg>
376 <?php esc_html_e('AI Optimize', 'mxchat'); ?>
377 </button>
378 </div>
379 </div>
380 </div>
381 </div>
382
383 <!-- Chat Column -->
384 <div class="mxch-cg-chat-col">
385 <div class="mxch-cg-chat-panel-header">
386 <span class="mxch-cg-chat-panel-title"><?php esc_html_e('Edit with AI', 'mxchat'); ?></span>
387 <button type="button" id="mxch-cg-chat-close" class="mxch-cg-chat-panel-close" title="<?php esc_attr_e('Close', 'mxchat'); ?>">
388 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
389 </button>
390 </div>
391 <div id="mxch-cg-chat-messages" class="mxch-cg-chat-messages"></div>
392 <div class="mxch-cg-chat-input-wrap">
393 <textarea id="mxch-cg-chat-input" class="mxch-cg-chat-input" rows="2" placeholder="<?php esc_attr_e('e.g. Change the hero heading to...', 'mxchat'); ?>"></textarea>
394 <button type="button" id="mxch-cg-chat-send" class="mxch-cg-chat-send" disabled>
395 <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg>
396 </button>
397 </div>
398 </div>
399 </div>
400 </div>
401
402 <!-- ========================================
403 HISTORY
404 ======================================== -->
405 <div id="content-history" class="mxch-section">
406 <div class="mxch-content-header">
407 <h1 class="mxch-content-title"><?php esc_html_e('Content History', 'mxchat'); ?></h1>
408 <p class="mxch-content-subtitle"><?php esc_html_e('Browse and edit your AI-generated content.', 'mxchat'); ?></p>
409 </div>
410
411 <div class="mxch-card">
412 <div class="mxch-card-body">
413 <!-- Loading state -->
414 <div id="mxch-cg-history-loading" class="mxch-cg-history-loading">
415 <div class="mxch-cg-history-spinner"></div>
416 <p><?php esc_html_e('Loading history...', 'mxchat'); ?></p>
417 </div>
418
419 <!-- Empty state -->
420 <div id="mxch-cg-history-empty" class="mxch-cg-history-empty" style="display:none;">
421 <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>
422 <p><?php esc_html_e('No AI-generated content yet. Use the Generate tab to create your first post.', 'mxchat'); ?></p>
423 </div>
424
425 <!-- History list (rendered by JS) -->
426 <div id="mxch-cg-history-list" class="mxch-cg-history-list" style="display:none;"></div>
427
428 <!-- Pagination (rendered by JS) -->
429 <div id="mxch-cg-history-pagination" class="mxch-cg-history-pagination" style="display:none;"></div>
430 </div>
431 </div>
432 </div>
433
434 <!-- ========================================
435 SETTINGS
436 ======================================== -->
437 <div id="content-settings" class="mxch-section">
438 <div class="mxch-content-header">
439 <h1 class="mxch-content-title"><?php esc_html_e('Settings', 'mxchat'); ?></h1>
440 <p class="mxch-content-subtitle"><?php esc_html_e('Configure content generation and SEO optimization.', 'mxchat'); ?></p>
441 </div>
442
443 <!-- ── Content Settings ── -->
444 <div class="mxch-card">
445 <div class="mxch-card-header">
446 <h3 class="mxch-card-title"><?php esc_html_e('Content', 'mxchat'); ?></h3>
447 </div>
448 <div class="mxch-card-body">
449
450 <!-- Content Model -->
451 <div class="mxch-field">
452 <label class="mxch-field-label" for="mxch-content-model"><?php esc_html_e('Content Model', 'mxchat'); ?></label>
453 <div class="mxch-field-control">
454 <select id="mxch-content-model" data-field="content_model" class="mxch-cg-select">
455 <?php
456 $content_model = $options['content_model'] ?? ($options['model'] ?? 'gpt-5.1-chat-latest');
457 $models = array(
458 'OpenAI' => array(
459 'gpt-5.2' => 'GPT-5.2',
460 'gpt-5.1-chat-latest' => 'GPT-5.1',
461 'gpt-5' => 'GPT-5',
462 ),
463 'Anthropic' => array(
464 'claude-opus-4-6' => 'Claude Opus 4.6',
465 'claude-sonnet-4-6' => 'Claude Sonnet 4.6',
466 'claude-haiku-4-5-20251001' => 'Claude Haiku 4.5',
467 ),
468 'Google' => array(
469 'gemini-3-pro-preview' => 'Gemini 3 Pro',
470 'gemini-2.5-pro' => 'Gemini 2.5 Pro',
471 ),
472 'xAI' => array(
473 'grok-4-0709' => 'Grok 4',
474 'grok-4-1-fast-non-reasoning' => 'Grok 4.1 Fast',
475 'grok-code-fast-1' => 'Grok Code Fast',
476 ),
477 );
478 foreach ($models as $group => $group_models) {
479 echo '<optgroup label="' . esc_attr($group) . '">';
480 foreach ($group_models as $value => $label) {
481 $selected = selected($content_model, $value, false);
482 echo '<option value="' . esc_attr($value) . '" ' . $selected . '>' . esc_html($label) . '</option>';
483 }
484 echo '</optgroup>';
485 }
486 ?>
487 </select>
488 </div>
489 <p class="mxch-field-description"><?php esc_html_e('Select the AI model used for generating content. Uses the API key configured in your main MxChat settings.', 'mxchat'); ?></p>
490 </div>
491
492 <!-- Image Model -->
493 <div class="mxch-field">
494 <label class="mxch-field-label" for="mxch-image-model"><?php esc_html_e('Image Model', 'mxchat'); ?></label>
495 <div class="mxch-field-control">
496 <?php $image_model = $options['content_image_model'] ?? 'gpt-image-1.5'; ?>
497 <select id="mxch-image-model" data-field="content_image_model" class="mxch-cg-select">
498 <optgroup label="<?php esc_attr_e('OpenAI', 'mxchat'); ?>">
499 <option value="gpt-image-1.5" <?php selected($image_model, 'gpt-image-1.5'); ?>><?php esc_html_e('GPT Image 1.5', 'mxchat'); ?></option>
500 </optgroup>
501 <optgroup label="<?php esc_attr_e('xAI', 'mxchat'); ?>">
502 <option value="grok-imagine-image-pro" <?php selected($image_model, 'grok-imagine-image-pro'); ?>><?php esc_html_e('Grok Imagine Pro', 'mxchat'); ?></option>
503 <option value="grok-imagine-image" <?php selected($image_model, 'grok-imagine-image'); ?>><?php esc_html_e('Grok Imagine', 'mxchat'); ?></option>
504 </optgroup>
505 <optgroup label="<?php esc_attr_e('Google', 'mxchat'); ?>">
506 <option value="gemini-2.5-flash-image" <?php selected($image_model, 'gemini-2.5-flash-image'); ?>><?php esc_html_e('Nano Banana (Gemini 2.5 Flash)', 'mxchat'); ?></option>
507 <option value="gemini-3-pro-image-preview" <?php selected($image_model, 'gemini-3-pro-image-preview'); ?>><?php esc_html_e('Nano Banana Pro (Gemini 3 Pro)', 'mxchat'); ?></option>
508 </optgroup>
509 </select>
510 </div>
511 <p class="mxch-field-description"><?php esc_html_e('Select the AI model used for generating images within your content.', 'mxchat'); ?></p>
512 </div>
513
514 <!-- Enable Image Generation -->
515 <div class="mxch-field">
516 <label class="mxch-toggle">
517 <?php $enable_images = $options['content_enable_images'] ?? 'on'; ?>
518 <input type="checkbox" class="mxch-toggle-input" data-field="content_enable_images" value="on" <?php checked($enable_images, 'on'); ?>>
519 <span class="mxch-toggle-switch"></span>
520 <span class="mxch-toggle-label"><?php esc_html_e('Enable Image Generation', 'mxchat'); ?></span>
521 </label>
522 <p class="mxch-field-description"><?php esc_html_e('When enabled, AI will generate and place images throughout your content. When disabled, pages are generated with text-only layouts.', 'mxchat'); ?></p>
523 </div>
524
525 <!-- Internal Linking (Pro) -->
526 <div class="mxch-field mxch-cg-pro-field<?php echo $pro_internal_linking ? '' : ' mxch-cg-pro-locked'; ?>">
527 <label class="mxch-toggle">
528 <?php $internal_linking_val = $options['content_internal_linking'] ?? 'off'; ?>
529 <input type="checkbox" class="mxch-toggle-input" data-field="content_internal_linking" value="on" <?php checked($internal_linking_val, 'on'); ?><?php echo $pro_internal_linking ? '' : ' disabled'; ?>>
530 <span class="mxch-toggle-switch"></span>
531 <span class="mxch-toggle-label">
532 <?php esc_html_e('Internal Linking', 'mxchat'); ?>
533 <?php if (!$pro_internal_linking): ?>
534 <span class="mxch-cg-pro-badge"><?php echo $is_activated ? esc_html__('ADD-ON', 'mxchat') : esc_html__('PRO', 'mxchat'); ?></span>
535 <?php endif; ?>
536 </span>
537 </label>
538 <p class="mxch-field-description"><?php esc_html_e('Automatically find and link to existing blog posts on your site within generated content.', 'mxchat'); ?></p>
539 <?php if (!$pro_internal_linking): ?>
540 <?php if ($is_activated): ?>
541 <a href="https://mxchat.ai/" target="_blank" class="mxch-cg-pro-upgrade-link"><?php esc_html_e('Install Add-on', 'mxchat'); ?></a>
542 <?php else: ?>
543 <a href="https://mxchat.ai/" target="_blank" class="mxch-cg-pro-upgrade-link"><?php esc_html_e('Upgrade to Pro', 'mxchat'); ?></a>
544 <?php endif; ?>
545 <?php endif; ?>
546 </div>
547
548 <!-- Tool Use for AI Editing (Pro) -->
549 <div class="mxch-field mxch-cg-pro-field<?php echo $pro_tool_use ? '' : ' mxch-cg-pro-locked'; ?>">
550 <label class="mxch-toggle">
551 <?php $tool_use_val = $options['content_tool_use'] ?? 'off'; ?>
552 <input type="checkbox" class="mxch-toggle-input" data-field="content_tool_use" value="on" <?php checked($tool_use_val, 'on'); ?><?php echo $pro_tool_use ? '' : ' disabled'; ?>>
553 <span class="mxch-toggle-switch"></span>
554 <span class="mxch-toggle-label">
555 <?php esc_html_e('Tool Use for AI Editing', 'mxchat'); ?>
556 <?php if (!$pro_tool_use): ?>
557 <span class="mxch-cg-pro-badge"><?php echo $is_activated ? esc_html__('ADD-ON', 'mxchat') : esc_html__('PRO', 'mxchat'); ?></span>
558 <?php endif; ?>
559 </span>
560 </label>
561 <p class="mxch-field-description"><?php esc_html_e('Enable precise editing with tool calling — the AI makes targeted changes instead of rewriting the entire page, improving accuracy and token efficiency. Supports Claude, OpenAI, Gemini, and xAI models.', 'mxchat'); ?></p>
562 <?php if (!$pro_tool_use): ?>
563 <?php if ($is_activated): ?>
564 <a href="https://mxchat.ai/" target="_blank" class="mxch-cg-pro-upgrade-link"><?php esc_html_e('Install Add-on', 'mxchat'); ?></a>
565 <?php else: ?>
566 <a href="https://mxchat.ai/" target="_blank" class="mxch-cg-pro-upgrade-link"><?php esc_html_e('Upgrade to Pro', 'mxchat'); ?></a>
567 <?php endif; ?>
568 <?php endif; ?>
569 </div>
570
571 </div>
572 </div>
573
574 <!-- ── SEO Settings ── -->
575 <div class="mxch-card" style="margin-top: 16px;">
576 <div class="mxch-card-header">
577 <h3 class="mxch-card-title"><?php esc_html_e('SEO', 'mxchat'); ?></h3>
578 </div>
579 <div class="mxch-card-body">
580
581 <?php if (!$pro_gsc_integration): ?>
582 <!-- Google Search Console (Pro/Add-on) -->
583 <div class="mxch-field mxch-gsc-settings-locked">
584 <div class="mxch-gsc-settings-locked-header">
585 <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" 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>
586 <span><?php esc_html_e('Google Search Console', 'mxchat'); ?></span>
587 <span class="mxch-cg-pro-badge"><?php echo $is_activated ? esc_html__('ADD-ON', 'mxchat') : esc_html__('PRO', 'mxchat'); ?></span>
588 </div>
589 <p class="mxch-field-description"><?php esc_html_e('Connect Google Search Console to see real search performance data — clicks, impressions, CTR, and keyword rankings — directly in your SEO dashboard.', 'mxchat'); ?></p>
590 <button type="button" class="mxch-gsc-connect-btn" disabled>
591 <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" 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>
592 <?php esc_html_e('Connect Google Search Console', 'mxchat'); ?>
593 </button>
594 <?php if ($is_activated): ?>
595 <a href="https://mxchat.ai/" target="_blank" class="mxch-cg-pro-upgrade-link"><?php esc_html_e('Install Add-on', 'mxchat'); ?></a>
596 <?php else: ?>
597 <a href="https://mxchat.ai/" target="_blank" class="mxch-cg-pro-upgrade-link"><?php esc_html_e('Upgrade to Pro', 'mxchat'); ?></a>
598 <?php endif; ?>
599 </div>
600 <?php endif; ?>
601
602 <!-- AI Optimize Fields -->
603 <?php
604 $seo_opt_meta = $options['seo_optimize_meta_desc'] ?? 'on';
605 $seo_opt_title = $options['seo_optimize_seo_title'] ?? 'on';
606 $seo_opt_slug = $options['seo_optimize_slug'] ?? 'on';
607 $seo_opt_read = $options['seo_optimize_readability'] ?? 'on';
608 $seo_opt_links = $options['seo_optimize_internal_links'] ?? 'on';
609 $seo_opt_imgalt = $options['seo_optimize_img_alt'] ?? 'on';
610 $seo_opt_feat = $options['seo_optimize_featured_img'] ?? 'on';
611 $has_addon = $pro_internal_linking; // any addon feature unlocked means addon is present
612 ?>
613 <div class="mxch-field">
614 <label class="mxch-field-label"><?php esc_html_e('AI Optimize', 'mxchat'); ?></label>
615 <p class="mxch-field-description" style="margin-bottom: 10px;"><?php esc_html_e('Choose which checks AI Optimize will fix when run.', 'mxchat'); ?></p>
616 <div class="mxch-seo-opt-grid">
617 <label class="mxch-seo-opt-item">
618 <input type="checkbox" class="mxch-seo-opt-check" data-field="seo_optimize_meta_desc" <?php checked($seo_opt_meta, 'on'); ?>>
619 <span><?php esc_html_e('Meta Description', 'mxchat'); ?></span>
620 </label>
621 <label class="mxch-seo-opt-item">
622 <input type="checkbox" class="mxch-seo-opt-check" data-field="seo_optimize_seo_title" <?php checked($seo_opt_title, 'on'); ?>>
623 <span><?php esc_html_e('SEO Title', 'mxchat'); ?></span>
624 </label>
625 <label class="mxch-seo-opt-item">
626 <input type="checkbox" class="mxch-seo-opt-check" data-field="seo_optimize_slug" <?php checked($seo_opt_slug, 'on'); ?>>
627 <span><?php esc_html_e('URL Slug', 'mxchat'); ?></span>
628 </label>
629 <label class="mxch-seo-opt-item<?php echo $has_addon ? '' : ' mxch-seo-opt-locked'; ?>">
630 <input type="checkbox" class="mxch-seo-opt-check" data-field="seo_optimize_readability" <?php checked($seo_opt_read, 'on'); ?><?php echo $has_addon ? '' : ' disabled'; ?>>
631 <span><?php esc_html_e('Readability', 'mxchat'); ?></span>
632 <?php if (!$has_addon): ?>
633 <span class="mxch-cg-pro-badge"><?php echo $is_activated ? esc_html__('ADD-ON', 'mxchat') : esc_html__('PRO', 'mxchat'); ?></span>
634 <?php endif; ?>
635 </label>
636 <label class="mxch-seo-opt-item<?php echo $has_addon ? '' : ' mxch-seo-opt-locked'; ?>">
637 <input type="checkbox" class="mxch-seo-opt-check" data-field="seo_optimize_internal_links" <?php checked($seo_opt_links, 'on'); ?><?php echo $has_addon ? '' : ' disabled'; ?>>
638 <span><?php esc_html_e('Internal Links', 'mxchat'); ?></span>
639 <?php if (!$has_addon): ?>
640 <span class="mxch-cg-pro-badge"><?php echo $is_activated ? esc_html__('ADD-ON', 'mxchat') : esc_html__('PRO', 'mxchat'); ?></span>
641 <?php endif; ?>
642 </label>
643 <label class="mxch-seo-opt-item<?php echo $has_addon ? '' : ' mxch-seo-opt-locked'; ?>">
644 <input type="checkbox" class="mxch-seo-opt-check" data-field="seo_optimize_img_alt" <?php checked($seo_opt_imgalt, 'on'); ?><?php echo $has_addon ? '' : ' disabled'; ?>>
645 <span><?php esc_html_e('Image ALT Text', 'mxchat'); ?></span>
646 <?php if (!$has_addon): ?>
647 <span class="mxch-cg-pro-badge"><?php echo $is_activated ? esc_html__('ADD-ON', 'mxchat') : esc_html__('PRO', 'mxchat'); ?></span>
648 <?php endif; ?>
649 </label>
650 <label class="mxch-seo-opt-item<?php echo $has_addon ? '' : ' mxch-seo-opt-locked'; ?>">
651 <input type="checkbox" class="mxch-seo-opt-check" data-field="seo_optimize_featured_img" <?php checked($seo_opt_feat, 'on'); ?><?php echo $has_addon ? '' : ' disabled'; ?>>
652 <span><?php esc_html_e('Featured Image', 'mxchat'); ?></span>
653 <?php if (!$has_addon): ?>
654 <span class="mxch-cg-pro-badge"><?php echo $is_activated ? esc_html__('ADD-ON', 'mxchat') : esc_html__('PRO', 'mxchat'); ?></span>
655 <?php endif; ?>
656 </label>
657 </div>
658 </div>
659
660 </div>
661 </div>
662 </div>
663
664 <!-- ========================================
665 SEO
666 ======================================== -->
667 <div id="content-seo" class="mxch-section">
668 <div class="mxch-content-header">
669 <h1 class="mxch-content-title"><?php esc_html_e('SEO Analysis', 'mxchat'); ?></h1>
670 <p class="mxch-content-subtitle"><?php esc_html_e('Analyze and optimize SEO for all your content.', 'mxchat'); ?></p>
671 </div>
672
673 <div class="mxch-card">
674 <div class="mxch-card-body" style="padding:0;">
675 <!-- Filter Bar -->
676 <div class="mxch-seod-filters">
677 <div class="mxch-seod-filters-left">
678 <select id="mxch-seod-post-type" class="mxch-seod-select">
679 <option value="any"><?php esc_html_e('All Types', 'mxchat'); ?></option>
680 <option value="post"><?php esc_html_e('Posts', 'mxchat'); ?></option>
681 <option value="page"><?php esc_html_e('Pages', 'mxchat'); ?></option>
682 </select>
683 <div class="mxch-seod-filter-pills">
684 <button type="button" class="mxch-seod-pill active" data-filter="all"><?php esc_html_e('All', 'mxchat'); ?></button>
685 <button type="button" class="mxch-seod-pill" data-filter="issues"><?php esc_html_e('Issues', 'mxchat'); ?></button>
686 <button type="button" class="mxch-seod-pill" data-filter="good"><?php esc_html_e('Good', 'mxchat'); ?></button>
687 <button type="button" class="mxch-seod-pill" data-filter="unscored"><?php esc_html_e('Not Scanned', 'mxchat'); ?></button>
688 </div>
689 </div>
690 <div class="mxch-seod-filters-right">
691 <div class="mxch-seod-search-wrap">
692 <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" 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>
693 <input type="text" id="mxch-seod-search" class="mxch-seod-search" placeholder="<?php esc_attr_e('Search posts...', 'mxchat'); ?>">
694 </div>
695 </div>
696 </div>
697
698 <!-- Posts Table -->
699 <div class="mxch-seod-table-wrap">
700 <div id="mxch-seod-table" class="mxch-seod-table">
701 <!-- Rendered by JS -->
702 </div>
703 <div id="mxch-seod-loading" class="mxch-seod-loading">
704 <div class="mxch-cg-history-spinner"></div>
705 <p><?php esc_html_e('Loading posts...', 'mxchat'); ?></p>
706 </div>
707 <div id="mxch-seod-empty" class="mxch-seod-empty" style="display:none;">
708 <svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20V10"/><path d="M18 20V4"/><path d="M6 20v-4"/></svg>
709 <p><?php esc_html_e('No posts found matching your filters.', 'mxchat'); ?></p>
710 </div>
711 </div>
712
713 <!-- Footer: Scan + Pagination -->
714 <div class="mxch-seod-footer" id="mxch-seod-footer" style="display:none;">
715 <div class="mxch-seod-footer-left">
716 <button type="button" class="mxch-seod-scan-btn" id="mxch-seod-scan-all">
717 <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20V10"/><path d="M18 20V4"/><path d="M6 20v-4"/></svg>
718 <span><?php esc_html_e('Scan Unscored', 'mxchat'); ?></span>
719 </button>
720 <span class="mxch-seod-scan-status" id="mxch-seod-scan-status"></span>
721 </div>
722 <div class="mxch-seod-pagination" id="mxch-seod-pagination">
723 <!-- Rendered by JS -->
724 </div>
725 </div>
726 </div>
727 </div>
728 </div>
729
730 </main>
731 </div>
732 <?php
733 }
734