| @@ -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.20 | |
| 6 | + * Version: 3.2.25 | |
| 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 |
| @@ -38,8 +38,20 @@ | ||
| 38 | 38 | define('MXCHAT_VERSION', $version); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | + * Toolbar items API level (plan-mxchat-20260916-65c9b6). Defined only by cores | |
| 43 | + * that apply the `mxchat_chat_toolbar_items` filter while rendering the chat | |
| 44 | + * toolbar and fire the `mxchat:toolbar-ready` / `mxchat:opened` document events. | |
| 45 | + * Add-ons test `defined('MXCHAT_TOOLBAR_ITEMS_API')` and fall back to their | |
| 46 | + * older DOM-injection path on cores without it, so a button is never rendered | |
| 47 | + * twice. Bump the value only if the item shape (id / html / order) changes. | |
| 48 | + */ | |
| 49 | +if (!defined('MXCHAT_TOOLBAR_ITEMS_API')) { | |
| 50 | + define('MXCHAT_TOOLBAR_ITEMS_API', 1); | |
| 51 | +} | |
| 52 | + | |
| 53 | +/** | |
| 42 | 54 | * Default confidence floor for the in-chat YouTube card, as a percentage |
| 43 | 55 | * (plan-mxchat-20260813-f52492). Higher than the site-wide Similarity |
| 44 | 56 | * Threshold default of 35 by design — see MxChat_Utils::video_embed_threshold(). |
| 45 | 57 | * Declared here so the gate, the admin field and the tests all read ONE number. |
| @@ -468,8 +480,9 @@ | ||
| 468 | 480 | function mxchat_include_classes() { |
| 469 | 481 | $class_files = array( |
| 470 | 482 | 'includes/class-mxchat-model-catalog.php', |
| 471 | 483 | 'includes/class-mxchat-model-liveness.php', |
| 484 | + 'includes/class-mxchat-license-check.php', | |
| 472 | 485 | 'includes/class-mxchat-session-store.php', |
| 473 | 486 | 'includes/class-mxchat-live-agent-schedule.php', |
| 474 | 487 | 'includes/class-mxchat-tool-registry.php', |
| 475 | 488 | 'includes/class-mxchat-integrator.php', |
| @@ -488,8 +501,9 @@ | ||
| 488 | 501 | 'includes/class-mxchat-editor-assistant.php', |
| 489 | 502 | 'includes/class-rest-api.php', |
| 490 | 503 | 'admin/class-ajax-handler.php', |
| 491 | 504 | 'admin/class-pinecone-manager.php', |
| 505 | + 'admin/class-pinecone-documents.php', | |
| 492 | 506 | 'admin/class-knowledge-manager.php', |
| 493 | 507 | 'admin/class-vectorstore-manager.php' |
| 494 | 508 | ); |
| 495 | 509 | |
| @@ -524,8 +538,15 @@ | ||
| 524 | 538 | if (class_exists('MxChat_Model_Liveness')) { |
| 525 | 539 | MxChat_Model_Liveness::init(); |
| 526 | 540 | } |
| 527 | 541 | |
| 542 | + // Licence domain check (c93ede): once a day asks mxchat.ai whether this | |
| 543 | + // site's domain is still switched on for its key, honours an explicit | |
| 544 | + // "off" after a three-day grace period, and fails open on everything else. | |
| 545 | + if (class_exists('MxChat_License_Check')) { | |
| 546 | + MxChat_License_Check::init(); | |
| 547 | + } | |
| 548 | + | |
| 528 | 549 | // Gutenberg chatbot block (plan-95dd1e): a click-to-place wrapper over the |
| 529 | 550 | // [mxchat_chatbot] shortcode. Registers on init; no-op below WP 5.0. |
| 530 | 551 | if (class_exists('MxChat_Block')) { |
| 531 | 552 | MxChat_Block::init(); |
| @@ -1358,8 +1379,9 @@ | ||
| 1358 | 1379 | url TEXT NOT NULL, |
| 1359 | 1380 | article_content LONGTEXT NOT NULL, |
| 1360 | 1381 | embedding_vector LONGTEXT, |
| 1361 | 1382 | source_url TEXT DEFAULT NULL, |
| 1383 | + title VARCHAR(255) DEFAULT NULL, | |
| 1362 | 1384 | role_restriction VARCHAR(50) DEFAULT 'public', |
| 1363 | 1385 | content_type VARCHAR(50) DEFAULT 'content', |
| 1364 | 1386 | timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, |
| 1365 | 1387 | PRIMARY KEY (id), |
| @@ -1430,8 +1452,13 @@ | ||
| 1430 | 1452 | } |
| 1431 | 1453 | if (!in_array('role_restriction', $existing_system_column_names)) { |
| 1432 | 1454 | $wpdb->query("ALTER TABLE $system_prompt_table ADD COLUMN role_restriction VARCHAR(50) DEFAULT 'public' AFTER source_url"); |
| 1433 | 1455 | } |
| 1456 | + // Page title captured at import time (3.2.23, plan d9ee66) - read by | |
| 1457 | + // add-ons that name a source, e.g. AI Search's source cards. | |
| 1458 | + if (!in_array('title', $existing_system_column_names)) { | |
| 1459 | + $wpdb->query("ALTER TABLE $system_prompt_table ADD COLUMN title VARCHAR(255) DEFAULT NULL AFTER source_url"); | |
| 1460 | + } | |
| 1434 | 1461 | } |
| 1435 | 1462 | |
| 1436 | 1463 | // Set default thresholds for existing intents |
| 1437 | 1464 | $wpdb->query("UPDATE {$intents_table} SET similarity_threshold = 0.85 WHERE similarity_threshold IS NULL"); |
| @@ -1530,9 +1557,10 @@ | ||
| 1530 | 1557 | wp_clear_scheduled_hook('mxchat_reset_rate_limits'); |
| 1531 | 1558 | wp_clear_scheduled_hook('mxchat_cleanup_old_transcripts'); |
| 1532 | 1559 | wp_clear_scheduled_hook('mxchat_send_delayed_transcript'); |
| 1533 | 1560 | wp_clear_scheduled_hook('mxchat_model_liveness_check'); |
| 1534 | - | |
| 1561 | + wp_clear_scheduled_hook('mxchat_license_check'); | |
| 1562 | + | |
| 1535 | 1563 | // Clear fallback options |
| 1536 | 1564 | delete_option('mxchat_use_fallback_rate_limits'); |
| 1537 | 1565 | delete_option('mxchat_next_rate_limit_check'); |
| 1538 | 1566 | delete_option('mxchat_fallback_check_interval'); |