WhatsApp me - Version 3.0.2

Version Description

  • NEW: Send Facebook Pixel custom event when user launch WhatsApp.
  • FIX empty tabs on settings page due to conflicts with other themes or plugins.
Download this release

Release Info

Developer creapuntome
Plugin Icon 128x128 WhatsApp me
Version 3.0.2
Comparing to
See all releases

Code changes from version 3.0.1 to 3.0.2

README.txt CHANGED
@@ -5,7 +5,7 @@ Tags: whatsapp business, whatsapp, click to chat, button, whatsapp support chat,
5
  Requires at least: 3.0.1
6
  Tested up to: 5.2
7
  Requires PHP: 5.3
8
- Stable tag: 3.0.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -21,6 +21,8 @@ Connect a WordPress chat with WhatsApp. The best solution for marketing and supp
21
 
22
  🛒 **Better Integration with WooCommerce**. Define CTAs and Custom Messages for product pages, you can use dynamic variables such as {SKU}, {PRICE} or {PRODUCT}.
23
 
 
 
24
  ### ⌁ What you can do with WAme ✅
25
 
26
  #### 🛎 Insert a WhatsApp button on your website.
@@ -38,7 +40,7 @@ For users to click on the button, use custom CTAs on each page, product or secti
38
  #### 💬 Customize conversation start messages.
39
  So that the user does not waste time in writing. This way you will be able to know from which page it comes or what product is being consulted when you start the first conversation.
40
 
