| @@ -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.2 | |
| 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) { |
| @@ -741,9 +744,9 @@ | ||
| 741 | 744 | if (in_array($current_model, $deprecated_claude_models, true)) { |
| 742 | 745 | $options['model'] = 'claude-opus-4-6'; |
| 743 | 746 | $migrated = true; |
| 744 | 747 | $migration_message = sprintf( |
| 745 | - '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'), | |
| 746 | 749 | $current_model |
| 747 | 750 | ); |
| 748 | 751 | } |
| 749 | 752 | |
| @@ -750,9 +753,9 @@ | ||
| 750 | 753 | // Migrate deprecated Claude Haiku 3.5 to Claude Haiku 4.5 |
| 751 | 754 | if ($current_model === 'claude-3-5-haiku-20241022') { |
| 752 | 755 | $options['model'] = 'claude-haiku-4-5-20251001'; |
| 753 | 756 | $migrated = true; |
| 754 | - $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'); | |
| 755 | 758 | } |
| 756 | 759 | |
| 757 | 760 | // Migrate deprecated GPT-4 series and GPT-3.5 Turbo to GPT-5.1 Chat Latest |
| 758 | 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)) { |
| @@ -758,9 +761,9 @@ | ||
| 758 | 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)) { |
| 759 | 762 | $options['model'] = 'gpt-5.1-chat-latest'; |
| 760 | 763 | $migrated = true; |
| 761 | 764 | $migration_message = sprintf( |
| 762 | - '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'), | |
| 763 | 766 | $current_model |
| 764 | 767 | ); |
| 765 | 768 | } |
| 766 | 769 | |
| @@ -768,9 +771,9 @@ | ||
| 768 | 771 | if (in_array($current_model, array('gpt-4o-mini', 'gpt-4.1-mini'), true)) { |
| 769 | 772 | $options['model'] = 'gpt-5-mini'; |
| 770 | 773 | $migrated = true; |
| 771 | 774 | $migration_message = sprintf( |
| 772 | - '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'), | |
| 773 | 776 | $current_model |
| 774 | 777 | ); |
| 775 | 778 | } |
| 776 | 779 | |
| @@ -837,26 +840,13 @@ | ||
| 837 | 840 | enabled_bots LONGTEXT DEFAULT NULL, |
| 838 | 841 | PRIMARY KEY (id) |
| 839 | 842 | ) $charset_collate;"; |
| 840 | 843 | |
| 841 | - // Individual Intent Phrases Table - each phrase gets its own embedding vector | |
| 842 | - $intent_phrases_table = $wpdb->prefix . 'mxchat_intent_phrases'; | |
| 843 | - $sql_intent_phrases_table = "CREATE TABLE $intent_phrases_table ( | |
| 844 | - id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, | |
| 845 | - intent_id BIGINT(20) UNSIGNED NOT NULL, | |
| 846 | - phrase TEXT NOT NULL, | |
| 847 | - embedding_vector LONGTEXT NOT NULL, | |
| 848 | - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, | |
| 849 | - PRIMARY KEY (id), | |
| 850 | - KEY intent_id (intent_id) | |
| 851 | - ) $charset_collate;"; | |
| 852 | - | |
| 853 | 844 | require_once ABSPATH . 'wp-admin/includes/upgrade.php'; |
| 854 | 845 | |
| 855 | 846 | // Create other tables |
| 856 | 847 | dbDelta($sql_system_prompt); |
| 857 | 848 | dbDelta($sql_intents_table); |
| 858 | - dbDelta($sql_intent_phrases_table); | |
| 859 | 849 | |
| 860 | 850 | // Create URL click tracking table |
| 861 | 851 | mxchat_create_url_clicks_table(); |
| 862 | 852 | |
| @@ -1082,14 +1072,8 @@ | ||
| 1082 | 1072 | if (version_compare($current_version, '3.1.2', '<')) { |
| 1083 | 1073 | mxchat_migrate_transcripts_charset(); |
| 1084 | 1074 | } |
| 1085 | 1075 | |
| 1086 | - // 3.1.7: Clean up stale shared session email/name entries | |
| 1087 | - if (version_compare($current_version, '3.1.7', '<')) { | |
| 1088 | - delete_option('mxchat_email_null'); | |
| 1089 | - delete_option('mxchat_name_null'); | |
| 1090 | - } | |
| 1091 | - | |
| 1092 | 1076 | // Run full activation to ensure everything is up to date |
| 1093 | 1077 | mxchat_activate(); |
| 1094 | 1078 | |
| 1095 | 1079 | // Run migration functions |
| @@ -1260,9 +1244,9 @@ | ||
| 1260 | 1244 | // Check if we're upgrading TO 3.0.1 and haven't handled this yet |
| 1261 | 1245 | if (version_compare($current_version, $target_version, '<') && !$update_handled) { |
| 1262 | 1246 | // Check if Pro is activated - only show to Pro users |
| 1263 | 1247 | $license_status = get_option('mxchat_license_status', 'inactive'); |
| 1264 | - $is_pro = ($license_status === 'active'); | |
| 1248 | + $is_pro = ($license_status === 'active' || $license_status === esc_html__('active', 'mxchat')); | |
| 1265 | 1249 | |
| 1266 | 1250 | if ($is_pro) { |
| 1267 | 1251 | // Set flag to show the theme migration notification banner |
| 1268 | 1252 | update_option('mxchat_show_theme_migration_notice', true); |