PluginProbe
MxChat – AI Chatbot & Content Generation for WordPress / 2.4.6
MxChat – AI Chatbot & Content Generation for WordPress v2.4.6
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/class-mxchat-word-handler.php +27 -0 2.0.42.4.6 View file →
@@ -326,7 +326,34 @@
326 326 }
327 327
328 328 return $dotProduct / ($normA * $normB);
329 329 }
330 +
331 + /**
332 + * Check the status of a Word document for the current session
333 + */
334 +public function mxchat_check_word_status() {
335 + check_ajax_referer('mxchat_chat_nonce', 'nonce');
336 +
337 + if (empty($_POST['session_id'])) {
338 + wp_send_json_error(esc_html__('Session ID missing.', 'mxchat'));
339 + return;
340 + }
341 +
342 + $session_id = sanitize_text_field($_POST['session_id']);
343 + $word_path = get_transient('mxchat_word_url_' . $session_id);
344 + $filename = get_transient('mxchat_word_filename_' . $session_id);
345 +
346 + if ($word_path && file_exists($word_path) && $filename) {
347 + wp_send_json_success([
348 + 'has_word' => true,
349 + 'filename' => $filename
350 + ]);
351 + } else {
352 + wp_send_json_success([
353 + 'has_word' => false
354 + ]);
355 + }
356 +}
330 357
331 358
332 359 }