Plugin Directory

Changeset 3049208


Ignore:
Timestamp:
03/11/2024 02:52:26 PM (2 years ago)
Author:
whatshelp
Message:

tagging version 1.9

Location:
whatshelp-chat-button
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • whatshelp-chat-button/tags/1.9/readme.txt

    r2952523 r3049208  
    55Requires at least: 2.7
    66Tested up to: 6.3
    7 Stable tag: 1.8.12
     7Stable tag: 1.9
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8282== Changelog ==
    8383
     84= 1.9 =
     85Added support for short code button (created in admin panel).
     86
    8487= 1.8.12 =
    8588Improve stability.
  • whatshelp-chat-button/tags/1.9/whatshelp.php

    r2952525 r3049208  
    33 * Plugin Name: Chat Button by GetButton.io (ex. WhatsHelp)
    44 * Description: The Chat button by GetButton takes website visitor directly to the messaging app such as Facebook Messenger or WhatsApp and allows them to initiate a conversation with you. After that, both you and your customer can follow up the conversation anytime and anywhere!
    5  * Version: 1.8.12
     5 * Version: 1.9
    66 * Author: GetButton
    77 * Author URI: https://getbutton.io
     
    156156function add_whatshelp_code()
    157157{
     158    $dbval = trim(get_option('whatshelp-code'));
     159
     160    // if it short code, render it new way
     161    preg_match('/<script.+http.+\?[a-zA-Z0-9=&]*id=([a-zA-Z0-9]+)/', $dbval, $allVarsPos);
     162    if (count($allVarsPos) && isset($allVarsPos[1])) {
     163        $id = $allVarsPos[1];
     164        echo "\n\n<!-- GetButton.io widget -->\n<script defer src=\"https://static.getbutton.io/widget/bundle.js?id=${id}\"></script>\n<!-- /GetButton.io widget -->\n\n";
     165        return;
     166    }
     167
     168    // else if it long old code, render another
    158169    $err_output = 'console.warn("Getbutton: parsing code failed!"); return;';
    159170    echo get_prefix();
    160171    try {
    161         echo get_clean_code(get_option('whatshelp-code'));
     172        echo get_clean_code($dbval);
    162173    } catch (\Throwable $err) {
    163174        echo $err_output;
  • whatshelp-chat-button/trunk/readme.txt

    r2952523 r3049208  
    55Requires at least: 2.7
    66Tested up to: 6.3
    7 Stable tag: 1.8.12
     7Stable tag: 1.9
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8282== Changelog ==
    8383
     84= 1.9 =
     85Added support for short code button (created in admin panel).
     86
    8487= 1.8.12 =
    8588Improve stability.
  • whatshelp-chat-button/trunk/whatshelp.php

    r2952525 r3049208  
    33 * Plugin Name: Chat Button by GetButton.io (ex. WhatsHelp)
    44 * Description: The Chat button by GetButton takes website visitor directly to the messaging app such as Facebook Messenger or WhatsApp and allows them to initiate a conversation with you. After that, both you and your customer can follow up the conversation anytime and anywhere!
    5  * Version: 1.8.12
     5 * Version: 1.9
    66 * Author: GetButton
    77 * Author URI: https://getbutton.io
     
    156156function add_whatshelp_code()
    157157{
     158    $dbval = trim(get_option('whatshelp-code'));
     159
     160    // if it short code, render it new way
     161    preg_match('/<script.+http.+\?[a-zA-Z0-9=&]*id=([a-zA-Z0-9]+)/', $dbval, $allVarsPos);
     162    if (count($allVarsPos) && isset($allVarsPos[1])) {
     163        $id = $allVarsPos[1];
     164        echo "\n\n<!-- GetButton.io widget -->\n<script defer src=\"https://static.getbutton.io/widget/bundle.js?id=${id}\"></script>\n<!-- /GetButton.io widget -->\n\n";
     165        return;
     166    }
     167
     168    // else if it long old code, render another
    158169    $err_output = 'console.warn("Getbutton: parsing code failed!"); return;';
    159170    echo get_prefix();
    160171    try {
    161         echo get_clean_code(get_option('whatshelp-code'));
     172        echo get_clean_code($dbval);
    162173    } catch (\Throwable $err) {
    163174        echo $err_output;
Note: See TracChangeset for help on using the changeset viewer.