41
- #### 🏁 Analyze the conversion data in Google Analytics.
42
  Remember, you do not have to do anything, the plugin already creates and computes the events by itself. [You can read more about this topic here](https://wame.chat/es/wame-mide-los-eventos-de-whatsapp-en-google-analytics/).
43
 
44
  #### 💱 Customize different languages.
@@ -97,7 +99,7 @@ WAme don't save any personal data and don't use cookies.
97
 
98
  = Google Analytics integration =
99
 
100
- WAme send an event when user click to launch WhatsApp.
101
 
102
  If Global Site Tag (gtag.js) detected:
103
 
@@ -113,6 +115,12 @@ WAme send an event (if GTM detected) when user click to launch WhatsApp:
113
 
114
  `dataLayer.push({ 'event': 'WhatsAppMe', 'eventAction': 'click', 'eventLabel': out_url });`
115
 
 
 
 
 
 
 
116
  == Screenshots ==
117
 
118
  1. WAme general settings.
@@ -121,6 +129,10 @@ WAme send an event (if GTM detected) when user click to launch WhatsApp:
121
 
122
  == Changelog ==
123
 
 
 
 
 
124
  = 3.0.1 =
125
  * FIX sometimes the phone number is lost in WAme settings on save.
126
  * CHANGED Wame button z-index to 1000.
5
  Requires at least: 3.0.1
6
  Tested up to: 5.2
7
  Requires PHP: 5.3
8
+ Stable tag: 3.0.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
21
 
22
  🛒 **Better Integration with WooCommerce**. Define CTAs and Custom Messages for product pages, you can use dynamic variables such as {SKU}, {PRICE} or {PRODUCT}.
23
 
24
+ 📈 **Facebook Pixel integration**. Sends a custom event when user launch WhatsApp.
25
+
26
  ### ⌁ What you can do with WAme ✅
27
 
28
  #### 🛎 Insert a WhatsApp button on your website.
40
  #### 💬 Customize conversation start messages.
41
  So that the user does not waste time in writing. This way you will be able to know from which page it comes or what product is being consulted when you start the first conversation.
42
 
43
+ #### 🏁 Analyze the conversion data in Google Analytics and Facebook Pixel.
44
  Remember, you do not have to do anything, the plugin already creates and computes the events by itself. [You can read more about this topic here](https://wame.chat/es/wame-mide-los-eventos-de-whatsapp-en-google-analytics/).
45
 
46
  #### 💱 Customize different languages.
99
 
100
  = Google Analytics integration =
101
 
102
+ WAme send a custom event when user click to launch WhatsApp.
103
 
104
  If Global Site Tag (gtag.js) detected:
105
 
115
 
116
  `dataLayer.push({ 'event': 'WhatsAppMe', 'eventAction': 'click', 'eventLabel': out_url });`
117
 
118
+ = Facebook Pixel integration =
119
+
120
+ WAme send a custom event if Facebook Pixel is detected when user click to launch WhatsApp:
121
+
122
+ `fbq('trackCustom', 'WhatsAppMe', { eventAction: 'click', eventLabel: out_url });`
123
+
124
  == Screenshots ==
125
 
126
  1. WAme general settings.
129
 
130
  == Changelog ==
131
 
132
+ = 3.0.2 =
133
+ * **NEW:** Send Facebook Pixel custom event when user launch WhatsApp.
134
+ * FIX empty tabs on settings page due to conflicts with other themes or plugins.
135
+
136
  = 3.0.1 =
137
  * FIX sometimes the phone number is lost in WAme settings on save.
138
  * CHANGED Wame button z-index to 1000.
admin/class-whatsappme-admin.php CHANGED
@@ -365,9 +365,10 @@ class WhatsAppMe_Admin {
365
  */
366
  public function settings_tab_open( $args ) {
367
 
368
- $tab_id = str_replace( '_open', '', $args['id'] );
 
369
 
370
- echo '<div id="' . $tab_id . '" class="tab' . ( 'whatsappme_tab_general' == $tab_id ? ' tab-active' : '' ) . '">';
371
 
372
  }
373
 
@@ -654,12 +655,16 @@ class WhatsAppMe_Admin {
654
 
655
  <form method="post" id="whatsappme_form" action="options.php" autocomplete="off">
656
  <?php settings_fields( 'whatsappme' ); ?>
657
- <h2 class="nav-tab-wrapper wp-clearfix">
658
  <?php foreach ( $this->tabs as $tab => $name ) : ?>
659
- <a href="#whatsappme_tab_<?php echo $tab; ?>" class="nav-tab <?php echo 'general' == $tab ? 'nav-tab-active' : ''; ?>"><?php echo $name; ?></a>
 
 
 
 
660
  <?php endforeach; ?>
661
  </h2>
662
- <div class="tabs">
663
  <?php do_settings_sections( 'whatsappme' ); ?>
664
  </div><!-- end tabs -->
665
  <?php submit_button(); ?>
365
  */
366
  public function settings_tab_open( $args ) {
367
 
368
+ $tab_id = str_replace( array( 'whatsappme_tab_', '_open' ), '', $args['id'] );
369
+ $active = 'general' == $tab_id ? 'wametab-active' : '';
370
 
371
+ echo "<div id=\"whatsappme_tab_$tab_id\" class=\"wametab $active\" role=\"tabpanel\" aria-labelledby=\"navtab_$tab_id\" >";
372
 
373
  }
374
 
655
 
656
  <form method="post" id="whatsappme_form" action="options.php" autocomplete="off">
657
  <?php settings_fields( 'whatsappme' ); ?>
658
+ <h2 class="nav-tab-wrapper wp-clearfix" role="tablist">
659
  <?php foreach ( $this->tabs as $tab => $name ) : ?>
660
+ <?php if ( 'general' === $tab ) : ?>
661
+ <a id="navtab_<?php echo $tab; ?>" href="#whatsappme_tab_<?php echo $tab; ?>" class="nav-tab nav-tab-active" role="tab" aria-controls="whatsappme_tab_<?php echo $tab; ?>" aria-selected="true"><?php echo $name; ?></a>
662
+ <?php else : ?>
663
+ <a id="navtab_<?php echo $tab; ?>" href="#whatsappme_tab_<?php echo $tab; ?>" class="nav-tab" role="tab" aria-controls="whatsappme_tab_<?php echo $tab; ?>" aria-selected="false"><?php echo $name; ?></a>
664
+ <?php endif; ?>
665
  <?php endforeach; ?>
666
  </h2>
667
+ <div class="wametabs">
668
  <?php do_settings_sections( 'whatsappme' ); ?>
669
  </div><!-- end tabs -->
670
  <?php submit_button(); ?>
admin/css/whatsappme.css CHANGED
@@ -3,12 +3,12 @@
3
  min-height: 100px;
4
  }
5
 
6
- .tab {
7
  display: none;
8
  }
9
 
10
- .tab-active {
11
- display: block;
12
  }
13
 
14
  #whatsappme_tab_advanced tr:hover {
3
  min-height: 100px;
4
  }
5
 
6
+ .wametab {
7
  display: none;
8
  }
9
 
10
+ .wametab-active {
11
+ display: block !important;
12
  }
13
 
14
  #whatsappme_tab_advanced tr:hover {
admin/css/whatsappme.min.css CHANGED
@@ -1 +1 @@
1
- .js #whatsappme_form textarea{overflow:hidden;min-height:100px}.tab{display:none}.tab-active{display:block}#whatsappme_tab_advanced tr:hover{background:rgba(0,0,0,.05)}#whatsappme_tab_advanced td,#whatsappme_tab_advanced th{padding:7px 15px}#whatsappme_tab_advanced label{margin-right:15px}#whatsappme_tab_advanced .dashicons{opacity:.5}#whatsappme_tab_advanced input[type=radio]+span{transition:all .2s}#whatsappme_tab_advanced input[type=radio]:checked+span{color:#79ba49;opacity:1}#whatsappme_tab_advanced input[type=radio]:checked+.dashicons-hidden{color:#ca4a1f}.whatsappme-show-help{display:inline-block;width:1.1em;height:1.1em;line-height:1.1em;border-radius:50%;background:#999;color:#fff;font-weight:700;text-decoration:none;text-align:center}.whatsappme-show-help:active,.whatsappme-show-help:focus,.whatsappme-show-help:hover{background:#444;color:#fff}#tab-panel-styles-and-vars span{white-space:nowrap}#tab-panel-styles-and-vars code{-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all}.form-table td p.whatsappme-addon{font-size:13px}.iti--allow-dropdown input{padding-left:52px!important}
1
+ .js #whatsappme_form textarea{overflow:hidden;min-height:100px}.wametab{display:none}.wametab-active{display:block!important}#whatsappme_tab_advanced tr:hover{background:rgba(0,0,0,.05)}#whatsappme_tab_advanced td,#whatsappme_tab_advanced th{padding:7px 15px}#whatsappme_tab_advanced label{margin-right:15px}#whatsappme_tab_advanced .dashicons{opacity:.5}#whatsappme_tab_advanced input[type=radio]+span{transition:all .2s}#whatsappme_tab_advanced input[type=radio]:checked+span{color:#79ba49;opacity:1}#whatsappme_tab_advanced input[type=radio]:checked+.dashicons-hidden{color:#ca4a1f}.whatsappme-show-help{display:inline-block;width:1.1em;height:1.1em;line-height:1.1em;border-radius:50%;background:#999;color:#fff;font-weight:700;text-decoration:none;text-align:center}.whatsappme-show-help:active,.whatsappme-show-help:focus,.whatsappme-show-help:hover{background:#444;color:#fff}#tab-panel-styles-and-vars span{white-space:nowrap}#tab-panel-styles-and-vars code{-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all}.form-table td p.whatsappme-addon{font-size:13px}.iti--allow-dropdown input{padding-left:52px!important}
admin/js/whatsappme.js CHANGED
@@ -66,13 +66,13 @@
66
  if ($('#whatsappme_form').length === 1) {
67
  // Tabs
68
  $('.nav-tab').click(function (e) {
69
- var $tab = $(this);
70
  e.preventDefault();
 
71
 
72
- $('.nav-tab').removeClass('nav-tab-active');
73
- $tab.addClass('nav-tab-active').blur();
74
- $('.tab').removeClass('tab-active');
75
- $($tab.attr('href')).addClass('tab-active');
76
  });
77
 
78
  // Toggle WhatsApp web option
66
  if ($('#whatsappme_form').length === 1) {
67
  // Tabs
68
  $('.nav-tab').click(function (e) {
 
69
  e.preventDefault();
70
+ var $navtab = $(this);
71
 
72
+ $('.nav-tab').removeClass('nav-tab-active').attr('aria-selected', 'false');
73
+ $navtab.addClass('nav-tab-active').attr('aria-selected', 'true').get(0).blur();
74
+ $('.wametab').removeClass('wametab-active');
75
+ $($navtab.attr('href')).addClass('wametab-active').find('textarea').each(textarea_autoheight);
76
  });
77
 
78
  // Toggle WhatsApp web option
admin/js/whatsappme.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){"use strict";t(function(){if("function"==typeof intlTelInput&&t("#whatsappme_phone").length){var e=JSON.parse(localStorage.whatsappme_country_code||"{}"),a=!(!e.code||e.date!=(new Date).toDateString())&&e.code,n=t("#whatsappme_phone");intlTelInput(n.get(0),{hiddenInput:n.data("name")||"whatsappme[telephone]",initialCountry:"auto",preferredCountries:[a||""],geoIpLookup:function(e){a?e(a):t.getJSON("https://ipinfo.io").always(function(t){var a=t&&t.country?t.country:"";localStorage.whatsappme_country_code=JSON.stringify({code:a,date:(new Date).toDateString()}),e(a)})},utilsScript:"https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/"+intl_tel_input_version+"/js/utils.js"}).hiddenInput.value=n.val(),n.on("input",function(){var e=t(this),a=intlTelInputGlobals.getInstance(this);e.css("color",e.val().trim()&&!a.isValidNumber()?"#ca4a1f":""),a.hiddenInput.value=a.getNumber()}).on("blur",function(){var t=intlTelInputGlobals.getInstance(this);t.setNumber(t.getNumber())})}function i(e,a){if(e=e||"all",a=a||t('input[name="whatsappme[view]['+e+']"]:checked').val(),t(".view_inheritance_"+e).toggleClass("dashicons-visibility","yes"==a).toggleClass("dashicons-hidden","no"==a),"cpts"==e)t("[class*=view_inheritance_cpt_]").toggleClass("dashicons-visibility","yes"==a).toggleClass("dashicons-hidden","no"==a);else if(e in c){var n=t('input[name="whatsappme[view]['+e+']"]:checked').val();n=""===n?a:n,t.each(c[e],function(){i(this,n)})}}function s(){t(this).height(0).height(this.scrollHeight)}if(1===t("#whatsappme_form").length){t(".nav-tab").click(function(e){var a=t(this);e.preventDefault(),t(".nav-tab").removeClass("nav-tab-active"),a.addClass("nav-tab-active").blur(),t(".tab").removeClass("tab-active"),t(a.attr("href")).addClass("tab-active")}),t("#whatsappme_mobile_only").change(function(){t("#whatsappme_whatsapp_web").closest("tr").toggleClass("hide-if-js",this.checked)}).change(),t(".whatsappme-show-help").click(function(e){e.preventDefault(),t("#contextual-help-wrap").is(":visible")?t("html, body").animate({scrollTop:0}):t("#contextual-help-link").click(),t("#tab-link-styles-and-vars a").click()}),t("textarea","#whatsappme_form").on("input",s).each(s);var l=t("#whatsappme_tab_advanced"),c=t(".whatsappme_view_all").data("inheritance")||{all:["front_page","blog_page","404_page","search","archive","singular","cpts"],archive:["date","author"],singular:["page","post"]};t("input",l).change(function(){i()}),t(".whatsappme_view_reset").click(function(e){e.preventDefault(),t('input[value=""]',l).prop("checked",!0),t(".whatsappme_view_all input",l).first().prop("checked",!0),i()}),i()}})}(jQuery);
1
+ !function(e){"use strict";e(function(){if("function"==typeof intlTelInput&&e("#whatsappme_phone").length){var t=JSON.parse(localStorage.whatsappme_country_code||"{}"),a=!(!t.code||t.date!=(new Date).toDateString())&&t.code,i=e("#whatsappme_phone");intlTelInput(i.get(0),{hiddenInput:i.data("name")||"whatsappme[telephone]",initialCountry:"auto",preferredCountries:[a||""],geoIpLookup:function(t){a?t(a):e.getJSON("https://ipinfo.io").always(function(e){var a=e&&e.country?e.country:"";localStorage.whatsappme_country_code=JSON.stringify({code:a,date:(new Date).toDateString()}),t(a)})},utilsScript:"https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/"+intl_tel_input_version+"/js/utils.js"}).hiddenInput.value=i.val(),i.on("input",function(){var t=e(this),a=intlTelInputGlobals.getInstance(this);t.css("color",t.val().trim()&&!a.isValidNumber()?"#ca4a1f":""),a.hiddenInput.value=a.getNumber()}).on("blur",function(){var e=intlTelInputGlobals.getInstance(this);e.setNumber(e.getNumber())})}function n(t,a){if(t=t||"all",a=a||e('input[name="whatsappme[view]['+t+']"]:checked').val(),e(".view_inheritance_"+t).toggleClass("dashicons-visibility","yes"==a).toggleClass("dashicons-hidden","no"==a),"cpts"==t)e("[class*=view_inheritance_cpt_]").toggleClass("dashicons-visibility","yes"==a).toggleClass("dashicons-hidden","no"==a);else if(t in c){var i=e('input[name="whatsappme[view]['+t+']"]:checked').val();i=""===i?a:i,e.each(c[t],function(){n(this,i)})}}function s(){e(this).height(0).height(this.scrollHeight)}if(1===e("#whatsappme_form").length){e(".nav-tab").click(function(t){t.preventDefault();var a=e(this);e(".nav-tab").removeClass("nav-tab-active").attr("aria-selected","false"),a.addClass("nav-tab-active").attr("aria-selected","true").get(0).blur(),e(".wametab").removeClass("wametab-active"),e(a.attr("href")).addClass("wametab-active").find("textarea").each(s)}),e("#whatsappme_mobile_only").change(function(){e("#whatsappme_whatsapp_web").closest("tr").toggleClass("hide-if-js",this.checked)}).change(),e(".whatsappme-show-help").click(function(t){t.preventDefault(),e("#contextual-help-wrap").is(":visible")?e("html, body").animate({scrollTop:0}):e("#contextual-help-link").click(),e("#tab-link-styles-and-vars a").click()}),e("textarea","#whatsappme_form").on("input",s).each(s);var l=e("#whatsappme_tab_advanced"),c=e(".whatsappme_view_all").data("inheritance")||{all:["front_page","blog_page","404_page","search","archive","singular","cpts"],archive:["date","author"],singular:["page","post"]};e("input",l).change(function(){n()}),e(".whatsappme_view_reset").click(function(t){t.preventDefault(),e('input[value=""]',l).prop("checked",!0),e(".whatsappme_view_all input",l).first().prop("checked",!0),n()}),n()}})}(jQuery);
public/js/whatsappme.js CHANGED
@@ -146,7 +146,7 @@
146
  // Trigger Google Analytics event
147
  function send_event(link) {
148
  if (typeof dataLayer == 'object') {
149
- // Send Google Tag Manager Event
150
  dataLayer.push({
151
  'event': 'WhatsAppMe',
152
  'eventAction': 'click',
@@ -154,20 +154,24 @@
154
  });
155
  }
156
  if (typeof gtag == 'function') {
157
- // Send event (Global Site Tag - gtag.js)
158
  gtag('event', 'click', {
159
  'event_category': 'WhatsAppMe',
160
  'event_label': link,
161
  'transport_type': 'beacon'
162
  });
163
  } else if (typeof ga == 'function' && typeof ga.getAll == 'function') {
164
- // Send event (Universal Analtics - analytics.js)
165
  ga('set', 'transport', 'beacon');
166
  var trackers = ga.getAll();
167
  trackers.forEach(function (tracker) {
168
  tracker.send("event", 'WhatsAppMe', 'click', link);
169
  });
170
  }
 
 
 
 
171
  }
172
 
173
  // Math.imul polyfill (source https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul#Polyfill)
146
  // Trigger Google Analytics event
147
  function send_event(link) {
148
  if (typeof dataLayer == 'object') {
149
+ // Send Google Tag Manager custom event
150
  dataLayer.push({
151
  'event': 'WhatsAppMe',
152
  'eventAction': 'click',
154
  });
155
  }
156
  if (typeof gtag == 'function') {
157
+ // Send custom event (Global Site Tag - gtag.js)
158
  gtag('event', 'click', {
159
  'event_category': 'WhatsAppMe',
160
  'event_label': link,
161
  'transport_type': 'beacon'
162
  });
163
  } else if (typeof ga == 'function' && typeof ga.getAll == 'function') {
164
+ // Send custom event (Universal Analtics - analytics.js)
165
  ga('set', 'transport', 'beacon');
166
  var trackers = ga.getAll();
167
  trackers.forEach(function (tracker) {
168
  tracker.send("event", 'WhatsAppMe', 'click', link);
169
  });
170
  }
171
+ if (typeof fbq == 'function') {
172
+ // Send Facebook Pixel custom event
173
+ fbq('trackCustom', 'WhatsAppMe', { eventAction: 'click', eventLabel: link });
174
+ }
175
  }
176
 
177
  // Math.imul polyfill (source https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul#Polyfill)
public/js/whatsappme.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){"use strict";function t(e,t,a){return(e?"https://web.whatsapp.com/send":"https://api.whatsapp.com/send")+"?phone="+encodeURIComponent(t)+"&text="+encodeURIComponent(a||"")}e(function(){var a,s=e(".whatsappme"),n=s.find(".whatsappme__badge"),o=s.data("settings");try{localStorage.setItem("test",1),localStorage.removeItem("test"),a=localStorage}catch(e){a={_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===o)try{o=JSON.parse(s.attr("data-settings"))}catch(e){o=void 0}s.length&&o&&o.telephone&&function(){var i,p,l,m,c=!!navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i),r=1e3*o.button_delay,h=""!==o.message_text,d=o.whatsapp_web&&!c,g=new Image;g.src="data:image/webp;base64,UklGRi4AAABXRUJQVlA4TCEAAAAvAUAAEB8wAiMwAgSSNtse/cXjxyCCmrYNWPwmHRH9jwMA",g.onload=g.onerror=function(){2!==g.height&&s.addClass("nowebp")};var u=(a.getItem("whatsappme_hashes")||"").split(",").filter(Boolean),w="yes"==a.getItem("whatsappme_visited");h&&(i=function(e){for(var t=0,a=1;t<e.length;t++)a=Math.imul(a+e.charCodeAt(t)|0,2654435761);return(a^a>>>17)>>>0}(o.message_text).toString(),p=u.indexOf(i)>-1);a.setItem("whatsappme_visited","yes"),(!o.mobile_only||c)&&(setTimeout(function(){s.addClass("whatsappme--show")},r),h&&!p&&(o.message_badge?m=setTimeout(function(){n.addClass("whatsappme__badge--in")},r+1e3*o.message_delay):w&&(m=setTimeout(function(){s.addClass("whatsappme--dialog")},r+1e3*o.message_delay))));h&&!c&&e(".whatsappme__button",s).mouseenter(function(){l=setTimeout(f,1500)}).mouseleave(function(){clearTimeout(l)});function f(){s.addClass("whatsappme--dialog"),clearTimeout(m),o.message_badge&&n.hasClass("whatsappme__badge--in")&&(n.removeClass("whatsappme__badge--in").addClass("whatsappme__badge--out"),_())}function _(){h&&!p&&(u.push(i),a.setItem("whatsappme_hashes",u.join(",")),p=!0)}e(".whatsappme__button",s).click(function(){if(h&&!s.hasClass("whatsappme--dialog"))f();else{var a={link:t(d,o.telephone,o.message_send)},n=new RegExp("^https?://(wa.me|(api|web|chat).whatsapp.com|"+location.hostname.replace(".",".")+")/.*","i");s.removeClass("whatsappme--dialog"),_(),e(document).trigger("whatsappme:open",[a,o]),n.test(a.link)?(!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)})}}(a.link),window.open(a.link,"whatsappme")):console.error("WAme: the link doesn't seem safe, it must point to the current domain or whatsapp.com")}}),e(".whatsappme__close",s).click(function(){s.removeClass("whatsappme--dialog"),_()})}()}),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);
1
+ !function(e){"use strict";function t(e,t,a){return(e?"https://web.whatsapp.com/send":"https://api.whatsapp.com/send")+"?phone="+encodeURIComponent(t)+"&text="+encodeURIComponent(a||"")}e(function(){var a,s=e(".whatsappme"),n=s.find(".whatsappme__badge"),o=s.data("settings");try{localStorage.setItem("test",1),localStorage.removeItem("test"),a=localStorage}catch(e){a={_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===o)try{o=JSON.parse(s.attr("data-settings"))}catch(e){o=void 0}s.length&&o&&o.telephone&&function(){var i,p,c,l,m=!!navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i),r=1e3*o.button_delay,h=""!==o.message_text,d=o.whatsapp_web&&!m,u=new Image;u.src="data:image/webp;base64,UklGRi4AAABXRUJQVlA4TCEAAAAvAUAAEB8wAiMwAgSSNtse/cXjxyCCmrYNWPwmHRH9jwMA",u.onload=u.onerror=function(){2!==u.height&&s.addClass("nowebp")};var g=(a.getItem("whatsappme_hashes")||"").split(",").filter(Boolean),w="yes"==a.getItem("whatsappme_visited");h&&(i=function(e){for(var t=0,a=1;t<e.length;t++)a=Math.imul(a+e.charCodeAt(t)|0,2654435761);return(a^a>>>17)>>>0}(o.message_text).toString(),p=g.indexOf(i)>-1);a.setItem("whatsappme_visited","yes"),(!o.mobile_only||m)&&(setTimeout(function(){s.addClass("whatsappme--show")},r),h&&!p&&(o.message_badge?l=setTimeout(function(){n.addClass("whatsappme__badge--in")},r+1e3*o.message_delay):w&&(l=setTimeout(function(){s.addClass("whatsappme--dialog")},r+1e3*o.message_delay))));h&&!m&&e(".whatsappme__button",s).mouseenter(function(){c=setTimeout(f,1500)}).mouseleave(function(){clearTimeout(c)});function f(){s.addClass("whatsappme--dialog"),clearTimeout(l),o.message_badge&&n.hasClass("whatsappme__badge--in")&&(n.removeClass("whatsappme__badge--in").addClass("whatsappme__badge--out"),_())}function _(){h&&!p&&(g.push(i),a.setItem("whatsappme_hashes",g.join(",")),p=!0)}e(".whatsappme__button",s).click(function(){if(h&&!s.hasClass("whatsappme--dialog"))f();else{var a={link:t(d,o.telephone,o.message_send)},n=new RegExp("^https?://(wa.me|(api|web|chat).whatsapp.com|"+location.hostname.replace(".",".")+")/.*","i");s.removeClass("whatsappme--dialog"),_(),e(document).trigger("whatsappme:open",[a,o]),n.test(a.link)?(!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)})}"function"==typeof fbq&&fbq("trackCustom","WhatsAppMe",{eventAction:"click",eventLabel:e})}(a.link),window.open(a.link,"whatsappme")):console.error("WAme: the link doesn't seem safe, it must point to the current domain or whatsapp.com")}}),e(".whatsappme__close",s).click(function(){s.removeClass("whatsappme--dialog"),_()})}()}),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);
whatsappme.php CHANGED
@@ -9,7 +9,7 @@
9
  * Plugin Name: WAme chat
