WhatsApp me - Version 3.1.4

Version Description

  • FIX php warning with new var {DISCOUNT} when price is zero.
Download this release

Release Info

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

Code changes from version 3.1.3 to 3.1.4

README.txt CHANGED
@@ -1,19 +1,19 @@
1
- === WAme chat ===
2
  Contributors: creapuntome, pacotole, davidlillo, monillo
3
  Donate link: https://www.paypal.me/creapuntome/
4
  Tags: whatsapp business, whatsapp, click to chat, button, whatsapp support chat, support, contact, directly message whatsapp, floating whatsapp, whatsapp chat
5
  Requires at least: 3.0.1
6
  Tested up to: 5.3
7
  Requires PHP: 5.3
8
- Stable tag: 3.1.3
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
- Connect a WordPress chat with WhatsApp. The best solution for marketing and support. Stop losing customers and increase your sales.
13
 
14
  == Description ==
15
 
16
- [wame.chat](https://wame.chat) | [Add-Ons](https://wame.chat/addons/) | [Plugin support](https://wordpress.org/support/plugin/creame-whatsapp-me/)
17
 
18
  ### Connect a WordPress chat with WhatsApp. The best solution for marketing and support. Stop losing customers and increase your sales.
19
 
@@ -65,7 +65,7 @@ Having many options is not an advantage, the configuration of WAme is so easy th
65
  ### ⌁ If you like WAme 😍
66
  1. Subscribe to [our newsletter and our blog](https://wame.chat/blog/).
67
  2. Learn from our tutorials on [Youtube Channel](https://www.youtube.com/channel/UCqHiSNPBaQ918fpVnCU1wog/).
68
- 3. Or rate us [on WordPress](https://wordpress.org/support/plugin/creame-whatsapp-me/reviews/?filter=5/#new-post).
69
 
70
  *WhatsApp and WhatsApp Logo are brand assets and trademark of Facebook, Inc.*
71
  *WAme is not in partnership, sponsored or endorsed by Facebook, Inc.*
@@ -148,6 +148,9 @@ There is a Javascript event that WAme triggers automatically before launch Whats
148
 
149
  == Changelog ==
150
 
 
 
 
151
  = 3.1.3 =
152
  * Minor improvements and link to Wame CTA Extras.
153
 
1
+ === VVAme chat ===
2
  Contributors: creapuntome, pacotole, davidlillo, monillo
3
  Donate link: https://www.paypal.me/creapuntome/
4
  Tags: whatsapp business, whatsapp, click to chat, button, whatsapp support chat, support, contact, directly message whatsapp, floating whatsapp, whatsapp chat
5
  Requires at least: 3.0.1
6
  Tested up to: 5.3
7
  Requires PHP: 5.3
8
+ Stable tag: 3.1.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
+ Connects a WordPress chat with WhatsApp. The best solution for marketing and support. Stop losing customers and increase your sales.
13
 
14
  == Description ==
15
 
16
+ [wame.chat](https://wame.chat) | [Add-Ons](https://wame.chat/addons/) | [Plugin support](https://wame.chat/en/support/)
17
 
18
  ### Connect a WordPress chat with WhatsApp. The best solution for marketing and support. Stop losing customers and increase your sales.
19
 
65
  ### ⌁ If you like WAme 😍
66
  1. Subscribe to [our newsletter and our blog](https://wame.chat/blog/).
67
  2. Learn from our tutorials on [Youtube Channel](https://www.youtube.com/channel/UCqHiSNPBaQ918fpVnCU1wog/).
68
+ 3. Or rate us [on WordPress](https://wordpress.org/support/plugin/creame-whatsapp-me/reviews/#new-post).
69
 
70
  *WhatsApp and WhatsApp Logo are brand assets and trademark of Facebook, Inc.*
71
  *WAme is not in partnership, sponsored or endorsed by Facebook, Inc.*
148
 
149
  == Changelog ==
150
 
151
+ = 3.1.4 =
152
+ * FIX php warning with new var {DISCOUNT} when price is zero.
153
+
154
  = 3.1.3 =
155
  * Minor improvements and link to Wame CTA Extras.
156
 
admin/js/whatsappme.js CHANGED
@@ -70,12 +70,13 @@
70
  // Show help
71
  $('.whatsappme-show-help').click(function (e) {
72
  e.preventDefault();
 
73
  if ($('#contextual-help-wrap').is(':visible')) {
74
  $("html, body").animate({ scrollTop: 0 });
75
  } else {
76
  $('#contextual-help-link').click();
77
  }
78
- $('#tab-link-styles-and-vars a').click();
79
  });
80
 
81
  // Texarea focus and auto height
70
  // Show help
71
  $('.whatsappme-show-help').click(function (e) {
72
  e.preventDefault();
73
+ var help_tab = $(this).attr('href');
74
  if ($('#contextual-help-wrap').is(':visible')) {
75
  $("html, body").animate({ scrollTop: 0 });
76
  } else {
77
  $('#contextual-help-link').click();
78
  }
79
+ $( help_tab != '#' ? help_tab : '#tab-link-styles-and-vars').find('a').click();
80
  });
81
 
82
  // Texarea focus and auto height
admin/js/whatsappme.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){"use strict";function t(){e(this).height(0).height(this.scrollHeight)}e(function(){var a;if("function"==typeof intlTelInput&&e("#whatsappme_phone").length){var n=JSON.parse(localStorage.whatsappme_country_code||"{}"),i=!(!n.code||n.date!=(new Date).toDateString())&&n.code,s=e("#whatsappme_phone");intlTelInput(s.get(0),{hiddenInput:s.data("name")||"whatsappme[telephone]",initialCountry:"auto",preferredCountries:[i||""],geoIpLookup:function(t){i?t(i):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=s.val(),s.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())})}if(1===e("#whatsappme_form").length){e(".nav-tab").click(function(a){a.preventDefault();var n=e(this);e(".nav-tab").removeClass("nav-tab-active").attr("aria-selected","false"),n.addClass("nav-tab-active").attr("aria-selected","true").get(0).blur(),e(".wametab").removeClass("wametab-active"),e(n.attr("href")).addClass("wametab-active").find("textarea").each(t)}),e("#whatsappme_mobile_only").change(function(){e("#whatsappme_whatsapp_web").closest("tr").toggleClass("wame-hidden",this.checked)}).change(),e("#whatsappme_message_delay").on("change input",function(){e("#whatsappme_message_badge").closest("tr").toggleClass("wame-hidden","0"==this.value)}).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("focus",function(){e(this).closest("tr").addClass("whatsappme--focus")}).on("blur",function(){e(this).closest("tr").removeClass("whatsappme--focus")}).on("input",t).each(t);var l=e("#whatsappme_tab_advanced"),o=e(".whatsappme_view_all").data("inheritance")||{all:["front_page","blog_page","404_page","search","archive","singular","cpts"],archive:["date","author"],singular:["page","post"]};function p(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 o){var n=e('input[name="whatsappme[view]['+t+']"]:checked').val();n=""===n?a:n,e.each(o[t],function(){p(this,n)})}}e("input",l).change(function(){p()}),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),p()}),p(),e("#whatsappme_button_image_add").click(function(t){t.preventDefault(),a||((a=wp.media({title:e(this).data("title")||"Select button image",button:{text:e(this).data("button")||"Use Image"},library:{type:"image"},multiple:!1})).on("select",function(){var t=a.state().get("selection").first().toJSON(),n=t.sizes&&t.sizes.thumbnail&&t.sizes.thumbnail.url||t.url;e("#whatsappme_button_image_holder").css({"background-size":"cover","background-image":"url("+n+")"}),e("#whatsappme_button_image").val(t.id),e("#whatsappme_button_image_remove").removeClass("wame-hidden")}),a.on("open",function(){var t=wp.media.attachment(e("#whatsappme_button_image").val());a.state().get("selection").add(t?[t]:[])})),a.open()}),e("#whatsappme_button_image_remove").click(function(t){t.preventDefault(),e("#whatsappme_button_image_holder").removeAttr("style"),e("#whatsappme_button_image").val(""),e(this).addClass("wame-hidden")})}1===e(".whatsappme-metabox").length&&e("textarea",".whatsappme-metabox").on("focus input",t).each(t)})}(jQuery);
1
+ !function(e){"use strict";function t(){e(this).height(0).height(this.scrollHeight)}e(function(){var a;if("function"==typeof intlTelInput&&e("#whatsappme_phone").length){var n=JSON.parse(localStorage.whatsappme_country_code||"{}"),i=!(!n.code||n.date!=(new Date).toDateString())&&n.code,s=e("#whatsappme_phone");intlTelInput(s.get(0),{hiddenInput:s.data("name")||"whatsappme[telephone]",initialCountry:"auto",preferredCountries:[i||""],geoIpLookup:function(t){i?t(i):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=s.val(),s.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())})}if(1===e("#whatsappme_form").length){e(".nav-tab").click(function(a){a.preventDefault();var n=e(this);e(".nav-tab").removeClass("nav-tab-active").attr("aria-selected","false"),n.addClass("nav-tab-active").attr("aria-selected","true").get(0).blur(),e(".wametab").removeClass("wametab-active"),e(n.attr("href")).addClass("wametab-active").find("textarea").each(t)}),e("#whatsappme_mobile_only").change(function(){e("#whatsappme_whatsapp_web").closest("tr").toggleClass("wame-hidden",this.checked)}).change(),e("#whatsappme_message_delay").on("change input",function(){e("#whatsappme_message_badge").closest("tr").toggleClass("wame-hidden","0"==this.value)}).change(),e(".whatsappme-show-help").click(function(t){t.preventDefault();var a=e(this).attr("href");e("#contextual-help-wrap").is(":visible")?e("html, body").animate({scrollTop:0}):e("#contextual-help-link").click(),e("#"!=a?a:"#tab-link-styles-and-vars").find("a").click()}),e("textarea","#whatsappme_form").on("focus",function(){e(this).closest("tr").addClass("whatsappme--focus")}).on("blur",function(){e(this).closest("tr").removeClass("whatsappme--focus")}).on("input",t).each(t);var l=e("#whatsappme_tab_advanced"),o=e(".whatsappme_view_all").data("inheritance")||{all:["front_page","blog_page","404_page","search","archive","singular","cpts"],archive:["date","author"],singular:["page","post"]};function p(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 o){var n=e('input[name="whatsappme[view]['+t+']"]:checked').val();n=""===n?a:n,e.each(o[t],function(){p(this,n)})}}e("input",l).change(function(){p()}),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),p()}),p(),e("#whatsappme_button_image_add").click(function(t){t.preventDefault(),a||((a=wp.media({title:e(this).data("title")||"Select button image",button:{text:e(this).data("button")||"Use Image"},library:{type:"image"},multiple:!1})).on("select",function(){var t=a.state().get("selection").first().toJSON(),n=t.sizes&&t.sizes.thumbnail&&t.sizes.thumbnail.url||t.url;e("#whatsappme_button_image_holder").css({"background-size":"cover","background-image":"url("+n+")"}),e("#whatsappme_button_image").val(t.id),e("#whatsappme_button_image_remove").removeClass("wame-hidden")}),a.on("open",function(){var t=wp.media.attachment(e("#whatsappme_button_image").val());a.state().get("selection").add(t?[t]:[])})),a.open()}),e("#whatsappme_button_image_remove").click(function(t){t.preventDefault(),e("#whatsappme_button_image_holder").removeAttr("style"),e("#whatsappme_button_image").val(""),e(this).addClass("wame-hidden")})}1===e(".whatsappme-metabox").length&&e("textarea",".whatsappme-metabox").on("focus input",t).each(t)})}(jQuery);
public/class-whatsappme-woopublic.php CHANGED
@@ -227,7 +227,11 @@ class WhatsAppMe_WooPublic {
227
 
228
  $regular_price = 'variable' === $product->get_type() ? $product->get_variation_regular_price( 'min' ) : $product->get_regular_price();
229
  $sale_price = 'variable' === $product->get_type() ? $product->get_variation_price( 'min' ) : $product->get_price();
230
- $percentage = round( ( ( $regular_price - $sale_price ) / $regular_price ) * 100 );
 
 
 
 
231
 
232
  return $percentage ? "-$percentage%" : '';
233
 
227
 
228
  $regular_price = 'variable' === $product->get_type() ? $product->get_variation_regular_price( 'min' ) : $product->get_regular_price();
229
  $sale_price = 'variable' === $product->get_type() ? $product->get_variation_price( 'min' ) : $product->get_price();
230
+
231
+ $percentage = '';
232
+ if ( is_numeric( $regular_price ) && is_numeric( $sale_price ) && $regular_price > 0 ) {
233
+ $percentage = round( ( ( $regular_price - $sale_price ) / $regular_price ) * 100 );
234
+ }
235
 
236
  return $percentage ? "-$percentage%" : '';
237
 
whatsappme.php CHANGED
@@ -6,10 +6,10 @@
6
  * @package WhatsAppMe
7
  *
8
  * @wordpress-plugin
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.1.3
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.1.3' );
31
 
32
  /**
33
  * The core plugin class that is used to define internationalization,
6
  * @package WhatsAppMe
7
  *
8
  * @wordpress-plugin
9
+ * Plugin Name: VVAme chat
10
  * Plugin URI: https://wame.chat
11
+ * Description: Connects a WordPress chat with WhatsApp. The best solution for marketing and support. Stop losing customers and increase your sales.
12
+ * Version: 3.1.4
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.1.4' );
31
 
32
  /**
33
  * The core plugin class that is used to define internationalization,