Changeset 3437522
- Timestamp:
- 01/12/2026 09:44:21 AM (6 weeks ago)
- Location:
- onwebchat
- Files:
-
- 6 edited
-
assets/screenshot-1.png (modified) (previous)
-
assets/screenshot-4.png (modified) (previous)
-
trunk/admin/tabs/woocommerce.php (modified) (4 diffs)
-
trunk/includes/woocommerce-sync.php (modified) (8 diffs)
-
trunk/onwebchat.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
onwebchat/trunk/admin/tabs/woocommerce.php
r3429109 r3437522 39 39 <div class="notice notice-success is-dismissible"> 40 40 <p><strong>WooCommerce settings saved successfully!</strong></p> 41 </div> 42 <?php endif; ?> 43 44 <?php 45 // Check for authentication errors 46 $auth_error = get_transient('onwebchat_wc_auth_error'); 47 if ($auth_error): 48 ?> 49 <div class="notice notice-error is-dismissible"> 50 <p><strong>⚠️ WooCommerce Sync Authentication Error:</strong></p> 51 <p><?php echo esc_html($auth_error); ?></p> 52 <p>This usually happens when:</p> 53 <ul style="list-style: disc; margin-left: 20px;"> 54 <li>You're trying to connect the plugin to a different onWebChat account</li> 55 </ul> 56 <p><strong>Solution:</strong> Please enter your onWebChat account credentials again in the "Connect WooCommerce Sync" section below and click "Connect WooCommerce Sync" button to reconnect.</p> 41 57 </div> 42 58 <?php endif; ?> … … 145 161 <table class="form-table"> 146 162 <tr> 147 <th scope="row" >163 <th scope="row" style="line-height: 1 !important;"> 148 164 <label for="onwebchat_wc_sync_enabled">Enable Product Sync</label> 149 165 </th> … … 157 173 Automatically sync products to onWebChat for AI training 158 174 </label> 159 <p id="onwebchat_wc_sync_status" style="margin: 8px 0 0 0; font-size: 13px; min-height: 20px; display: none;">175 <p id="onwebchat_wc_sync_status" style="margin: 8px 0 0 0; font-size: 13px; min-height: 20px; visibility: hidden; opacity: 0;"> 160 176 </p> 161 177 </td> … … 348 364 } 349 365 // Ensure status is visible and fade in smoothly 350 $status.css(' display', 'block').css('opacity', 1).css('visibility', 'visible');366 $status.css('visibility', 'visible').css('opacity', 1); 351 367 // Hide it after 2.5 seconds with fade out 352 368 setTimeout(function() { 353 369 $status.animate({opacity: 0}, 300, function() { 354 $status.css(' display', 'none');370 $status.css('visibility', 'hidden'); 355 371 }); 356 372 }, 1700); -
onwebchat/trunk/includes/woocommerce-sync.php
r3429456 r3437522 31 31 add_action('admin_init', array($this, 'register_settings')); 32 32 33 // Show authentication error notice globally (not just on WooCommerce tab) 34 add_action('admin_notices', array($this, 'show_auth_error_notice')); 35 33 36 // Product hooks - use WooCommerce hooks that fire AFTER meta data is saved 34 37 add_action('woocommerce_update_product', array($this, 'on_product_update'), 10, 1); … … 72 75 73 76 if ($result['success']) { 77 // Clear any previous authentication errors 78 delete_transient('onwebchat_wc_auth_error'); 79 74 80 wp_send_json_success(array( 75 81 'message' => 'WooCommerce sync connected successfully!' … … 77 83 } else { 78 84 wp_send_json_error($result['error']); 85 } 86 } 87 88 /** 89 * Show authentication error notice globally across all admin pages 90 * (Hidden when already on WooCommerce tab since it has its own error message) 91 */ 92 public function show_auth_error_notice() { 93 $auth_error = get_transient('onwebchat_wc_auth_error'); 94 95 // Don't show if we're already on the WooCommerce tab (it has its own error message) 96 $is_woocommerce_tab = isset($_GET['page']) && $_GET['page'] === 'onwebchat_settings' 97 && isset($_GET['tab']) && $_GET['tab'] === 'woocommerce'; 98 99 if ($auth_error && class_exists('WooCommerce') && !$is_woocommerce_tab) { 100 ?> 101 <div class="notice notice-error"> 102 <p> 103 <strong>⚠️ onWebChat WooCommerce Sync Error:</strong> 104 <?php echo esc_html($auth_error); ?> 105 <a href="<?php echo esc_url(admin_url('admin.php?page=onwebchat_settings&tab=woocommerce')); ?>" class="button button-small" style="margin-left: 10px;"> 106 Fix Authentication 107 </a> 108 </p> 109 </div> 110 <?php 79 111 } 80 112 } … … 290 322 if (empty($secret)) { 291 323 error_log('onWebChat WooCommerce Sync - No secret configured. Please connect WooCommerce in the plugin settings.'); 292 return false; 324 return array( 325 'success' => false, 326 'error' => 'No secret configured. Please connect WooCommerce integration.', 327 'needs_reconnect' => true 328 ); 293 329 } 294 330 … … 335 371 if (is_wp_error($response)) { 336 372 error_log('onWebChat WooCommerce Sync - Batch sync error: ' . $response->get_error_message()); 337 return false; 373 return array( 374 'success' => false, 375 'error' => 'Network error: ' . $response->get_error_message() 376 ); 338 377 } 339 378 … … 341 380 $body = json_decode(wp_remote_retrieve_body($response), true); 342 381 382 // If authentication failed (401), the secret is invalid or out of sync 383 if ($response_code === 401) { 384 // Clear the invalid secret 385 delete_option('onwebchat_wc_sync_secret'); 386 387 error_log('onWebChat WooCommerce Sync - Authentication failed (401): Secret is invalid or out of sync. Please reconnect WooCommerce in the plugin settings.'); 388 389 // Store admin notice about authentication failure 390 set_transient('onwebchat_wc_auth_error', 'Authentication failed. Your WooCommerce secret is invalid or out of sync. Please reconnect WooCommerce integration in the plugin settings.', 3600); 391 392 return array( 393 'success' => false, 394 'error' => 'Authentication failed. Secret is invalid. Please reconnect WooCommerce integration.', 395 'needs_reconnect' => true 396 ); 397 } 398 343 399 if ($response_code === 200 && isset($body['success']) && $body['success']) { 400 // Clear any previous auth errors on success 401 delete_transient('onwebchat_wc_auth_error'); 344 402 return $body; // Return full response with stats 345 403 } 346 404 347 error_log('onWebChat WooCommerce Sync - Batch sync failed: ' . print_r($body, true)); 348 return false; 405 $error_msg = 'Batch sync failed'; 406 if (isset($body['error'])) { 407 $error_msg .= ': ' . $body['error']; 408 } 409 error_log('onWebChat WooCommerce Sync - ' . $error_msg . ' - Response: ' . print_r($body, true)); 410 411 return array( 412 'success' => false, 413 'error' => $error_msg 414 ); 349 415 } 350 416 … … 407 473 408 474 $response_code = wp_remote_retrieve_response_code($response); 475 476 // If authentication failed (401), the secret is invalid or out of sync 477 if ($response_code === 401) { 478 delete_option('onwebchat_wc_sync_secret'); 479 error_log('onWebChat WooCommerce Sync - Completion notification authentication failed (401): Secret is invalid. Please reconnect WooCommerce.'); 480 set_transient('onwebchat_wc_auth_error', 'Authentication failed. Your WooCommerce secret is invalid or out of sync. Please reconnect WooCommerce integration in the plugin settings.', 3600); 481 return false; 482 } 483 409 484 if ($response_code >= 200 && $response_code < 300) { 410 485 error_log('onWebChat WooCommerce Sync - Completion notification sent successfully'); … … 909 984 delete_option('onwebchat_wc_sync_secret'); 910 985 986 // Clear any authentication error notices 987 delete_transient('onwebchat_wc_auth_error'); 988 911 989 wp_send_json_success(array( 912 990 'message' => 'Secret cleared. Please reconnect WooCommerce with your credentials.', -
onwebchat/trunk/onwebchat.php
r3429456 r3437522 10 10 Description: Empower visitors with real-time human chat and integrated AI chatbots. onWebChat Live Chat delivers instant responses, smoother interactions, and 24/7 availability - improving engagement, satisfaction, and conversions. Includes WooCommerce product sync for AI training. 11 11 Author: onWebChat 12 Version: 3.5. 112 Version: 3.5.3 13 13 Author URI: https://www.onwebchat.com 14 14 */ … … 20 20 */ 21 21 if (!defined('ONWEBCHAT_WC_TESTING_MODE')) { 22 define('ONWEBCHAT_WC_TESTING_MODE', false);22 define('ONWEBCHAT_WC_TESTING_MODE', true); 23 23 } 24 24 -
onwebchat/trunk/readme.txt
r3429456 r3437522 5 5 Requires at least: 4.7 6 6 Requires PHP: 5.4 7 Stable tag: 3.5. 17 Stable tag: 3.5.3 8 8 License: GPLv2 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 10 11 Enhance customer service with our live chat plugin, featuring AI chatbot support for 24/7 visitor engagement. Now with WooCommerce integration, so your AI chatbot knows your products and helps customers instantly!11 Enhance customer service with instant 24/7 AI-powered replies. Now with WooCommerce integration, so your chatbot understands your products and helps customers instantly. 12 12 13 13 == Description == 14 14 15 Provide real-time support and keep your visitors engaged around the clock with our powerful live chat plugin and smart AI chatbot. 16 17 onWebChat live chat plugin integrates seamlessly with WordPress and WooCommerce websites, allowing you to Chat with website visitors in real-time, monitor web traffic and boost your conversions. 18 19 We offer a 100% free plan packed with features, and when you sign up, you’ll also receive a 1-month free trial of our Pro AI Plan! [Explore our plans](https://www.onwebchat.com/chat-pricing.php "onWebChat plans"). 20 21 Start now! It takes less than a minute - just install the onWebChat live chat plugin and [sign up for our service](https://www.onwebchat.com/signup.php "onWebChat sign up") 22 **Special Offer:** Enjoy a 1-month free trial of our Pro AI Plan by simply [signing up](https://www.onwebchat.com/signup.php "onWebChat sign up") for our live chat service! Plus, test out our AI chatbot with 50 free bot credits. [Compare all plans here](https://www.onwebchat.com/chat-pricing.php "onWebChat pricing") 15 Provide real-time support and keep your visitors engaged around the clock with **onWebChat**, a powerful live chat plugin combined with an intelligent AI chatbot. 16 17 onWebChat integrates seamlessly with WordPress and WooCommerce, allowing you to chat with website visitors in real time, automatically answer common questions with AI, monitor visitor activity, and convert more visitors into customers. 18 19 With the new **WooCommerce integration**, your AI chatbot can automatically sync your product catalog and respond to product-related questions using real product data — including product names, descriptions, and links. No manual training required. 20 21 We offer a 100% free plan packed with essential features. When you sign up, you’ll also receive a 1-month free trial of our Pro AI Plan, so you can test all advanced AI features with no risk. [Explore our plans](https://www.onwebchat.com/chat-pricing.php "onWebChat plans"). 22 23 Getting started takes less than a minute. Simply install the onWebChat plugin and [sign up for our service](https://www.onwebchat.com/signup.php "onWebChat sign up") 24 25 **Special Offer:** Enjoy a 1-month free trial of our Pro AI Plan by [signing up](https://www.onwebchat.com/signup.php "onWebChat sign up") today. Plus, test the AI chatbot with 50 free bot credits. [Compare all plans here](https://www.onwebchat.com/chat-pricing.php "onWebChat pricing") 23 26 24 27 Key Features & Benefits: … … 144 147 3. onWebChat plugin - WooCommerce settings 145 148 4. onWebChat live chat widget 149 150 146 151 == Changelog == 147 152 148 = onWebChat Live Chat (Chat version 3.5.0) = 153 = 3.5.3 = 154 - Update images 155 156 = 3.5.2 = 157 - Minor bug fixes 158 159 = 3.5.1 = 160 - Minor bug fixes 161 162 = 3.5.0 = 149 163 * NEW: WooCommerce Product Sync - Automatically sync products for AI bot training 150 164 * NEW: Bulk sync feature with background processing … … 153 167 * Enhanced AI chatbot with product knowledge capabilities 154 168 155 = onWebChat Live Chat (Chat version 3.4.1)=169 = 3.4.1 = 156 170 * Tested on WordPress 6.8 and update texts 157 171 158 = onWebChat Live Chat (Chat version 3.4.0)=172 = 3.4.0 = 159 173 * Bug fix and security improvements 160 174 161 = onWebChat Live Chat (Chat version 3.3.2)=175 = 3.3.2 = 162 176 * Bug fix 163 177 164 = onWebChat Live Chat (Chat version 3.3.1)=178 = 3.3.1 = 165 179 * AI chatbot support & fix bug 166 180 167 = onWebChat Live Chat (Chat version 3.3.0)=181 = 3.3.0 = 168 182 * AI chatbot support 169 183 170 = onWebChat Live Chat (Chat version 3.2.0)=184 = 3.2.0 = 171 185 * Security bug fix 172 186 173 = onWebChat Live Chat (Chat version 3.1.0)=187 = 3.1.0 = 174 188 * Javascript api commands support 175 189 176 = onWebChat Live Chat (Chat version 3.0.4)=190 = 3.0.4 = 177 191 * bug fix 178 192 179 = onWebChat Live Chat (Chat version 3.0.3)=193 = 3.0.3 = 180 194 * bug fix 181 195 182 = onWebChat Live Chat (Chat version 3.0.2)=196 = 3.0.2 = 183 197 * Ability to show/hide live chat widget on selected pages - bug fix 184 198 185 = onWebChat Live Chat (Chat version 3.0.1)=199 = 3.0.1 = 186 200 * Ability to show/hide live chat widget on selected pages 187 201 188 = onWebChat Live Chat (Chat version 2.0.2)=202 = 2.0.2 = 189 203 * Support for new Chat id format 190 204 191 = onWebChat Live Chat (Chat version 2.0.0)=205 = 2.0.0 = 192 206 * Add login option by username/password or Chat id. 193 207 * Option to show/hide live chat widget 194 208 195 = onWebChat Live Chat (Chat version 1.0)=196 * First onWebChat livechat plugin versio 209 = 1.0 = 210 * First onWebChat livechat plugin version
Note: See TracChangeset
for help on using the changeset viewer.