Changeset 3297562
- Timestamp:
- 05/20/2025 05:14:07 PM (10 months ago)
- Location:
- andy-votre-assistant-intelligent
- Files:
-
- 1 added
- 4 edited
-
tags/2.0.5 (added)
-
trunk/Andy-Wordress-Extension.php (modified) (8 diffs)
-
trunk/Andy/assets/Andy-Widget/scripts/Andy.js (modified) (2 diffs)
-
trunk/Andy/assets/Andy-Widget/styles/Andy.css (modified) (2 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
andy-votre-assistant-intelligent/trunk/Andy-Wordress-Extension.php
r3294449 r3297562 4 4 * Plugin Name: Andy, Votre Assistant Intelligent 5 5 * Description: Installe Andy sur votre site WordPress. 6 * Version: 2.0. 46 * Version: 2.0.5 7 7 * Author: Maxime MORLET (MaxiCom) 8 8 * License: GPLv2 or later … … 52 52 53 53 // Check for errors in the response 54 if ( is_wp_error( $response )) {54 if (is_wp_error($response)) { 55 55 $error_message = $response->get_error_message(); 56 57 error_log("Request failed: $error_message"); 58 // Handle error accordingly (e.g., show admin notice) 59 } else { 60 $body = wp_remote_retrieve_body($response); 61 $data = json_decode($body, true); 62 63 if (isset($data['userExist']) && $data['userExist'] === true) { 64 $activation_token = $data['activation_token']; 65 } else { 66 $activation_token = 'null'; 67 } 68 69 update_option('andy_plugin_activation_token', $activation_token); 56 70 } 57 71 } … … 82 96 if (version_compare($wp_version, '6.3', '>=')) { 83 97 // Modern WordPress 6.3+ way 84 wp_enqueue_script('andy-script', $plugin_url . 'Andy/assets/Andy-Widget/scripts/Andy.js', [], '2.0. 4', [98 wp_enqueue_script('andy-script', $plugin_url . 'Andy/assets/Andy-Widget/scripts/Andy.js', [], '2.0.5', [ 85 99 'strategy' => 'defer', 86 100 ]); 87 101 } else { 88 102 // Old WordPress way 89 wp_enqueue_script('andy-script', $plugin_url . 'Andy/assets/Andy-Widget/scripts/Andy.js', [], '2.0. 4', true);103 wp_enqueue_script('andy-script', $plugin_url . 'Andy/assets/Andy-Widget/scripts/Andy.js', [], '2.0.5', true); 90 104 91 105 // Add defer manually … … 228 242 'andy_injector_options_page' 229 243 ); 244 245 add_menu_page( 246 'Andy Dashboard', // Page title 247 'Andy Dashboard', // Menu title 248 'manage_options', // Capability 249 'andy-dashboard', // Menu slug 250 'andy_plugin_render_page', // Callback function 251 'dashicons-admin-site-alt3', // Icon 252 3 // Position 253 ); 254 } 255 256 function andy_plugin_render_page() { 257 // Build the redirect URL 258 $redirect_url = 'https://dashboard.essayez-andy.fr/register?token=' . urlencode(get_option('andy_plugin_activation_token')); 259 260 // Output JavaScript to redirect 261 echo '<script type="text/javascript">'; 262 echo 'window.location.href = "' . esc_url($redirect_url) . '";'; 263 echo '</script>'; 230 264 } 231 265 … … 250 284 <?php 251 285 // Enqueue the script to handle the notice dismissal 252 wp_enqueue_script('andy-dismiss-notice', $plugin_url . 'Andy/assets/Wordpress/scripts/andy-dismiss-notice.js', [], '2.0. 4', true);286 wp_enqueue_script('andy-dismiss-notice', $plugin_url . 'Andy/assets/Wordpress/scripts/andy-dismiss-notice.js', [], '2.0.5', true); 253 287 254 288 endif; … … 306 340 <?php 307 341 // Enqueue the script for handling the external settings form submission 308 wp_enqueue_script('andy-external-settings', $plugin_url . 'Andy/assets/Wordpress/scripts/andy-external-wordpress-settings.js', [], '2.0.4', true); 342 wp_enqueue_script('andy-external-settings', $plugin_url . 'Andy/assets/Wordpress/scripts/andy-external-wordpress-settings.js', [], '2.0.5', true); 343 } 344 345 function andy_plugin_get_hostname() { 346 return parse_url(get_site_url(), PHP_URL_HOST); 309 347 } 310 348 … … 405 443 $custom_css = ":root { --primary-color: " . esc_attr($primary) . " !important; }"; 406 444 407 wp_enqueue_style('andy-style', $plugin_url . 'Andy/assets/Andy-Widget/styles/Andy.css', [], '2.0. 4');445 wp_enqueue_style('andy-style', $plugin_url . 'Andy/assets/Andy-Widget/styles/Andy.css', [], '2.0.5'); 408 446 wp_add_inline_style('andy-style', $custom_css); 409 447 } … … 456 494 // Add Settings and Contact links on the plugin row 457 495 add_filter('plugin_action_links_' . plugin_basename(__FILE__), function ($links) { 458 $settings_link = '<a href="' . admin_url('options-general.php?page=andy') . '">' . __('Settings', 'andy-votre-assistant-intelligent') . '</a>'; 459 $contact_link = '<a href="mailto:[email protected]">' . __('Contact Support', 'andy-votre-assistant-intelligent') . '</a>'; 460 array_unshift($links, $settings_link, $contact_link); 496 $settings_link = '<a href="' . admin_url('options-general.php?page=andy') . '">' . __('Paramètres', 'andy-votre-assistant-intelligent') . '</a>'; 497 $contact_link = '<a href="mailto:[email protected]">' . __('Contacter le support', 'andy-votre-assistant-intelligent') . '</a>'; 498 499 $activation_token = get_option('andy_plugin_activation_token'); 500 $action_link = '<a href="https://dashboard.essayez-andy.fr/register?token=' . esc_attr($activation_token) . '" target="_blank" rel="noopener noreferrer">' . __('Tableau de bord', 'andy-votre-assistant-intelligent') . '</a>'; 501 502 // On insère les liens (dans l’ordre : action principale, paramètres, contact) 503 array_unshift($links, $action_link, $settings_link, $contact_link); 504 461 505 return $links; 462 506 }); 507 463 508 464 509 add_action('rest_api_init', function () { -
andy-votre-assistant-intelligent/trunk/Andy/assets/Andy-Widget/scripts/Andy.js
r3294449 r3297562 784 784 // Lorsque le bouton de fermeture est cliqué, on ferme le chat 785 785 closeButton.onclick = function() { 786 createCookie('Andy-Chatbox-Closed', 'true'); 786 787 chatBox.style.display = 'none'; 787 788 }; … … 1355 1356 /* #### AUTO OPEN CHAT BOX SECTION #### */ 1356 1357 (() => { 1357 if (window.andy?.openChatBoxOnLoad) { 1358 if ( 1359 window.andy?.openChatBoxOnLoad && 1360 !doesCookieExist('Andy-Chatbox-Closed') 1361 ) { 1358 1362 chatBox.style.display = 'flex'; 1359 1363 -
andy-votre-assistant-intelligent/trunk/Andy/assets/Andy-Widget/styles/Andy.css
r3294243 r3297562 15 15 .d-none { display: none !important; } 16 16 17 ul, ol, li { display: inline; } 17 strong { font-weight: bold; } 18 19 menu, ol, ul, li { 20 display: inline; 21 list-style: none; 22 margin: 0; 23 padding: 0; 24 } 18 25 19 26 .andy-position-right #chat-bubble, … … 55 62 .andy-position-left #chat-tooltip.small { 56 63 bottom: 70px; 57 left: 70px; 64 left: 70px; 58 65 59 66 right: auto; -
andy-votre-assistant-intelligent/trunk/readme.txt
r3294449 r3297562 6 6 Requires PHP: 7.3 7 7 Donate link: https://essayez-andy.fr 8 Stable tag: 2.0. 48 Stable tag: 2.0.5 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.