Plugin Directory

Changeset 3309069


Ignore:
Timestamp:
06/10/2025 09:45:44 AM (10 months ago)
Author:
maxicomdev
Message:

tag 2.0.7

Location:
andy-votre-assistant-intelligent
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • andy-votre-assistant-intelligent/trunk/Andy-Wordress-Extension.php

    r3297696 r3309069  
    44 * Plugin Name: Andy, Votre Assistant Intelligent
    55 * Description: Installe Andy sur votre site WordPress.
    6  * Version: 2.0.6
     6 * Version: 2.0.7
    77 * Author: Maxime MORLET (MaxiCom)
    88 * License: GPLv2 or later
     
    9696    if (version_compare($wp_version, '6.3', '>=')) {
    9797        // Modern WordPress 6.3+ way
    98         wp_enqueue_script('andy-script', $plugin_url . 'Andy/assets/Andy-Widget/scripts/Andy.js', [], '2.0.6', [
     98        wp_enqueue_script('andy-script', $plugin_url . 'Andy/assets/Andy-Widget/scripts/Andy.js', [], '2.0.7', [
    9999            'strategy' => 'defer',
    100100        ]);
    101101    } else {
    102102        // Old WordPress way
    103         wp_enqueue_script('andy-script', $plugin_url . 'Andy/assets/Andy-Widget/scripts/Andy.js', [], '2.0.6', true);
     103        wp_enqueue_script('andy-script', $plugin_url . 'Andy/assets/Andy-Widget/scripts/Andy.js', [], '2.0.7', true);
    104104
    105105        // Add defer manually
     
    284284        <?php
    285285            // Enqueue the script to handle the notice dismissal
    286             wp_enqueue_script('andy-dismiss-notice', $plugin_url . 'Andy/assets/Wordpress/scripts/andy-dismiss-notice.js', [], '2.0.6', true);
     286            wp_enqueue_script('andy-dismiss-notice', $plugin_url . 'Andy/assets/Wordpress/scripts/andy-dismiss-notice.js', [], '2.0.7', true);
    287287
    288288            endif;
     
    340340<?php
    341341    // Enqueue the script for handling the external settings form submission
    342     wp_enqueue_script('andy-external-settings', $plugin_url . 'Andy/assets/Wordpress/scripts/andy-external-wordpress-settings.js', [], '2.0.6', true);
     342    wp_enqueue_script('andy-external-settings', $plugin_url . 'Andy/assets/Wordpress/scripts/andy-external-wordpress-settings.js', [], '2.0.7', true);
    343343}
    344344
     
    443443    $custom_css = ":root { --primary-color: " . esc_attr($primary) . " !important; }";
    444444
    445     wp_enqueue_style('andy-style', $plugin_url . 'Andy/assets/Andy-Widget/styles/Andy.css', [], '2.0.6');
     445    wp_enqueue_style('andy-style', $plugin_url . 'Andy/assets/Andy-Widget/styles/Andy.css', [], '2.0.7');
    446446    wp_add_inline_style('andy-style', $custom_css);
    447447}
  • andy-votre-assistant-intelligent/trunk/Andy/assets/Andy-Widget/scripts/Andy.js

    r3297562 r3309069  
    282282                console.log('WebSocket connection established');
    283283
    284                 if (
    285                     doesCookieExist('Andy-Conversation-Uuid') &&
    286                     doesCookieExist('Andy-Conversation-Human-Requested')
    287                 ) {
    288                     const subscriptionMessage = {
    289                         action: 'subscribe-conversation',
    290 
    291                         conversationUuid: getCookie('Andy-Conversation-Uuid'),
    292                     };
    293 
    294                     const jsonSubscriptionMessage = JSON.stringify(subscriptionMessage);
    295 
    296                     webSocket.send(jsonSubscriptionMessage);
    297                 }
    298 
    299                 if (window.andy?.userId) {
    300                     const userIdMessage = {
    301                         action: 'user-id',
    302 
    303                         siteUrl: window.location.origin,
    304 
    305                         userId: andy.userId,
     284                setTimeout(() => {
     285                    if (
     286                        doesCookieExist('Andy-Conversation-Uuid') &&
     287                        doesCookieExist('Andy-Conversation-Human-Requested')
     288                    ) {
     289                        const subscriptionMessage = {
     290                            action: 'subscribe-conversation',
     291
     292                            conversationUuid: getCookie('Andy-Conversation-Uuid'),
     293                        };
     294
     295                        const jsonSubscriptionMessage = JSON.stringify(subscriptionMessage);
     296
     297                        webSocket.send(jsonSubscriptionMessage);
    306298                    }
    307299
    308                     const handleUserIdResponse = (event) => {
    309                         const serverReply = JSON.parse(event.data);
    310 
    311                         if (serverReply.action === 'user-id') {
    312                             webSocket.removeEventListener('message', handleUserIdResponse);
    313 
    314                             webSocket.addEventListener('message', webSocketReceiveMessageHandler);
    315 
    316                             resolve(); // Resolve the promise when connection is ready
     300                    if (window.andy?.userId) {
     301                        const userIdMessage = {
     302                            action: 'user-id',
     303
     304                            siteUrl: window.location.origin,
     305
     306                            userId: andy.userId,
    317307                        }
    318                     };
    319 
    320                     webSocket.addEventListener('message', handleUserIdResponse);
    321                     webSocket.send(JSON.stringify(userIdMessage));
    322                 } else {
    323                     webSocket.addEventListener('message', webSocketReceiveMessageHandler);
    324                     resolve(); // Resolve immediately when no user ID needed
    325                 }
     308
     309                        const handleUserIdResponse = (event) => {
     310                            const serverReply = JSON.parse(event.data);
     311
     312                            if (serverReply.action === 'user-id') {
     313                                webSocket.removeEventListener('message', handleUserIdResponse);
     314
     315                                webSocket.addEventListener('message', webSocketReceiveMessageHandler);
     316
     317                                resolve(); // Resolve the promise when connection is ready
     318                            }
     319                        };
     320
     321                        webSocket.addEventListener('message', handleUserIdResponse);
     322                        webSocket.send(JSON.stringify(userIdMessage));
     323                    } else {
     324                        webSocket.addEventListener('message', webSocketReceiveMessageHandler);
     325                        resolve(); // Resolve immediately when no user ID needed
     326                    }
     327                }, 1000);
    326328            };
    327329
     
    13581360    if (
    13591361        window.andy?.openChatBoxOnLoad &&
    1360         !doesCookieExist('Andy-Chatbox-Closed')
     1362        !doesCookieExist('Andy-Chatbox-Closed') &&
     1363        window.innerWidth > 550 &&
     1364        window.innerHeight > 720
    13611365    ) {
    13621366        chatBox.style.display = 'flex';
  • andy-votre-assistant-intelligent/trunk/readme.txt

    r3297696 r3309069  
    66Requires PHP: 7.3 
    77Donate link: https://essayez-andy.fr
    8 Stable tag: 2.0.6
     8Stable tag: 2.0.7
    99License: GPLv2 or later 
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html 
Note: See TracChangeset for help on using the changeset viewer.