10
  * Plugin URI: https://wame.chat
11
  * Description: Connect a WordPress chat with WhatsApp. The best solution for marketing and support. Stop losing customers and increase your sales.
12
- * Version: 3.0.1
13
  * Author: Creame
14
  * Author URI: https://crea.me
15
  * License: GPL-2.0+
@@ -27,7 +27,7 @@ if ( ! defined( 'WPINC' ) ) {
27
  * Currently plugin version.
28
  * Start at version 1.0.0 and use SemVer - https://semver.org
29
  */
30
- define( 'WHATSAPPME_VERSION', '3.0.1' );
31
 
32
  /**
33
  * The core plugin class that is used to define internationalization,
9
  * Plugin Name: WAme chat
10
  * Plugin URI: https://wame.chat
11
  * Description: Connect a WordPress chat with WhatsApp. The best solution for marketing and support. Stop losing customers and increase your sales.
12
+ * Version: 3.0.2
13
  * Author: Creame
14
  * Author URI: https://crea.me
15
  * License: GPL-2.0+
27
  * Currently plugin version.
28
  * Start at version 1.0.0 and use SemVer - https://semver.org
29
  */
30
+ define( 'WHATSAPPME_VERSION', '3.0.2' );
31
 
32
  /**
33
  * The core plugin class that is used to define internationalization,