diff --git a/README.txt b/README.txt index fec78e5..804c77a 100644 --- a/README.txt +++ b/README.txt @@ -5,7 +5,7 @@ Tags: whatsapp business, whatsapp, click to chat, button, whatsapp support chat, Requires at least: 3.0.1 Tested up to: 5.2 Requires PHP: 5.3 -Stable tag: 2.3.2 +Stable tag: 2.3.3 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -117,8 +117,11 @@ WhatsApp me send an event (if GTM detected) when user click to launch WhatsApp: == Changelog == += 2.3.3 = +* FIX javascript error when "ga" global object is defined but isn't Google Analytics. + = 2.3.2 = -* FIX PHP notice on some archive pages +* FIX PHP notice on some archive pages. = 2.3.1 = * Readme texts and description. diff --git a/public/js/whatsappme.js b/public/js/whatsappme.js index 1b40c4d..d4f751c 100644 --- a/public/js/whatsappme.js +++ b/public/js/whatsappme.js @@ -150,7 +150,7 @@ 'event_label': link, 'transport_type': 'beacon' }); - } else if (typeof ga == 'function') { + } else if (typeof ga == 'function' && typeof ga.getAll == 'function') { // Send event (Universal Analtics - analytics.js) ga('set', 'transport', 'beacon'); var trackers = ga.getAll(); diff --git a/public/js/whatsappme.min.js b/public/js/whatsappme.min.js index 589478e..a54cecb 100644 --- a/public/js/whatsappme.min.js +++ b/public/js/whatsappme.min.js @@ -1 +1 @@ -!function(e){"use strict";e(function(){var t,a=e(".whatsappme"),s=a.find(".whatsappme__badge"),n=a.data("settings");try{localStorage.setItem("test",1),localStorage.removeItem("test"),t=localStorage}catch(e){t={_data:{},setItem:function(e,t){this._data[e]=String(t)},getItem:function(e){return this._data.hasOwnProperty(e)?this._data[e]:null}}}if(void 0===n)try{n=JSON.parse(a.attr("data-settings"))}catch(e){n=void 0}a.length&&n&&n.telephone&&function(){var o,i,p,m,l=!!navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i),c=1e3*n.button_delay,h=""!==n.message_text,r=n.whatsapp_web&&!l,d=new Image;d.src="data:image/webp;base64,UklGRi4AAABXRUJQVlA4TCEAAAAvAUAAEB8wAiMwAgSSNtse/cXjxyCCmrYNWPwmHRH9jwMA",d.onload=d.onerror=function(){2!==d.height&&a.addClass("nowebp")};var u=(t.getItem("whatsappme_hashes")||"").split(",").filter(Boolean),g="yes"==t.getItem("whatsappme_visited");h&&(o=function(e){for(var t=0,a=1;t>>17)>>>0}(n.message_text).toString(),i=u.indexOf(o)>-1);t.setItem("whatsappme_visited","yes"),(!n.mobile_only||l)&&(setTimeout(function(){a.addClass("whatsappme--show")},c),h&&!i&&(n.message_badge?m=setTimeout(function(){s.addClass("whatsappme__badge--in")},c+1e3*n.message_delay):g&&(m=setTimeout(function(){a.addClass("whatsappme--dialog")},c+1e3*n.message_delay))));h&&!l&&e(".whatsappme__button",a).mouseenter(function(){p=setTimeout(_,1500)}).mouseleave(function(){clearTimeout(p)});function _(){a.addClass("whatsappme--dialog"),clearTimeout(m),n.message_badge&&s.hasClass("whatsappme__badge--in")&&(s.removeClass("whatsappme__badge--in").addClass("whatsappme__badge--out"),w())}function w(){h&&!i&&(u.push(o),t.setItem("whatsappme_hashes",u.join(",")),i=!0)}e(".whatsappme__button",a).click(function(){var e=function(e,t,a){return(e?"https://web.whatsapp.com/send":"https://api.whatsapp.com/send")+"?phone="+encodeURIComponent(t)+"&text="+encodeURIComponent(a||"")}(r,n.telephone,n.message_send);h&&!a.hasClass("whatsappme--dialog")?_():(a.removeClass("whatsappme--dialog"),w(),function(e){"object"==typeof dataLayer&&dataLayer.push({event:"WhatsAppMe",eventAction:"click",eventLabel:e});if("function"==typeof gtag)gtag("event","click",{event_category:"WhatsAppMe",event_label:e,transport_type:"beacon"});else if("function"==typeof ga){ga("set","transport","beacon");var t=ga.getAll();t.forEach(function(t){t.send("event","WhatsAppMe","click",e)})}}(e),window.open(e,"whatsappme"))}),e(".whatsappme__close",a).click(function(){a.removeClass("whatsappme--dialog"),w()})}()}),Math.imul=Math.imul||function(e,t){var a=65535&e,s=65535&t;return a*s+((e>>>16&65535)*s+a*(t>>>16&65535)<<16>>>0)|0}}(jQuery); \ No newline at end of file +!function(e){"use strict";e(function(){var t,a=e(".whatsappme"),s=a.find(".whatsappme__badge"),n=a.data("settings");try{localStorage.setItem("test",1),localStorage.removeItem("test"),t=localStorage}catch(e){t={_data:{},setItem:function(e,t){this._data[e]=String(t)},getItem:function(e){return this._data.hasOwnProperty(e)?this._data[e]:null}}}if(void 0===n)try{n=JSON.parse(a.attr("data-settings"))}catch(e){n=void 0}a.length&&n&&n.telephone&&function(){var o,i,p,l,m=!!navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i),c=1e3*n.button_delay,h=""!==n.message_text,r=n.whatsapp_web&&!m,d=new Image;d.src="data:image/webp;base64,UklGRi4AAABXRUJQVlA4TCEAAAAvAUAAEB8wAiMwAgSSNtse/cXjxyCCmrYNWPwmHRH9jwMA",d.onload=d.onerror=function(){2!==d.height&&a.addClass("nowebp")};var g=(t.getItem("whatsappme_hashes")||"").split(",").filter(Boolean),u="yes"==t.getItem("whatsappme_visited");h&&(o=function(e){for(var t=0,a=1;t>>17)>>>0}(n.message_text).toString(),i=g.indexOf(o)>-1);t.setItem("whatsappme_visited","yes"),(!n.mobile_only||m)&&(setTimeout(function(){a.addClass("whatsappme--show")},c),h&&!i&&(n.message_badge?l=setTimeout(function(){s.addClass("whatsappme__badge--in")},c+1e3*n.message_delay):u&&(l=setTimeout(function(){a.addClass("whatsappme--dialog")},c+1e3*n.message_delay))));h&&!m&&e(".whatsappme__button",a).mouseenter(function(){p=setTimeout(_,1500)}).mouseleave(function(){clearTimeout(p)});function _(){a.addClass("whatsappme--dialog"),clearTimeout(l),n.message_badge&&s.hasClass("whatsappme__badge--in")&&(s.removeClass("whatsappme__badge--in").addClass("whatsappme__badge--out"),w())}function w(){h&&!i&&(g.push(o),t.setItem("whatsappme_hashes",g.join(",")),i=!0)}e(".whatsappme__button",a).click(function(){var e=function(e,t,a){return(e?"https://web.whatsapp.com/send":"https://api.whatsapp.com/send")+"?phone="+encodeURIComponent(t)+"&text="+encodeURIComponent(a||"")}(r,n.telephone,n.message_send);h&&!a.hasClass("whatsappme--dialog")?_():(a.removeClass("whatsappme--dialog"),w(),function(e){"object"==typeof dataLayer&&dataLayer.push({event:"WhatsAppMe",eventAction:"click",eventLabel:e});if("function"==typeof gtag)gtag("event","click",{event_category:"WhatsAppMe",event_label:e,transport_type:"beacon"});else if("function"==typeof ga&&"function"==typeof ga.getAll){ga("set","transport","beacon");var t=ga.getAll();t.forEach(function(t){t.send("event","WhatsAppMe","click",e)})}}(e),window.open(e,"whatsappme"))}),e(".whatsappme__close",a).click(function(){a.removeClass("whatsappme--dialog"),w()})}()}),Math.imul=Math.imul||function(e,t){var a=65535&e,s=65535&t;return a*s+((e>>>16&65535)*s+a*(t>>>16&65535)<<16>>>0)|0}}(jQuery); \ No newline at end of file diff --git a/whatsappme.php b/whatsappme.php index e20969f..2f1f3a4 100644 --- a/whatsappme.php +++ b/whatsappme.php @@ -9,7 +9,7 @@ * Plugin Name: WhatsApp me * Plugin URI: https://wame.chat * Description: Connect a WordPress chat with WhatsApp. The best solution for marketing and support. Stop losing customers and increase your sales. - * Version: 2.3.2 + * Version: 2.3.3 * Author: Creame * Author URI: https://crea.me * License: GPL-2.0+ @@ -27,7 +27,7 @@ * Currently plugin version. * Start at version 1.0.0 and use SemVer - https://semver.org */ -define( 'WHATSAPPME_VERSION', '2.3.2' ); +define( 'WHATSAPPME_VERSION', '2.3.3' ); /** * The core plugin class that is used to define internationalization,