Plugin Directory


Ignore:
Timestamp:
10/17/2026 01:47:11 PM (12 days ago)
Author:
mxchat
Message:

Release 3.2.26 - security hardening, new models (GPT-6.1 Sol, Claude 5.5 family, Grok 4.7, Gemini 4 Argon, DeepSeek Flash), automatic moves off discontinued models, token usage in Transcripts, page-builder and ACF Blocks imports

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mxchat-basic/trunk/includes/class-mxchat-public.php

    r3738408 r3751971  
    242242    // Just remove the old should_hide_chatbot() check from the beginning
    243243   
    244     // Check for Complianz consent if the toggle is enabled
     244    // The chat window always starts closed ("hidden"; chat-script.js opens it).
     245    // The floating LAUNCHER is rendered visible (plan 332252), so it paints
     246    // from this HTML and chat-style.css before any script runs: a cache or
     247    // optimisation plugin that delays JavaScript until the visitor interacts
     248    // (Delay JavaScript in WP Rocket, LiteSpeed, FlyingPress, Perfmatters,
     249    // Flying Scripts) no longer leaves the page with no chatbot at all. Until
     250    // the script has bound its handler a click on it does nothing; the window
     251    // never half-opens. The launcher starts hidden only where something must
     252    // be decided in the browser:
     253    //  (a) Complianz consent (complianz_toggle on): hidden + no-consent for
     254    //      every render, revealed by chat-script.js when the visitor has
     255    //      consented. Not decided from the consent cookie here: consent is
     256    //      per visitor, and a page cache would hand one visitor's state to
     257    //      the next. Fails closed, exactly as before.
     258    //  (b) Open on load: core has no auto-open. Add-ons that open the chat
     259    //      (Trigger, the Multi-Bot handoff) click this launcher, and core's
     260    //      open handler hides it as it opens the window.
     261    //  (c) Multi-Bot page rules: the bot is chosen on the server (the
     262    //      router's shortcode filter and compute_display_bot()), so there is
     263    //      nothing left to decide in the browser.
    245264    $initial_visibility = 'hidden';
    246265    $additional_class = '';
    247    
     266    $launcher_class = '';
     267
    248268    if (isset($current_options['complianz_toggle']) && $current_options['complianz_toggle'] === 'on') {
    249269        $additional_class = ' no-consent';
    250     }
    251     $visibility_class = $initial_visibility . $additional_class;
     270        $launcher_class = ' hidden no-consent';
     271    }
    252272   
    253273    $theme_options = get_option('mxchat_theme_options', array());
    … …  
    644664                }
    645665
    646                 $is_initially_hidden = (strpos($visibility_class, 'hidden') !== false);
    647                 $aria_expanded = $is_initially_hidden ? 'false' : 'true';
    648                 echo '<div class="floating-chatbot-button ' . esc_attr($visibility_class) . '" id="floating-chatbot-button-' . esc_attr($bot_id) . '" role="button" tabindex="0" aria-label="' . esc_attr__('Open chat', 'mxchat') . '" aria-expanded="' . esc_attr($aria_expanded) . '" aria-controls="floating-chatbot-' . esc_attr($bot_id) . '"' . ($skip_inline_colors ? '' : ' style="background: ' . esc_attr($chatbot_background_color) . '; color: ' . esc_attr($send_button_font_color) . ';"') . '>';
     666                // aria-expanded describes the window, which always starts closed
     667                // (it used to be derived from the launcher's own hidden class).
     668                echo '<div class="floating-chatbot-button' . esc_attr($launcher_class) . '" id="floating-chatbot-button-' . esc_attr($bot_id) . '" role="button" tabindex="0" aria-label="' . esc_attr__('Open chat', 'mxchat') . '" aria-expanded="false" aria-controls="floating-chatbot-' . esc_attr($bot_id) . '"' . ($skip_inline_colors ? '' : ' style="background: ' . esc_attr($chatbot_background_color) . '; color: ' . esc_attr($send_button_font_color) . ';"') . '>';
    649669                echo '<div id="chat-notification-badge-' . esc_attr($bot_id) . '" class="chat-notification-badge" style="display: none; position: absolute; top: -8px; right: -8px; background-color: #ff4444; color: white; border-radius: 50%; padding: 4px 8px; font-size: 12px; font-weight: bold; z-index: 10001;">1</div>';
    650670
Note: See TracChangeset for help on using the changeset viewer.