Changeset 3252966
- Timestamp:
- 03/09/2025 09:53:12 PM (12 months ago)
- Location:
- chat-data
- Files:
-
- 6 added
- 2 edited
-
tags/1.0.1 (added)
-
tags/1.0.1/chat-data.php (added)
-
tags/1.0.1/readme.txt (added)
-
tags/1.0.2 (added)
-
tags/1.0.2/chat-data.php (added)
-
tags/1.0.2/readme.txt (added)
-
trunk/chat-data.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
chat-data/trunk/chat-data.php
r3252659 r3252966 5 5 * Plugin URI: https://www.chat-data.com/ 6 6 * Description: Embed your Chat Data chatbot on any Wordpress site. 7 * Version: 1.0. 17 * Version: 1.0.2 8 8 * Author: Chat Data 9 9 * Author URI: https://www.chat-data.com// … … 99 99 "; 100 100 101 wp_register_style('chat_data_admin_styles', false, array(), '1.0. 1');101 wp_register_style('chat_data_admin_styles', false, array(), '1.0.2'); 102 102 wp_enqueue_style('chat_data_admin_styles'); 103 103 wp_add_inline_style('chat_data_admin_styles', $css); … … 152 152 153 153 // Embed the script on the site using the ID entered in the options page 154 function chat_data_embed_chatbot() 155 { 154 function chat_data_embed_chatbot() { 156 155 $chatbot_id = get_option('chatbot_id'); 157 156 $embedding_domain = get_option('embedding_domain'); 158 157 159 158 if ($chatbot_id && $embedding_domain) { 160 $script_url = "https://{$embedding_domain}/embed.min.js?chatbotId={$chatbot_id}"; 161 // Register the script 162 wp_register_script( 163 'chatbot-script', 164 $script_url, 165 array(), // Dependencies (if any) 166 '1.0.1', // Version number (replace with your actual script version) 167 array( 168 'strategy' => 'defer', 169 'in_footer' => true, 170 ) 171 ); 172 wp_enqueue_script('chatbot-script'); 159 $script_url = esc_url("https://{$embedding_domain}/embed.min.js?chatbotId={$chatbot_id}"); 160 echo "<script defer src='{$script_url}'></script>\n"; 173 161 } 174 162 } 175 163 176 add_action('wp_ enqueue_scripts', 'chat_data_embed_chatbot', 99999);164 add_action('wp_footer', 'chat_data_embed_chatbot', 99999); 177 165 ?> -
chat-data/trunk/readme.txt
r3252659 r3252966 32 32 == Changelog == 33 33 34 = 1.0.2 = 35 * Change how the embedding script is loaded to ensure it loads after all other scripts. 36 34 37 = 1.0.1 = 35 38 * Add priority to the embedding script to ensure it loads after all other scripts.
Note: See TracChangeset
for help on using the changeset viewer.