Plugin Directory

Changeset 3437522


Ignore:
Timestamp:
01/12/2026 09:44:21 AM (6 weeks ago)
Author:
onwebchat_dev
Message:

Updated images

Location:
onwebchat
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • onwebchat/trunk/admin/tabs/woocommerce.php

    r3429109 r3437522  
    3939        <div class="notice notice-success is-dismissible">
    4040            <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>
    4157        </div>
    4258    <?php endif; ?>
     
    145161        <table class="form-table">
    146162            <tr>
    147                 <th scope="row">
     163                <th scope="row" style="line-height: 1 !important;">
    148164                    <label for="onwebchat_wc_sync_enabled">Enable Product Sync</label>
    149165                </th>
     
    157173                        Automatically sync products to onWebChat for AI training
    158174                    </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;">
    160176                    </p>
    161177                </td>
     
    348364                        }
    349365                        // 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);
    351367                        // Hide it after 2.5 seconds with fade out
    352368                        setTimeout(function() {
    353369                            $status.animate({opacity: 0}, 300, function() {
    354                                 $status.css('display', 'none');
     370                                $status.css('visibility', 'hidden');
    355371                            });
    356372                        }, 1700);
  • onwebchat/trunk/includes/woocommerce-sync.php

    r3429456 r3437522  
    3131        add_action('admin_init', array($this, 'register_settings'));
    3232       
     33        // Show authentication error notice globally (not just on WooCommerce tab)
     34        add_action('admin_notices', array($this, 'show_auth_error_notice'));
     35       
    3336        // Product hooks - use WooCommerce hooks that fire AFTER meta data is saved
    3437        add_action('woocommerce_update_product', array($this, 'on_product_update'), 10, 1);
     
    7275       
    7376        if ($result['success']) {
     77            // Clear any previous authentication errors
     78            delete_transient('onwebchat_wc_auth_error');
     79           
    7480            wp_send_json_success(array(
    7581                'message' => 'WooCommerce sync connected successfully!'
     
    7783        } else {
    7884            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
    79111        }
    80112    }
     
    290322        if (empty($secret)) {
    291323            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            );
    293329        }
    294330       
     
    335371        if (is_wp_error($response)) {
    336372            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            );
    338377        }
    339378       
     
    341380        $body = json_decode(wp_remote_retrieve_body($response), true);
    342381       
     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       
    343399        if ($response_code === 200 && isset($body['success']) && $body['success']) {
     400            // Clear any previous auth errors on success
     401            delete_transient('onwebchat_wc_auth_error');
    344402            return $body; // Return full response with stats
    345403        }
    346404       
    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        );
    349415    }
    350416   
     
    407473       
    408474        $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       
    409484        if ($response_code >= 200 && $response_code < 300) {
    410485            error_log('onWebChat WooCommerce Sync - Completion notification sent successfully');
     
    909984        delete_option('onwebchat_wc_sync_secret');
    910985       
     986        // Clear any authentication error notices
     987        delete_transient('onwebchat_wc_auth_error');
     988       
    911989        wp_send_json_success(array(
    912990            'message' => 'Secret cleared. Please reconnect WooCommerce with your credentials.',
  • onwebchat/trunk/onwebchat.php

    r3429456 r3437522  
    1010Description: 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.
    1111Author: onWebChat
    12 Version: 3.5.1
     12Version: 3.5.3
    1313Author URI: https://www.onwebchat.com
    1414*/
     
    2020 */
    2121if (!defined('ONWEBCHAT_WC_TESTING_MODE')) {
    22     define('ONWEBCHAT_WC_TESTING_MODE', false);
     22    define('ONWEBCHAT_WC_TESTING_MODE', true);
    2323}
    2424
  • onwebchat/trunk/readme.txt

    r3429456 r3437522  
    55Requires at least: 4.7
    66Requires PHP: 5.4
    7 Stable tag: 3.5.1
     7Stable tag: 3.5.3
    88License: GPLv2
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1010
    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!
     11Enhance customer service with instant 24/7 AI-powered replies. Now with WooCommerce integration, so your chatbot understands your products and helps customers instantly.
    1212
    1313== Description ==
    1414
    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")
     15Provide 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
     17onWebChat 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
     19With 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
     21We 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
     23Getting 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")
    2326
    2427Key Features & Benefits:
     
    1441473. onWebChat plugin - WooCommerce settings
    1451484. onWebChat live chat widget
     149
     150
    146151== Changelog ==
    147152
    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 =
    149163* NEW: WooCommerce Product Sync - Automatically sync products for AI bot training
    150164* NEW: Bulk sync feature with background processing
     
    153167* Enhanced AI chatbot with product knowledge capabilities
    154168
    155 = onWebChat Live Chat (Chat version 3.4.1) =
     169= 3.4.1 =
    156170* Tested on WordPress 6.8 and update texts
    157171
    158 = onWebChat Live Chat (Chat version 3.4.0) =
     172= 3.4.0 =
    159173* Bug fix and security improvements
    160174
    161 = onWebChat Live Chat (Chat version 3.3.2) =
     175=  3.3.2 =
    162176* Bug fix
    163177
    164 = onWebChat Live Chat (Chat version 3.3.1) =
     178=  3.3.1 =
    165179* AI chatbot support & fix bug
    166180
    167 = onWebChat Live Chat (Chat version 3.3.0) =
     181=  3.3.0 =
    168182* AI chatbot support
    169183
    170 = onWebChat Live Chat (Chat version 3.2.0) =
     184=  3.2.0 =
    171185* Security bug fix
    172186
    173 = onWebChat Live Chat (Chat version 3.1.0) =
     187=  3.1.0 =
    174188* Javascript api commands support
    175189
    176 = onWebChat Live Chat (Chat version 3.0.4) =
     190=  3.0.4 =
    177191* bug fix
    178192
    179 = onWebChat Live Chat (Chat version 3.0.3) =
     193=  3.0.3 =
    180194* bug fix
    181195
    182 = onWebChat Live Chat (Chat version 3.0.2) =
     196=  3.0.2 =
    183197* Ability to show/hide live chat widget on selected pages - bug fix
    184198
    185 = onWebChat Live Chat (Chat version 3.0.1) =
     199=  3.0.1 =
    186200* Ability to show/hide live chat widget on selected pages
    187201
    188 = onWebChat Live Chat (Chat version 2.0.2) =
     202=  2.0.2 =
    189203* Support for new Chat id format
    190204
    191 = onWebChat Live Chat (Chat version 2.0.0) =
     205=  2.0.0 =
    192206* Add login option by username/password or Chat id.
    193207* Option to show/hide live chat widget
    194208
    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.