| @@ -67,12 +67,8 @@ | ||
| 67 | 67 | <button class="mxch-mobile-nav-link" data-target="optimization"> |
| 68 | 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="M13 2L3 14h9l-1 8 10-12h-9l1-8z"/></svg> |
| 69 | 69 | <span><?php esc_html_e('Optimization', 'mxchat'); ?></span> |
| 70 | 70 | </button> |
| 71 | - <button class="mxch-mobile-nav-link" data-target="testing"> | |
| 72 | - <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="M9 2v6"/><path d="M15 2v6"/><path d="M12 17v5"/><path d="M5 8h14"/><path d="M6 11v-1a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v1"/><path d="m9 14 3 3 3-3"/></svg> | |
| 73 | - <span><?php esc_html_e('Testing', 'mxchat'); ?></span> | |
| 74 | - </button> | |
| 75 | 71 | </div> |
| 76 | 72 | <!-- Integrations Section --> |
| 77 | 73 | <div class="mxch-mobile-nav-section"> |
| 78 | 74 | <div class="mxch-mobile-nav-section-title"><?php esc_html_e('Integrations', 'mxchat'); ?></div> |
| @@ -159,17 +155,8 @@ | ||
| 159 | 155 | </span> |
| 160 | 156 | <span class="mxch-nav-link-text"><?php esc_html_e('Optimization', 'mxchat'); ?></span> |
| 161 | 157 | </button> |
| 162 | 158 | </div> |
| 163 | - | |
| 164 | - <div class="mxch-nav-item" data-section="testing"> | |
| 165 | - <button class="mxch-nav-link" data-target="testing"> | |
| 166 | - <span class="mxch-nav-link-icon"> | |
| 167 | - <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="M9 2v6"/><path d="M15 2v6"/><path d="M12 17v5"/><path d="M5 8h14"/><path d="M6 11v-1a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v1"/><path d="m9 14 3 3 3-3"/></svg> | |
| 168 | - </span> | |
| 169 | - <span class="mxch-nav-link-text"><?php esc_html_e('Testing', 'mxchat'); ?></span> | |
| 170 | - </button> | |
| 171 | - </div> | |
| 172 | 159 | </div> |
| 173 | 160 | |
| 174 | 161 | <!-- Integrations Section --> |
| 175 | 162 | <div class="mxch-nav-section"> |
| @@ -205,9 +192,8 @@ | ||
| 205 | 192 | <span class="mxch-nav-link-text"><?php esc_html_e('Tutorials', 'mxchat'); ?></span> |
| 206 | 193 | </button> |
| 207 | 194 | </div> |
| 208 | 195 | </div> |
| 209 | - | |
| 210 | 196 | </nav> |
| 211 | 197 | |
| 212 | 198 | <?php if (!$is_activated): ?> |
| 213 | 199 | <div class="mxch-sidebar-footer"> |
| @@ -313,8 +299,12 @@ | ||
| 313 | 299 | mxchat_render_field_wrapper('citation_links', __('Citation Links', 'mxchat'), function() use ($admin_instance) { |
| 314 | 300 | $admin_instance->mxchat_citation_links_toggle_callback(); |
| 315 | 301 | }, __('Allow the AI to include citation links from your knowledge database in responses. If disabled, ensure your AI Behavior settings do not mention links or the AI may fabricate URLs.', 'mxchat')); |
| 316 | 302 | |
| 303 | + // Frontend Debugger | |
| 304 | + mxchat_render_field_wrapper('frontend_debugger', __('Frontend Debugger', 'mxchat'), function() use ($admin_instance) { | |
| 305 | + $admin_instance->mxchat_frontend_debugger_callback(); | |
| 306 | + }, __('Show debug panel on frontend for admins. Displays similarity scores and query analysis.', 'mxchat')); | |
| 317 | 307 | ?> |
| 318 | 308 | </div> |
| 319 | 309 | </div> |
| 320 | 310 | </div> |
| @@ -1045,115 +1035,8 @@ | ||
| 1045 | 1035 | </a> |
| 1046 | 1036 | </div> |
| 1047 | 1037 | </div> |
| 1048 | 1038 | <?php endforeach; ?> |
| 1049 | - </div> | |
| 1050 | - </div> | |
| 1051 | - | |
| 1052 | - <!-- ===================================================== | |
| 1053 | - TESTING SECTION | |
| 1054 | - ===================================================== --> | |
| 1055 | - <div id="testing" class="mxch-section"> | |
| 1056 | - <div class="mxch-content-header"> | |
| 1057 | - <h1 class="mxch-content-title"><?php esc_html_e('Testing', 'mxchat'); ?></h1> | |
| 1058 | - <p class="mxch-content-subtitle"><?php esc_html_e('Test your chatbot and inspect debug data in real time.', 'mxchat'); ?></p> | |
| 1059 | - </div> | |
| 1060 | - | |
| 1061 | - <div class="mxch-testing-layout"> | |
| 1062 | - <!-- Left Column: Debug Panel --> | |
| 1063 | - <div class="mxch-testing-debug-panel"> | |
| 1064 | - <!-- Quick Actions --> | |
| 1065 | - <div class="mxch-card"> | |
| 1066 | - <div class="mxch-card-body"> | |
| 1067 | - <h3 class="mxch-testing-section-title"><?php esc_html_e('Quick Actions', 'mxchat'); ?></h3> | |
| 1068 | - <div class="mxch-testing-actions-row"> | |
| 1069 | - <button type="button" class="mxch-testing-btn mxch-testing-btn-danger" id="mxch-testing-clear-session"> | |
| 1070 | - <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 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/></svg> | |
| 1071 | - <?php esc_html_e('Clear Chat Session', 'mxchat'); ?> | |
| 1072 | - </button> | |
| 1073 | - <button type="button" class="mxch-testing-btn mxch-testing-btn-secondary" id="mxch-testing-clear-debug"> | |
| 1074 | - <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 2v20M2 12h20"/></svg> | |
| 1075 | - <?php esc_html_e('Clear Debug Log', 'mxchat'); ?> | |
| 1076 | - </button> | |
| 1077 | - </div> | |
| 1078 | - </div> | |
| 1079 | - </div> | |
| 1080 | - | |
| 1081 | - <!-- Last Query Analysis --> | |
| 1082 | - <div class="mxch-card"> | |
| 1083 | - <div class="mxch-card-body"> | |
| 1084 | - <h3 class="mxch-testing-section-title"><?php esc_html_e('Last Query Analysis', 'mxchat'); ?></h3> | |
| 1085 | - | |
| 1086 | - <div class="mxch-testing-field"> | |
| 1087 | - <label><?php esc_html_e('Similarity Threshold', 'mxchat'); ?></label> | |
| 1088 | - <span id="mxch-testing-threshold"><?php esc_html_e('Loading...', 'mxchat'); ?></span> | |
| 1089 | - </div> | |
| 1090 | - | |
| 1091 | - <div class="mxch-testing-field"> | |
| 1092 | - <label><?php esc_html_e('User Query', 'mxchat'); ?></label> | |
| 1093 | - <div id="mxch-testing-last-query" class="mxch-testing-query-display"><?php esc_html_e('Waiting for next query...', 'mxchat'); ?></div> | |
| 1094 | - </div> | |
| 1095 | - | |
| 1096 | - <div class="mxch-testing-field"> | |
| 1097 | - <label><?php esc_html_e('Approved URLs for Citations', 'mxchat'); ?></label> | |
| 1098 | - <div id="mxch-testing-approved-urls" class="mxch-testing-results"> | |
| 1099 | - <div class="mxch-testing-no-data"><?php esc_html_e('No URL data yet', 'mxchat'); ?></div> | |
| 1100 | - </div> | |
| 1101 | - </div> | |
| 1102 | - | |
| 1103 | - <div class="mxch-testing-field"> | |
| 1104 | - <label><?php esc_html_e('Document Matches', 'mxchat'); ?></label> | |
| 1105 | - <div id="mxch-testing-similarity-scores" class="mxch-testing-results"> | |
| 1106 | - <div class="mxch-testing-no-data"><?php esc_html_e('No query data yet', 'mxchat'); ?></div> | |
| 1107 | - </div> | |
| 1108 | - </div> | |
| 1109 | - | |
| 1110 | - <div class="mxch-testing-field"> | |
| 1111 | - <label><?php esc_html_e('Actions Triggered', 'mxchat'); ?></label> | |
| 1112 | - <div id="mxch-testing-action-scores" class="mxch-testing-results"> | |
| 1113 | - <div class="mxch-testing-no-data"><?php esc_html_e('No action data yet', 'mxchat'); ?></div> | |
| 1114 | - </div> | |
| 1115 | - </div> | |
| 1116 | - </div> | |
| 1117 | - </div> | |
| 1118 | - | |
| 1119 | - <!-- System Information --> | |
| 1120 | - <div class="mxch-card"> | |
| 1121 | - <div class="mxch-card-body"> | |
| 1122 | - <h3 class="mxch-testing-section-title"><?php esc_html_e('System Information', 'mxchat'); ?></h3> | |
| 1123 | - | |
| 1124 | - <div class="mxch-testing-field"> | |
| 1125 | - <label><?php esc_html_e('System Prompt', 'mxchat'); ?></label> | |
| 1126 | - <div id="mxch-testing-system-prompt" class="mxch-testing-system-prompt"><?php esc_html_e('Loading...', 'mxchat'); ?></div> | |
| 1127 | - </div> | |
| 1128 | - | |
| 1129 | - <div class="mxch-testing-field"> | |
| 1130 | - <label><?php esc_html_e('Knowledge Base', 'mxchat'); ?></label> | |
| 1131 | - <span id="mxch-testing-kb-status"><?php esc_html_e('Checking...', 'mxchat'); ?></span> | |
| 1132 | - </div> | |
| 1133 | - </div> | |
| 1134 | - </div> | |
| 1135 | - | |
| 1136 | - <!-- Debug Log --> | |
| 1137 | - <div class="mxch-card"> | |
| 1138 | - <div class="mxch-card-body"> | |
| 1139 | - <h3 class="mxch-testing-section-title"><?php esc_html_e('Debug Log', 'mxchat'); ?></h3> | |
| 1140 | - <div id="mxch-testing-debug-console" class="mxch-testing-debug-console"> | |
| 1141 | - <div class="mxch-testing-debug-entry"><?php esc_html_e('Debug panel ready - send a message to begin...', 'mxchat'); ?></div> | |
| 1142 | - </div> | |
| 1143 | - </div> | |
| 1144 | - </div> | |
| 1145 | - </div> | |
| 1146 | - | |
| 1147 | - <!-- Right Column: Chatbot Replica --> | |
| 1148 | - <div class="mxch-testing-chatbot-column"> | |
| 1149 | - <div class="mxch-testing-chatbot-scope"> | |
| 1150 | - <?php | |
| 1151 | - // Render the chatbot inline for testing | |
| 1152 | - echo do_shortcode('[mxchat_chatbot floating="no" bot_id="testing"]'); | |
| 1153 | - ?> | |
| 1154 | - </div> | |
| 1155 | - </div> | |
| 1156 | 1039 | </div> |
| 1157 | 1040 | </div> |
| 1158 | 1041 | |
| 1159 | 1042 | </main> |