PluginProbe
MxChat – AI Chatbot & Content Generation for WordPress / 3.1.3
MxChat – AI Chatbot & Content Generation for WordPress v3.1.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 | mxchat-basic.php +10 -60 3.2.43.1.3 View file →
@@ -2,9 +2,9 @@
2 2 /**
3 3 * Plugin Name: MxChat
4 4 * Plugin URI: https://mxchat.ai/
5 5 * Description: AI chatbot for WordPress with OpenAI, Claude, xAI, DeepSeek, live agent, PDF uploads, WooCommerce, and training on website data.
6 - * Version: 3.2.4
6 + * Version: 3.1.3
7 7 * Author: MxChat
8 8 * Author URI: https://mxchat.ai
9 9 * License: GPLv2 or later
10 10 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -15,13 +15,16 @@
15 15 if (!defined('ABSPATH')) {
16 16 exit; // Exit if accessed directly.
17 17 }
18 18
19 -
19 +// Set to true during development to append a timestamp to the version for cache busting.
20 +// Set to false before releasing to production.
20 21 if (!defined('MXCHAT_DEV_MODE')) {
21 22 define('MXCHAT_DEV_MODE', false);
22 23 }
23 24
25 +// Define plugin version constant for asset versioning
26 +// Reads version from plugin header automatically
24 27 if (!defined('MXCHAT_VERSION')) {
25 28 $plugin_data = get_file_data(__FILE__, array('Version' => 'Version'), 'plugin');
26 29 $version = $plugin_data['Version'];
27 30 if (MXCHAT_DEV_MODE) {
@@ -608,33 +611,8 @@
608 611 update_option('mxchat_content_type_migration_version', '2.5.6');
609 612 }
610 613
611 614 /**
612 - * 3.2.4: Backfill the active embedding model option for installs that already
613 - * have KB content but no stamped model. The mismatch warning compares this
614 - * against the user's currently selected model — no per-row column needed.
615 - */
616 -function mxchat_backfill_active_embedding_model() {
617 - global $wpdb;
618 -
619 - if (get_option('mxchat_active_embedding_model', '') !== '') {
620 - return;
621 - }
622 -
623 - $kb_table = $wpdb->prefix . 'mxchat_system_prompt_content';
624 - if ($wpdb->get_var("SHOW TABLES LIKE '{$kb_table}'") !== $kb_table) {
625 - return;
626 - }
627 -
628 - $kb_count = (int) $wpdb->get_var("SELECT COUNT(*) FROM {$kb_table}");
629 - if ($kb_count > 0) {
630 - $options = get_option('mxchat_options', array());
631 - $current_model = $options['embedding_model'] ?? 'text-embedding-ada-002';
632 - update_option('mxchat_active_embedding_model', $current_model, false);
633 - }
634 -}
635 -
636 -/**
637 615 * 2.5.2: Create queue processing tables for reliable background processing
638 616 */
639 617 function mxchat_create_queue_tables() {
640 618 global $wpdb;
@@ -766,9 +744,9 @@
766 744 if (in_array($current_model, $deprecated_claude_models, true)) {
767 745 $options['model'] = 'claude-opus-4-6';
768 746 $migrated = true;
769 747 $migration_message = sprintf(
770 - 'Your chatbot model has been automatically updated from %s to Claude Opus 4.6 due to Anthropic deprecating older Claude models.',
748 + __('Your chatbot model has been automatically updated from %s to Claude Opus 4.6 due to Anthropic deprecating older Claude models.', 'mxchat'),
771 749 $current_model
772 750 );
773 751 }
774 752
@@ -775,9 +753,9 @@
775 753 // Migrate deprecated Claude Haiku 3.5 to Claude Haiku 4.5
776 754 if ($current_model === 'claude-3-5-haiku-20241022') {
777 755 $options['model'] = 'claude-haiku-4-5-20251001';
778 756 $migrated = true;
779 - $migration_message = 'Your chatbot model has been automatically updated from Claude Haiku 3.5 to Claude Haiku 4.5 due to Anthropic deprecating the older model.';
757 + $migration_message = __('Your chatbot model has been automatically updated from Claude Haiku 3.5 to Claude Haiku 4.5 due to Anthropic deprecating the older model.', 'mxchat');
780 758 }
781 759
782 760 // Migrate deprecated GPT-4 series and GPT-3.5 Turbo to GPT-5.1 Chat Latest
783 761 if (in_array($current_model, array('gpt-4o', 'gpt-4.1-2025-04-14', 'gpt-4-turbo', 'gpt-4', 'gpt-3.5-turbo'), true)) {
@@ -783,9 +761,9 @@
783 761 if (in_array($current_model, array('gpt-4o', 'gpt-4.1-2025-04-14', 'gpt-4-turbo', 'gpt-4', 'gpt-3.5-turbo'), true)) {
784 762 $options['model'] = 'gpt-5.1-chat-latest';
785 763 $migrated = true;
786 764 $migration_message = sprintf(
787 - 'Your chatbot model has been automatically updated from %s to GPT-5.1 Chat Latest due to OpenAI deprecating older models.',
765 + __('Your chatbot model has been automatically updated from %s to GPT-5.1 Chat Latest due to OpenAI deprecating older models.', 'mxchat'),
788 766 $current_model
789 767 );
790 768 }
791 769
@@ -793,9 +771,9 @@
793 771 if (in_array($current_model, array('gpt-4o-mini', 'gpt-4.1-mini'), true)) {
794 772 $options['model'] = 'gpt-5-mini';
795 773 $migrated = true;
796 774 $migration_message = sprintf(
797 - 'Your chatbot model has been automatically updated from %s to GPT-5 Mini due to OpenAI deprecating GPT-4 series models.',
775 + __('Your chatbot model has been automatically updated from %s to GPT-5 Mini due to OpenAI deprecating GPT-4 series models.', 'mxchat'),
798 776 $current_model
799 777 );
800 778 }
801 779
@@ -862,26 +840,13 @@
862 840 enabled_bots LONGTEXT DEFAULT NULL,
863 841 PRIMARY KEY (id)
864 842 ) $charset_collate;";
865 843
866 - // Individual Intent Phrases Table - each phrase gets its own embedding vector
867 - $intent_phrases_table = $wpdb->prefix . 'mxchat_intent_phrases';
868 - $sql_intent_phrases_table = "CREATE TABLE $intent_phrases_table (
869 - id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
870 - intent_id BIGINT(20) UNSIGNED NOT NULL,
871 - phrase TEXT NOT NULL,
872 - embedding_vector LONGTEXT NOT NULL,
873 - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
874 - PRIMARY KEY (id),
875 - KEY intent_id (intent_id)
876 - ) $charset_collate;";
877 -
878 844 require_once ABSPATH . 'wp-admin/includes/upgrade.php';
879 845
880 846 // Create other tables
881 847 dbDelta($sql_system_prompt);
882 848 dbDelta($sql_intents_table);
883 - dbDelta($sql_intent_phrases_table);
884 849
885 850 // Create URL click tracking table
886 851 mxchat_create_url_clicks_table();
887 852
@@ -937,11 +902,8 @@
937 902
938 903 // Run migration for existing installations
939 904 mxchat_migrate_pinecone_roles_add_bot_id();
940 905
941 - // 3.2.4: Backfill active embedding model option (replaces 3.2.3 column-based tracking)
942 - mxchat_backfill_active_embedding_model();
943 -
944 906 // Setup cron jobs
945 907 mxchat_setup_cron_jobs();
946 908
947 909 // Update version
@@ -1110,20 +1072,8 @@
1110 1072 if (version_compare($current_version, '3.1.2', '<')) {
1111 1073 mxchat_migrate_transcripts_charset();
1112 1074 }
1113 1075
1114 - // 3.1.7: Clean up stale shared session email/name entries
1115 - if (version_compare($current_version, '3.1.7', '<')) {
1116 - delete_option('mxchat_email_null');
1117 - delete_option('mxchat_name_null');
1118 - }
1119 -
1120 - // 3.2.4: Backfill active embedding model option for the warning UI
1121 - // (replaces the per-row column tracking from 3.2.3, which was reverted)
1122 - if (version_compare($current_version, '3.2.4', '<')) {
1123 - mxchat_backfill_active_embedding_model();
1124 - }
1125 -
1126 1076 // Run full activation to ensure everything is up to date
1127 1077 mxchat_activate();
1128 1078
1129 1079 // Run migration functions
@@ -1294,9 +1244,9 @@
1294 1244 // Check if we're upgrading TO 3.0.1 and haven't handled this yet
1295 1245 if (version_compare($current_version, $target_version, '<') && !$update_handled) {
1296 1246 // Check if Pro is activated - only show to Pro users
1297 1247 $license_status = get_option('mxchat_license_status', 'inactive');
1298 - $is_pro = ($license_status === 'active');
1248 + $is_pro = ($license_status === 'active' || $license_status === esc_html__('active', 'mxchat'));
1299 1249
1300 1250 if ($is_pro) {
1301 1251 // Set flag to show the theme migration notification banner
1302 1252 update_option('mxchat_show_theme_migration_notice', true);