PluginProbe
MxChat – AI Chatbot & Content Generation for WordPress / 3.0.3
MxChat – AI Chatbot & Content Generation for WordPress v3.0.3
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
← All changes | includes/admin-transcripts-page.php +6 -404 3.2.203.0.3 View file →
@@ -60,12 +60,8 @@
60 60 <button class="mxch-mobile-nav-link" data-target="all-chats">
61 61 <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="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>
62 62 <span><?php esc_html_e('All Chats', 'mxchat'); ?></span>
63 63 </button>
64 - <button class="mxch-mobile-nav-link" data-target="leads">
65 - <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="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><polyline points="17 11 19 13 23 9"/></svg>
66 - <span><?php esc_html_e('Leads', 'mxchat'); ?></span>
67 - </button>
68 64 </div>
69 65 <!-- Settings Section -->
70 66 <div class="mxch-mobile-nav-section">
71 67 <div class="mxch-mobile-nav-section-title"><?php esc_html_e('Settings', 'mxchat'); ?></div>
@@ -124,18 +120,8 @@
124 120 <span class="mxch-nav-link-text"><?php esc_html_e('All Chats', 'mxchat'); ?></span>
125 121 <span class="mxch-nav-link-badge"><?php echo esc_html($total_chats); ?></span>
126 122 </button>
127 123 </div>
128 -
129 - <div class="mxch-nav-item" data-section="leads">
130 - <button class="mxch-nav-link" data-target="leads">
131 - <span class="mxch-nav-link-icon">
132 - <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="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><polyline points="17 11 19 13 23 9"/></svg>
133 - </span>
134 - <span class="mxch-nav-link-text"><?php esc_html_e('Leads', 'mxchat'); ?></span>
135 - <span class="mxch-nav-link-badge" id="mxch-leads-nav-badge" style="display:none;">0</span>
136 - </button>
137 - </div>
138 124 </div>
139 125
140 126 <!-- Settings Section -->
141 127 <div class="mxch-nav-section">
@@ -321,65 +307,8 @@
321 307 </div>
322 308 </div>
323 309 </div>
324 310
325 - <!-- Satisfaction (last 30 days) — plan-a5b006 -->
326 - <div class="mxch-card mxch-satisfaction-card">
327 - <div class="mxch-card-header">
328 - <h3 class="mxch-card-title">
329 - <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="M7 10v12"/><path d="M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H7"/><path d="M3 10h4"/></svg>
330 - <?php esc_html_e('Satisfaction (last 30 days)', 'mxchat'); ?>
331 - </h3>
332 - </div>
333 - <div class="mxch-card-body">
334 - <?php
335 - $satisfaction_stats = isset($satisfaction_stats) && is_array($satisfaction_stats) ? $satisfaction_stats : array();
336 - if (empty($satisfaction_stats)) :
337 - ?>
338 - <p class="mxch-satisfaction-empty">
339 - <?php esc_html_e('No ratings yet. The widget shows the prompt after a conversation has had at least two bot replies and the visitor goes idle for 60 seconds.', 'mxchat'); ?>
340 - </p>
341 - <?php
342 - else :
343 - ?>
344 - <ul class="mxch-satisfaction-list">
345 - <?php foreach ($satisfaction_stats as $row) :
346 - $bot_label = $row['bot_id'] === 'default'
347 - ? esc_html__('Default bot', 'mxchat')
348 - : esc_html($row['bot_id']);
349 - ?>
350 - <li class="mxch-satisfaction-row">
351 - <span class="mxch-satisfaction-bot"><?php echo $bot_label; ?></span>
352 - <span class="mxch-satisfaction-meta">
353 - <span class="mxch-satisfaction-total"><?php
354 - echo esc_html(sprintf(
355 - /* translators: %d: number of rated sessions */
356 - _n('%d rated session', '%d rated sessions', $row['total'], 'mxchat'),
357 - $row['total']
358 - ));
359 - ?></span>
360 - <span class="mxch-satisfaction-bar" aria-hidden="true">
361 - <span class="mxch-satisfaction-bar-up" style="width: <?php echo esc_attr($row['positive_pct']); ?>%;"></span>
362 - <span class="mxch-satisfaction-bar-down" style="width: <?php echo esc_attr($row['negative_pct']); ?>%;"></span>
363 - </span>
364 - <span class="mxch-satisfaction-pct mxch-satisfaction-pct-up" title="<?php esc_attr_e('Positive ratings', 'mxchat'); ?>">
365 - <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 10v12"/><path d="M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H7"/><path d="M3 10h4"/></svg>
366 - <?php echo esc_html($row['positive_pct']); ?>%
367 - </span>
368 - <span class="mxch-satisfaction-pct mxch-satisfaction-pct-down" title="<?php esc_attr_e('Negative ratings', 'mxchat'); ?>">
369 - <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 14V2"/><path d="M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H17"/><path d="M21 14h-4"/></svg>
370 - <?php echo esc_html($row['negative_pct']); ?>%
371 - </span>
372 - </span>
373 - </li>
374 - <?php endforeach; ?>
375 - </ul>
376 - <?php
377 - endif;
378 - ?>
379 - </div>
380 - </div>
381 -
382 311 <!-- Activity Chart -->
383 312 <div class="mxch-card mxch-activity-chart-card">
384 313 <div class="mxch-card-header">
385 314 <h3 class="mxch-card-title">
@@ -530,12 +459,8 @@
530 459 <div class="mxch-detail-row" id="mxch-detail-email-row" style="display: none;">
531 460 <span class="mxch-detail-label"><?php esc_html_e('Email', 'mxchat'); ?></span>
532 461 <span class="mxch-detail-value" id="mxch-detail-email">-</span>
533 462 </div>
534 - <div class="mxch-detail-row" id="mxch-detail-feedback-row" style="display: none;">
535 - <span class="mxch-detail-label"><?php esc_html_e('Feedback', 'mxchat'); ?></span>
536 - <span class="mxch-detail-value mxch-detail-feedback-value" id="mxch-detail-feedback">-</span>
537 - </div>
538 463 </div>
539 464 <div class="mxch-details-section" id="mxch-clicked-section" style="display: none;">
540 465 <h4><?php esc_html_e('Clicked Links', 'mxchat'); ?></h4>
541 466 <div class="mxch-clicked-links" id="mxch-clicked-links">
@@ -551,42 +476,8 @@
551 476 <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 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>
552 477 <?php esc_html_e('Export', 'mxchat'); ?>
553 478 </button>
554 479 </div>
555 - <div class="mxch-translate-section">
556 - <div class="mxch-translate-controls">
557 - <select id="mxch-translate-lang" class="mxch-translate-select" title="<?php esc_attr_e('Target language', 'mxchat'); ?>">
558 - <option value="en">English</option>
559 - <option value="es">Español</option>
560 - <option value="fr">Français</option>
561 - <option value="de">Deutsch</option>
562 - <option value="it">Italiano</option>
563 - <option value="pt">Português</option>
564 - <option value="nl">Nederlands</option>
565 - <option value="ru">Русский</option>
566 - <option value="zh">中文</option>
567 - <option value="ja">日本語</option>
568 - <option value="ko">한국어</option>
569 - <option value="ar">العربية</option>
570 - <option value="hi">हिन्दी</option>
571 - <option value="tr">Türkçe</option>
572 - <option value="pl">Polski</option>
573 - <option value="vi">Tiếng Việt</option>
574 - <option value="th">ไทย</option>
575 - <option value="id">Bahasa Indonesia</option>
576 - <option value="sv">Svenska</option>
577 - <option value="da">Dansk</option>
578 - </select>
579 - <button type="button" id="mxch-translate-btn" class="mxch-btn mxch-btn-primary mxch-btn-sm">
580 - <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="m5 8 6 6"/><path d="m4 14 6-6 2-3"/><path d="M2 5h12"/><path d="M7 2h1"/><path d="m22 22-5-10-5 10"/><path d="M14 18h6"/></svg>
581 - <span class="mxch-translate-text"><?php esc_html_e('Translate', 'mxchat'); ?></span>
582 - </button>
583 - <button type="button" id="mxch-show-original-btn" class="mxch-btn mxch-btn-secondary mxch-btn-sm" style="display: none;">
584 - <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="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/></svg>
585 - <?php esc_html_e('Original', 'mxchat'); ?>
586 - </button>
587 - </div>
588 - </div>
589 480 </div>
590 481
591 482 <!-- Messages Area -->
592 483 <div class="mxch-messages-area" id="mxch-messages-area">
@@ -596,204 +487,10 @@
596 487 </div>
597 488 </div>
598 489
599 490 <?php wp_nonce_field('mxchat_delete_chat_history', 'mxchat_delete_chat_nonce'); ?>
600 -
601 - <!-- Transcript delete confirm modal (shared by bulk + individual delete) -->
602 - <div id="mxch-transcript-confirm" class="mxch-modal-overlay" style="display:none;">
603 - <div class="mxch-modal-content mxch-leads-confirm-box">
604 - <div class="mxch-modal-header">
605 - <h2 id="mxch-transcript-confirm-title"><?php esc_html_e('Delete conversation?', 'mxchat'); ?></h2>
606 - <button type="button" class="mxch-modal-close" data-mxch-transcript-close>&times;</button>
607 - </div>
608 - <div class="mxch-modal-body">
609 - <p id="mxch-transcript-confirm-body"></p>
610 - <label class="mxch-transcript-confirm-check">
611 - <input type="checkbox" id="mxch-transcript-also-delete-lead">
612 - <span>
613 - <strong><?php esc_html_e('Also remove the lead from the Leads tab', 'mxchat'); ?></strong>
614 - <em class="mxch-transcript-confirm-sublabel"><?php esc_html_e('By default, leads are kept and marked "Chat deleted" so your contact list is preserved.', 'mxchat'); ?></em>
615 - </span>
616 - </label>
617 - <p class="mxch-leads-confirm-warning"><?php esc_html_e('This cannot be undone.', 'mxchat'); ?></p>
618 - </div>
619 - <div class="mxch-leads-confirm-actions">
620 - <button type="button" class="mxch-btn mxch-btn-secondary" data-mxch-transcript-close><?php esc_html_e('Cancel', 'mxchat'); ?></button>
621 - <button type="button" class="mxch-btn mxch-btn-danger" id="mxch-transcript-confirm-go"><?php esc_html_e('Delete', 'mxchat'); ?></button>
622 - </div>
623 - </div>
624 - </div>
625 491 </div>
626 492
627 - <!-- Leads Section -->
628 - <div id="leads" class="mxch-section">
629 - <div class="mxch-content-header">
630 - <h1 class="mxch-content-title"><?php esc_html_e('Leads', 'mxchat'); ?></h1>
631 - <p class="mxch-content-subtitle"><?php esc_html_e('Captured visitor emails and names from the lead-capture form, grouped by unique lead.', 'mxchat'); ?></p>
632 - </div>
633 -
634 - <!-- Stats strip -->
635 - <div class="mxch-leads-stats">
636 - <div class="mxch-stat-card">
637 - <div class="mxch-stat-icon mxch-stat-icon-primary">
638 - <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="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>
639 - </div>
640 - <div class="mxch-stat-content">
641 - <span class="mxch-stat-value" id="mxch-leads-stat-total">0</span>
642 - <span class="mxch-stat-label"><?php esc_html_e('Total Leads', 'mxchat'); ?></span>
643 - </div>
644 - </div>
645 - <div class="mxch-stat-card">
646 - <div class="mxch-stat-icon mxch-stat-icon-success">
647 - <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"><polyline points="23 6 13.5 15.5 8.5 10.5 1 18"/><polyline points="17 6 23 6 23 12"/></svg>
648 - </div>
649 - <div class="mxch-stat-content">
650 - <span class="mxch-stat-value" id="mxch-leads-stat-new">0</span>
651 - <span class="mxch-stat-label"><?php esc_html_e('New This Week', 'mxchat'); ?></span>
652 - </div>
653 - </div>
654 - <div class="mxch-stat-card">
655 - <div class="mxch-stat-icon mxch-stat-icon-info">
656 - <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="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>
657 - </div>
658 - <div class="mxch-stat-content">
659 - <span class="mxch-stat-value" id="mxch-leads-stat-avg">0</span>
660 - <span class="mxch-stat-label"><?php esc_html_e('Avg Convos / Lead', 'mxchat'); ?></span>
661 - </div>
662 - </div>
663 - <div class="mxch-stat-card">
664 - <div class="mxch-stat-icon mxch-stat-icon-warning">
665 - <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"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>
666 - </div>
667 - <div class="mxch-stat-content">
668 - <span class="mxch-stat-value" id="mxch-leads-stat-orphan">0%</span>
669 - <span class="mxch-stat-label"><?php esc_html_e('Orphan Leads', 'mxchat'); ?></span>
670 - <span class="mxch-stat-sublabel" id="mxch-leads-stat-orphan-sub"><?php esc_html_e('Captured but never chatted', 'mxchat'); ?></span>
671 - </div>
672 - </div>
673 - </div>
674 -
675 - <!-- Top pages card -->
676 - <div class="mxch-card mxch-leads-toppages">
677 - <div class="mxch-card-header">
678 - <h3 class="mxch-card-title">
679 - <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="M3 3h18v18H3z"/><path d="M3 9h18"/><path d="M9 21V9"/></svg>
680 - <?php esc_html_e('Top Pages Capturing Leads', 'mxchat'); ?>
681 - </h3>
682 - <span class="mxch-leads-toppages-hint"><?php esc_html_e('Click a page to filter the list below', 'mxchat'); ?></span>
683 - </div>
684 - <div class="mxch-card-body">
685 - <div class="mxch-leads-toppages-list" id="mxch-leads-toppages-list">
686 - <div class="mxch-leads-empty-mini"><?php esc_html_e('No page data yet.', 'mxchat'); ?></div>
687 - </div>
688 - </div>
689 - </div>
690 -
691 - <!-- Leads toolbar + table -->
692 - <div class="mxch-card mxch-leads-card">
693 - <div class="mxch-leads-toolbar">
694 - <div class="mxch-leads-toolbar-left">
695 - <label class="mxch-bulk-select-all">
696 - <input type="checkbox" id="mxch-leads-select-all">
697 - <span><?php esc_html_e('All', 'mxchat'); ?></span>
698 - </label>
699 - <span class="mxch-selected-count" id="mxch-leads-selected-count">0</span>
700 - <button type="button" class="mxch-bulk-btn mxch-bulk-delete" id="mxch-leads-delete-selected" disabled title="<?php esc_attr_e('Delete Selected', 'mxchat'); ?>">
701 - <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="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>
702 - <span><?php esc_html_e('Delete', 'mxchat'); ?></span>
703 - </button>
704 - </div>
705 - <div class="mxch-leads-toolbar-right">
706 - <div class="mxch-leads-export" id="mxch-leads-export-wrap">
707 - <button type="button" class="mxch-btn mxch-btn-secondary mxch-btn-sm" id="mxch-leads-export-btn">
708 - <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 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>
709 - <?php esc_html_e('Export', 'mxchat'); ?>
710 - <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>
711 - </button>
712 - <div class="mxch-leads-export-menu" id="mxch-leads-export-menu">
713 - <button type="button" data-fields="email_and_name" data-scope="all"><?php esc_html_e('All leads — email + name', 'mxchat'); ?></button>
714 - <button type="button" data-fields="email_only" data-scope="all"><?php esc_html_e('All leads — email only', 'mxchat'); ?></button>
715 - <button type="button" data-fields="email_and_name" data-scope="selected" disabled><?php esc_html_e('Selected — email + name', 'mxchat'); ?></button>
716 - <button type="button" data-fields="email_only" data-scope="selected" disabled><?php esc_html_e('Selected — email only', 'mxchat'); ?></button>
717 - </div>
718 - </div>
719 - </div>
720 - </div>
721 -
722 - <div class="mxch-leads-filters">
723 - <div class="mxch-search-wrapper">
724 - <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"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
725 - <input type="text" id="mxch-leads-search" class="mxch-search-input" placeholder="<?php esc_attr_e('Search by email or name...', 'mxchat'); ?>">
726 - </div>
727 - <select id="mxch-leads-date-range" class="mxch-select">
728 - <option value="all"><?php esc_html_e('All time', 'mxchat'); ?></option>
729 - <option value="today"><?php esc_html_e('Last 24 hours', 'mxchat'); ?></option>
730 - <option value="7d"><?php esc_html_e('Last 7 days', 'mxchat'); ?></option>
731 - <option value="30d"><?php esc_html_e('Last 30 days', 'mxchat'); ?></option>
732 - <option value="90d"><?php esc_html_e('Last 90 days', 'mxchat'); ?></option>
733 - </select>
734 - <select id="mxch-leads-status" class="mxch-select">
735 - <option value="all"><?php esc_html_e('All leads', 'mxchat'); ?></option>
736 - <option value="with"><?php esc_html_e('With conversation', 'mxchat'); ?></option>
737 - <option value="chat_deleted"><?php esc_html_e('Chat deleted', 'mxchat'); ?></option>
738 - <option value="orphan"><?php esc_html_e('Orphan (no chat)', 'mxchat'); ?></option>
739 - </select>
740 - <button type="button" class="mxch-btn mxch-btn-ghost mxch-btn-sm" id="mxch-leads-clear-filters" style="display:none;">
741 - <?php esc_html_e('Clear filters', 'mxchat'); ?>
742 - </button>
743 - <span class="mxch-leads-active-page-filter" id="mxch-leads-active-page-filter" style="display:none;">
744 - <span class="mxch-leads-page-chip-label"></span>
745 - <button type="button" class="mxch-leads-page-chip-remove" aria-label="<?php esc_attr_e('Remove page filter', 'mxchat'); ?>">&times;</button>
746 - </span>
747 - </div>
748 -
749 - <div class="mxch-leads-table-wrap">
750 - <table class="mxch-leads-table" id="mxch-leads-table">
751 - <thead>
752 - <tr>
753 - <th class="mxch-leads-col-check"></th>
754 - <th class="mxch-leads-col-lead"><?php esc_html_e('Lead', 'mxchat'); ?></th>
755 - <th class="mxch-leads-col-count"><?php esc_html_e('Conversations', 'mxchat'); ?></th>
756 - <th class="mxch-leads-col-last"><?php esc_html_e('Last seen', 'mxchat'); ?></th>
757 - <th class="mxch-leads-col-page"><?php esc_html_e('Top page', 'mxchat'); ?></th>
758 - <th class="mxch-leads-col-consent"><?php esc_html_e('Consent', 'mxchat'); ?></th>
759 - <th class="mxch-leads-col-actions"></th>
760 - </tr>
761 - </thead>
762 - <tbody id="mxch-leads-tbody">
763 - <tr><td colspan="7" class="mxch-leads-loading"><span class="spinner is-active"></span></td></tr>
764 - </tbody>
765 - </table>
766 - </div>
767 -
768 - <div class="mxch-panel-footer">
769 - <span class="mxch-leads-count" id="mxch-leads-count">0 leads</span>
770 - <div class="mxch-pagination-simple" id="mxch-leads-pagination"></div>
771 - </div>
772 - </div>
773 -
774 - <!-- Delete confirm modal -->
775 - <div id="mxch-leads-confirm" class="mxch-modal-overlay" style="display:none;">
776 - <div class="mxch-modal-content mxch-leads-confirm-box">
777 - <div class="mxch-modal-header">
778 - <h2><?php esc_html_e('Delete leads', 'mxchat'); ?></h2>
779 - <button type="button" class="mxch-modal-close" data-mxch-leads-close>&times;</button>
780 - </div>
781 - <div class="mxch-modal-body">
782 - <p id="mxch-leads-confirm-body"></p>
783 - <p class="mxch-leads-confirm-warning"><?php esc_html_e('This cannot be undone.', 'mxchat'); ?></p>
784 - </div>
785 - <div class="mxch-leads-confirm-actions">
786 - <button type="button" class="mxch-btn mxch-btn-secondary" data-mxch-leads-close><?php esc_html_e('Cancel', 'mxchat'); ?></button>
787 - <button type="button" class="mxch-btn mxch-btn-danger" id="mxch-leads-confirm-go"><?php esc_html_e('Delete permanently', 'mxchat'); ?></button>
788 - </div>
789 - </div>
790 - </div>
791 -
792 - <?php wp_nonce_field('mxchat_delete_leads', 'mxchat_leads_delete_nonce'); ?>
793 - <?php wp_nonce_field('mxchat_export_leads', 'mxchat_leads_export_nonce'); ?>
794 - </div>
795 -
796 493 <!-- Notifications Section -->
797 494 <div id="notifications" class="mxch-section">
798 495 <div class="mxch-content-header">
799 496 <h1 class="mxch-content-title"><?php esc_html_e('Notification Settings', 'mxchat'); ?></h1>
@@ -833,15 +530,14 @@
833 530 </div>
834 531
835 532 <div class="mxch-field">
836 533 <label class="mxch-field-label"><?php esc_html_e('Notification Email', 'mxchat'); ?></label>
837 - <?php /* type="text", not "email": the browser rejects a comma-separated list outright (plan 2f131a). Validation is server-side in MxChat_Utils. */ ?>
838 - <input type="text"
534 + <input type="email"
839 535 name="mxchat_transcripts_options[mxchat_notification_email]"
840 536 class="mxch-input mxchat-autosave-field"
841 537 value="<?php echo esc_attr($email); ?>"
842 538 data-nonce="<?php echo wp_create_nonce('mxchat_autosave_nonce'); ?>">
843 - <p class="mxch-field-description"><?php printf(esc_html__('Email address where notifications will be sent. Separate up to %d addresses with commas. Defaults to the site admin email.', 'mxchat'), (int) MxChat_Utils::NOTIFICATION_EMAIL_MAX); ?></p>
539 + <p class="mxch-field-description"><?php esc_html_e('Email address where notifications will be sent.', 'mxchat'); ?></p>
844 540 </div>
845 541 </div>
846 542 </div>
847 543
@@ -913,9 +609,8 @@
913 609 </div>
914 610 <div class="mxch-card-body">
915 611 <?php
916 612 $auto_delete = isset($options['mxchat_auto_delete_transcripts']) ? $options['mxchat_auto_delete_transcripts'] : 'never';
917 - $mxch_custom_retention = isset($options['mxchat_retention_days']) ? (int) $options['mxchat_retention_days'] : 0;
918 613 ?>
919 614 <div class="mxch-field">
920 615 <label class="mxch-field-label"><?php esc_html_e('Auto-Delete Old Transcripts', 'mxchat'); ?></label>
921 616 <select name="mxchat_transcripts_options[mxchat_auto_delete_transcripts]"
@@ -926,79 +621,11 @@
926 621 <option value="2weeks" <?php selected($auto_delete, '2weeks'); ?>><?php esc_html_e('After 2 Weeks', 'mxchat'); ?></option>
927 622 <option value="1month" <?php selected($auto_delete, '1month'); ?>><?php esc_html_e('After 1 Month', 'mxchat'); ?></option>
928 623 </select>
929 624 <p class="mxch-field-description"><?php esc_html_e('Automatically delete old chat transcripts to manage database size and privacy.', 'mxchat'); ?></p>
930 - <?php if ($mxch_custom_retention > 0) : ?>
931 - <p class="mxch-field-description" id="mxchat-retention-override-note">
932 - <strong><?php
933 - printf(
934 - /* translators: %d: the custom retention value in days */
935 - esc_html__('Overridden by Custom Retention below: transcripts are deleted after %d days.', 'mxchat'),
936 - $mxch_custom_retention
937 - );
938 - ?></strong>
939 - </p>
940 - <?php endif; ?>
941 - <?php
942 - // Surface the cron's real state next to the setting that
943 - // depends on it (plan-bc08a6): a configured retention whose
944 - // cleanup event is missing was previously invisible.
945 - $mxch_retention_days = isset($options['mxchat_retention_days']) ? (int) $options['mxchat_retention_days'] : 0;
946 - if ($auto_delete !== 'never' || $mxch_retention_days > 0) :
947 - $mxch_next_cleanup = wp_next_scheduled('mxchat_cleanup_old_transcripts');
948 - ?>
949 - <p class="mxch-field-description" id="mxchat-next-cleanup-status">
950 - <?php
951 - if ($mxch_next_cleanup) {
952 - printf(
953 - /* translators: %s: localized date and time of the next scheduled transcript cleanup */
954 - esc_html__('Next cleanup: %s', 'mxchat'),
955 - esc_html(wp_date(get_option('date_format') . ' ' . get_option('time_format'), $mxch_next_cleanup))
956 - );
957 - } else {
958 - esc_html_e('Next cleanup: not currently scheduled.', 'mxchat');
959 - }
960 - ?>
961 - </p>
962 - <?php endif; ?>
963 625 </div>
964 -
965 - <div class="mxch-field">
966 - <label class="mxch-field-label" for="mxchat_retention_days"><?php esc_html_e('Custom Retention (Days)', 'mxchat'); ?></label>
967 - <input type="number"
968 - id="mxchat_retention_days"
969 - name="mxchat_transcripts_options[mxchat_retention_days]"
970 - class="mxch-input mxchat-autosave-field"
971 - value="<?php echo esc_attr($mxch_custom_retention); ?>"
972 - min="0"
973 - max="3650"
974 - step="1"
975 - data-nonce="<?php echo wp_create_nonce('mxchat_autosave_nonce'); ?>">
976 - <p class="mxch-field-description"><?php esc_html_e('Delete transcripts older than this many days (1&ndash;3650). When greater than 0 this overrides the dropdown above; set 0 to use the dropdown. Developers can adjust the final value with the mxchat_transcript_retention_days filter.', 'mxchat'); ?></p>
977 - </div>
978 626 </div>
979 627 </div>
980 -
981 - <!-- Privacy & Data Requests Card (plan b81e42) -->
982 - <div class="mxch-card">
983 - <div class="mxch-card-header">
984 - <h3 class="mxch-card-title">
985 - <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 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>
986 - <?php esc_html_e('Privacy & Data Requests', 'mxchat'); ?>
987 - </h3>
988 - </div>
989 - <div class="mxch-card-body">
990 - <div class="mxch-field">
991 - <p class="mxch-field-description">
992 - <?php esc_html_e('Chat conversations — including captured emails, names, and visitor identifiers — are registered with WordPress\'s built-in privacy tools. When you run a personal data export or erasure request from the Tools menu, MxChat data is included automatically, so honouring a GDPR or CCPA request covers the chatbot with no extra steps.', 'mxchat'); ?>
993 - </p>
994 - <p>
995 - <a href="<?php echo esc_url(admin_url('export-personal-data.php')); ?>" class="mxch-btn mxch-btn-secondary mxch-btn-sm"><?php esc_html_e('Export Personal Data', 'mxchat'); ?></a>
996 - <a href="<?php echo esc_url(admin_url('erase-personal-data.php')); ?>" class="mxch-btn mxch-btn-secondary mxch-btn-sm"><?php esc_html_e('Erase Personal Data', 'mxchat'); ?></a>
997 - </p>
998 - </div>
999 - </div>
1000 - </div>
1001 628 </div>
1002 629 </div>
1003 630 </main>
1004 631 </div>
@@ -1006,43 +633,18 @@
1006 633 <!-- RAG Context Modal -->
1007 634 <div id="mxch-rag-modal" class="mxch-modal-overlay" style="display: none;">
1008 635 <div class="mxch-modal-content">
1009 636 <div class="mxch-modal-header">
1010 - <h2><?php esc_html_e('Message Context', 'mxchat'); ?></h2>
637 + <h2><?php esc_html_e('Retrieved Documents', 'mxchat'); ?></h2>
1011 638 <button type="button" class="mxch-modal-close">&times;</button>
1012 639 </div>
1013 640 <div class="mxch-modal-body">
1014 - <!-- Tabs -->
1015 - <div class="mxch-context-tabs">
1016 - <button type="button" class="mxch-context-tab active" data-tab="sources">
1017 - <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"><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>
1018 - <?php esc_html_e('Sources', 'mxchat'); ?>
1019 - <span class="mxch-tab-badge" id="mxch-sources-count" style="display: none;">0</span>
1020 - </button>
1021 - <button type="button" class="mxch-context-tab" data-tab="actions">
1022 - <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>
1023 - <?php esc_html_e('Actions', 'mxchat'); ?>
1024 - <span class="mxch-tab-badge" id="mxch-actions-count" style="display: none;">0</span>
1025 - </button>
1026 - </div>
1027 -
1028 641 <div class="mxch-rag-loading" style="display: none;">
1029 642 <span class="spinner is-active"></span>
1030 - <?php esc_html_e('Loading context...', 'mxchat'); ?>
643 + <?php esc_html_e('Loading document context...', 'mxchat'); ?>
1031 644 </div>
1032 -
1033 - <!-- Sources Tab Content -->
1034 - <div class="mxch-tab-content" id="mxch-tab-sources">
1035 - <div class="mxch-rag-content">
1036 - <!-- RAG context will be populated via JavaScript -->
1037 - </div>
1038 - </div>
1039 -
1040 - <!-- Actions Tab Content -->
1041 - <div class="mxch-tab-content" id="mxch-tab-actions" style="display: none;">
1042 - <div class="mxch-actions-content">
1043 - <!-- Action scores will be populated via JavaScript -->
1044 - </div>
645 + <div class="mxch-rag-content">
646 + <!-- RAG context will be populated via JavaScript -->
1045 647 </div>
1046 648 </div>
1047 649 </div>
1048 650 </div>