WhatsApp Chat WP - Version 4.5.4

Version Description

Hello! We've recently acquired this plugin and included tons of new features.

Download this release

Release Info

Developer quadlayers
Plugin Icon 128x128 WhatsApp Chat WP
Version 4.5.4
Comparing to
See all releases

Code changes from version 4.5.3 to 4.5.4

assets/js/qlwapp-admin-contact.js CHANGED
@@ -191,12 +191,12 @@
191
  success: function (response) {
192
  if (response.success) {
193
 
 
 
194
  if (modal.model.attributes.id == undefined) {
195
  modal.close(e);
196
  }
197
-
198
- $modal.addClass('reload');
199
-
200
  } else {
201
  alert(response.data);
202
  }
191
  success: function (response) {
192
  if (response.success) {
193
 
194
+ $modal.addClass('reload');
195
+
196
  if (modal.model.attributes.id == undefined) {
197
  modal.close(e);
198
  }
199
+
 
 
200
  } else {
201
  alert(response.data);
202
  }
assets/js/qlwapp-admin-contact.min.js CHANGED
@@ -1,2 +1 @@
1
-
2
- (function(c){var b=0,f;_.mixin({escapeHtml:function(g){return g.replace("&amp;",/&/g).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&#039;/g,"'")}});var e=Backbone.Model.extend({defaults:qlwapp_contact.args});var d=Backbone.View.extend({events:{"change input":"enable","change textarea":"enable","change select":"enable","click .media-modal-backdrop":"close","click .media-modal-close":"close","click .media-modal-prev":"edit","click .media-modal-next":"edit","change .media-modal-change":"change","submit .media-modal-form":"submit"},templates:{},initialize:function(){_.bindAll(this,"open","edit","change","load","render","close","submit");this.init();this.open()},init:function(){this.templates.window=wp.template("qlwapp-modal-window")},render:function(){var h=this;var g=this.$el.find("ul.wc-tabs li.active a").attr("href");h.$el.html(h.templates.window(h.model.attributes));_.delay(function(){},100)},load:function(){var g=this;if(g.model.attributes.id==undefined){g.render();return}c.ajax({url:ajaxurl,data:{action:"qlwapp_edit_contact",nonce:qlwapp_contact.nonce.qlwapp_edit_contact,contact_id:this.model.attributes.id},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(h){if(h.success){g.model.set(h.data);g.render()}else{alert(h.data)}}})},edit:function(k){k.preventDefault();var i=this,j=c(k.target),h=parseInt(c("#qlwapp_contacts_table tr[data-contact_id]").length),g=parseInt(i.model.get("order"));b++;if(f){clearTimeout(f)}f=setTimeout(function(){if(j.hasClass("media-modal-next")){g=Math.min(g+b,h)}else{g=Math.max(g-b,1)}i.model.set({id:parseInt(c("#qlwapp_contacts_table tr[data-contact_order="+g+"]").data("contact_id"))});b=0;i.load()},300)},open:function(g){this.load();c("body").addClass("modal-open").append(this.$el)},update:function(j){j.preventDefault();var h=c(j.target),g=h.attr("name"),i=h.val();if(j.target.type==="checkbox"){i=h.prop("checked")===true?1:0}this.model.attributes[g]=i;this.model.changed[g]=i},change:function(g){g.preventDefault();this.update(g);this.render()},reload:function(g){if(this.$el.find("#qlwapp_modal").hasClass("reload")){location.reload();return}this.remove();return},close:function(g){g.preventDefault();this.undelegateEvents();c(document).off("focusin");c("body").removeClass("modal-open");this.reload(g);return},enable:function(g){c(".media-modal-submit").removeProp("disabled")},submit:function(j){j.preventDefault();var i=this,h=i.$el.find("#qlwapp_modal"),g=h.find(".attachment-details");c.ajax({url:ajaxurl,data:{action:"qlwapp_save_contact",nonce:qlwapp_contact.nonce.qlwapp_save_contact,contact_id:i.model.attributes.id,contact_data:c("form",this.$el).serialize()},dataType:"json",type:"POST",beforeSend:function(){c(".media-modal-submit").prop("disabled",true);g.addClass("save-waiting")},complete:function(){g.addClass("save-complete");g.removeClass("save-waiting")},error:function(){alert("Error!")},success:function(k){if(k.success){if(i.model.attributes.id==undefined){i.close(j)}h.addClass("reload")}else{alert(k.data)}}});return false}});var a=Backbone.View.extend({initialize:function(j){var i=c(j.target),h=i.closest("[data-contact_id]").data("contact_id");var g=new e();g.set({id:h});new d({model:g})},});c(".qlwapp_settings_edit").on("click",function(g){g.preventDefault();new a(g)});c("#qlwapp_contact_add").on("click",function(g){g.preventDefault();new a(g)});c(".qlwapp_settings_delete").on("click",function(j){j.preventDefault();var g=c("#qlwapp_delete_contact_nonce").val();var i=c(j.target),h=i.closest("[data-contact_id]").data("contact_id");if(!confirm(qlwapp_contact.message.contact_confirm_delete)){return false}else{c.ajax({url:ajaxurl,data:{action:"qlwapp_delete_contact",nonce:g,contact_id:h},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(k){console.log("response from error ");console.log(k)},success:function(k){if(k.data){console.log(k.data);location.reload()}else{alert(k.data)}}})}});c("table#qlwapp_contacts_table tbody").sortable({items:"tr",cursor:"move",axis:"y",handle:"td.sort",scrollSensitivity:40,helper:function(g,h){h.children().each(function(){c(this).width(c(this).width())});h.css("left","0");return h},start:function(g,h){h.item.css("background-color","#f6f6f6")},stop:function(g,h){h.item.removeAttr("style");h.item.trigger("updateMoveButtons");h.item.trigger("updateSaveButton")}});c(document).on("updateSaveButton",function(){c("#qlwapp_contact_order").removeProp("disabled")});c(".wc-item-reorder-nav").find(".wc-move-up, .wc-move-down").on("click",function(){var l=c(this),g=l.closest("tr");l.focus();var k=l.is(".wc-move-up"),j=l.is(".wc-move-down");if(k){var i=g.prev("tr");if(i&&i.length){i.before(g)}}else{if(j){var h=g.next("tr");if(h&&h.length){h.after(g)}}}l.focus();l.closest("table").trigger("updateMoveButtons");l.closest("table").trigger("updateSaveButton")});c(".wc-item-reorder-nav").closest("table").on("updateMoveButtons",function(){var h=c(this),g=c(this).find("tbody tr:last"),i=c(this).find("tbody tr:first");h.find(".wc-item-reorder-nav .wc-move-disabled").removeClass("wc-move-disabled").attr({tabindex:"0","aria-hidden":"false"});i.find(".wc-item-reorder-nav .wc-move-up").addClass("wc-move-disabled").attr({tabindex:"-1","aria-hidden":"true"});g.find(".wc-item-reorder-nav .wc-move-down").addClass("wc-move-disabled").attr({tabindex:"-1","aria-hidden":"true"})});c("table#qlwapp_contacts_table tbody").trigger("updateMoveButtons");c(document).on("submit","#qlwapp_contacts_form",function(j){j.preventDefault();var g=c(this),i=g.find(".settings-save-status .spinner"),h=g.find(".settings-save-status .saved");c.ajax({url:ajaxurl,data:{action:"qlwapp_save_contact_order",nonce:qlwapp_contact.nonce.qlwapp_save_contact_order,contact_data:g.serialize()},dataType:"json",type:"POST",beforeSend:function(){i.addClass("is-active")},complete:function(){i.removeClass("is-active")},error:function(k){console.log("response from error ");console.log(k)},success:function(k){h.addClass("is-active");c("#qlwapp_contact_order").prop("disabled",true);if(k.success){setTimeout(function(){h.removeClass("is-active")},1500)}else{console.log(k.data);alert(k.data)}}});return false})})(jQuery);
1
+ (function(c){var b=0,f;_.mixin({escapeHtml:function(g){return g.replace("&amp;",/&/g).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&#039;/g,"'")}});var e=Backbone.Model.extend({defaults:qlwapp_contact.args});var d=Backbone.View.extend({events:{"change input":"enable","change textarea":"enable","change select":"enable","click .media-modal-backdrop":"close","click .media-modal-close":"close","click .media-modal-prev":"edit","click .media-modal-next":"edit","change .media-modal-change":"change","submit .media-modal-form":"submit"},templates:{},initialize:function(){_.bindAll(this,"open","edit","change","load","render","close","submit");this.init();this.open()},init:function(){this.templates.window=wp.template("qlwapp-modal-window")},render:function(){var h=this;var g=this.$el.find("ul.wc-tabs li.active a").attr("href");h.$el.html(h.templates.window(h.model.attributes));_.delay(function(){},100)},load:function(){var g=this;if(g.model.attributes.id==undefined){g.render();return}c.ajax({url:ajaxurl,data:{action:"qlwapp_edit_contact",nonce:qlwapp_contact.nonce.qlwapp_edit_contact,contact_id:this.model.attributes.id},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(h){if(h.success){g.model.set(h.data);g.render()}else{alert(h.data)}}})},edit:function(k){k.preventDefault();var i=this,j=c(k.target),h=parseInt(c("#qlwapp_contacts_table tr[data-contact_id]").length),g=parseInt(i.model.get("order"));b++;if(f){clearTimeout(f)}f=setTimeout(function(){if(j.hasClass("media-modal-next")){g=Math.min(g+b,h)}else{g=Math.max(g-b,1)}i.model.set({id:parseInt(c("#qlwapp_contacts_table tr[data-contact_order="+g+"]").data("contact_id"))});b=0;i.load()},300)},open:function(g){this.load();c("body").addClass("modal-open").append(this.$el)},update:function(j){j.preventDefault();var h=c(j.target),g=h.attr("name"),i=h.val();if(j.target.type==="checkbox"){i=h.prop("checked")===true?1:0}this.model.attributes[g]=i;this.model.changed[g]=i},change:function(g){g.preventDefault();this.update(g);this.render()},reload:function(g){if(this.$el.find("#qlwapp_modal").hasClass("reload")){location.reload();return}this.remove();return},close:function(g){g.preventDefault();this.undelegateEvents();c(document).off("focusin");c("body").removeClass("modal-open");this.reload(g);return},enable:function(g){c(".media-modal-submit").removeProp("disabled")},submit:function(j){j.preventDefault();var i=this,h=i.$el.find("#qlwapp_modal"),g=h.find(".attachment-details");c.ajax({url:ajaxurl,data:{action:"qlwapp_save_contact",nonce:qlwapp_contact.nonce.qlwapp_save_contact,contact_id:i.model.attributes.id,contact_data:c("form",this.$el).serialize()},dataType:"json",type:"POST",beforeSend:function(){c(".media-modal-submit").prop("disabled",true);g.addClass("save-waiting")},complete:function(){g.addClass("save-complete");g.removeClass("save-waiting")},error:function(){alert("Error!")},success:function(k){if(k.success){h.addClass("reload");if(i.model.attributes.id==undefined){i.close(j)}}else{alert(k.data)}}});return false}});var a=Backbone.View.extend({initialize:function(j){var i=c(j.target),h=i.closest("[data-contact_id]").data("contact_id");var g=new e();g.set({id:h});new d({model:g})},});c(".qlwapp_settings_edit").on("click",function(g){g.preventDefault();new a(g)});c("#qlwapp_contact_add").on("click",function(g){g.preventDefault();new a(g)});c(".qlwapp_settings_delete").on("click",function(j){j.preventDefault();var g=c("#qlwapp_delete_contact_nonce").val();var i=c(j.target),h=i.closest("[data-contact_id]").data("contact_id");if(!confirm(qlwapp_contact.message.contact_confirm_delete)){return false}else{c.ajax({url:ajaxurl,data:{action:"qlwapp_delete_contact",nonce:g,contact_id:h},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(k){console.log("response from error ");console.log(k)},success:function(k){if(k.data){console.log(k.data);location.reload()}else{alert(k.data)}}})}});c("table#qlwapp_contacts_table tbody").sortable({items:"tr",cursor:"move",axis:"y",handle:"td.sort",scrollSensitivity:40,helper:function(g,h){h.children().each(function(){c(this).width(c(this).width())});h.css("left","0");return h},start:function(g,h){h.item.css("background-color","#f6f6f6")},stop:function(g,h){h.item.removeAttr("style");h.item.trigger("updateMoveButtons");h.item.trigger("updateSaveButton")}});c(document).on("updateSaveButton",function(){c("#qlwapp_contact_order").removeProp("disabled")});c(".wc-item-reorder-nav").find(".wc-move-up, .wc-move-down").on("click",function(){var l=c(this),g=l.closest("tr");l.focus();var k=l.is(".wc-move-up"),j=l.is(".wc-move-down");if(k){var i=g.prev("tr");if(i&&i.length){i.before(g)}}else{if(j){var h=g.next("tr");if(h&&h.length){h.after(g)}}}l.focus();l.closest("table").trigger("updateMoveButtons");l.closest("table").trigger("updateSaveButton")});c(".wc-item-reorder-nav").closest("table").on("updateMoveButtons",function(){var h=c(this),g=c(this).find("tbody tr:last"),i=c(this).find("tbody tr:first");h.find(".wc-item-reorder-nav .wc-move-disabled").removeClass("wc-move-disabled").attr({tabindex:"0","aria-hidden":"false"});i.find(".wc-item-reorder-nav .wc-move-up").addClass("wc-move-disabled").attr({tabindex:"-1","aria-hidden":"true"});g.find(".wc-item-reorder-nav .wc-move-down").addClass("wc-move-disabled").attr({tabindex:"-1","aria-hidden":"true"})});c("table#qlwapp_contacts_table tbody").trigger("updateMoveButtons");c(document).on("submit","#qlwapp_contacts_form",function(j){j.preventDefault();var g=c(this),i=g.find(".settings-save-status .spinner"),h=g.find(".settings-save-status .saved");c.ajax({url:ajaxurl,data:{action:"qlwapp_save_contact_order",nonce:qlwapp_contact.nonce.qlwapp_save_contact_order,contact_data:g.serialize()},dataType:"json",type:"POST",beforeSend:function(){i.addClass("is-active")},complete:function(){i.removeClass("is-active")},error:function(k){console.log("response from error ");console.log(k)},success:function(k){h.addClass("is-active");c("#qlwapp_contact_order").prop("disabled",true);if(k.success){setTimeout(function(){h.removeClass("is-active")},1500)}else{console.log(k.data);alert(k.data)}}});return false})})(jQuery);
 
changelog.txt CHANGED
@@ -1,3 +1,6 @@
 
 
 
1
  = 4.5.3 =
2
  * Fix. message not saving
3
  * Fix. undefined order, timeto, timeout
1
+ = 4.5.4 =
2
+ * Fix. reload modal on add new contact
3
+
4
  = 4.5.3 =
5
  * Fix. message not saving
6
  * Fix. undefined order, timeto, timeout
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: quadlayers
3
  Donate link: https://quadlayers.com/portfolio/wordpress-whatsapp-chat/
4
  Tags: whatsapp, whatsapp button, whatsapp chat, whatsapp support, contact, click to chat, directly message whatsapp, floating whatsapp, whatsapp business, messaging, help desk
5
  Requires at least: 4.6
6
- Tested up to: 5.3.0
7
- Stable tag: 4.5.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
3
  Donate link: https://quadlayers.com/portfolio/wordpress-whatsapp-chat/
4
  Tags: whatsapp, whatsapp button, whatsapp chat, whatsapp support, contact, click to chat, directly message whatsapp, floating whatsapp, whatsapp business, messaging, help desk
5
  Requires at least: 4.6
6
+ Tested up to: 5.3.2
7
+ Stable tag: 4.5.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
template/box.php CHANGED
@@ -12,7 +12,10 @@
12
  <?php endif; ?>
13
  <div class="qlwapp-body">
14
  <?php if (isset($contacts[0])): ?>
15
- <a class="qlwapp-account" data-action="open" data-phone="<?php echo esc_attr($contacts[0]['phone']); ?>" data-message="<?php echo esc_html($button['message']); ?>" href="javascript:void(0);" target="_blank">
 
 
 
16
  <?php if (!empty($contacts[0]['avatar'])): ?>
17
  <div class="qlwapp-avatar">
18
  <div class="qlwapp-avatar-container">
@@ -34,7 +37,10 @@
34
  <?php endif; ?>
35
  </div>
36
  <?php endif; ?>
37
- <a class="qlwapp-toggle" data-action="<?php echo ($box['enable'] === 'yes' ? 'box' : 'open'); ?>" data-phone="<?php echo esc_attr($button['phone']); ?>" data-message="<?php echo esc_html($button['message']); ?>" href="#" target="_blank">
 
 
 
38
  <?php if ($button['icon']): ?>
39
  <i class="qlwapp-icon <?php echo esc_attr($button['icon']); ?>"></i>
40
  <?php endif; ?>
12
  <?php endif; ?>
13
  <div class="qlwapp-body">
14
  <?php if (isset($contacts[0])): ?>
15
+ <a class="qlwapp-account"
16
+ data-action="open"
17
+ data-phone="<?php echo qlwapp_format_phone($contacts[0]['phone']); ?>"
18
+ data-message="<?php echo esc_html($button['message']); ?>" href="javascript:void(0);" target="_blank">
19
  <?php if (!empty($contacts[0]['avatar'])): ?>
20
  <div class="qlwapp-avatar">
21
  <div class="qlwapp-avatar-container">
37
  <?php endif; ?>
38
  </div>
39
  <?php endif; ?>
40
+ <a class="qlwapp-toggle"
41
+ data-action="<?php echo ($box['enable'] === 'yes' ? 'box' : 'open'); ?>"
42
+ data-phone="<?php echo qlwapp_format_phone($button['phone']); ?>"
43
+ data-message="<?php echo esc_html($button['message']); ?>" href="javascript:void(0);" target="_blank">
44
  <?php if ($button['icon']): ?>
45
  <i class="qlwapp-icon <?php echo esc_attr($button['icon']); ?>"></i>
46
  <?php endif; ?>
wp-whatsapp-chat.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: WhatsApp Chat
5
  * Plugin URI: https://quadlayers.com/portfolio/wordpress-whatsapp-chat/
6
  * Description: WhatsApp Chat allows your visitors to contact you or your team through WhatsApp chat with a single click.
7
- * Version: 4.5.3
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPL-2.0+
@@ -19,7 +19,7 @@ if (!defined('QLWAPP_PLUGIN_NAME')) {
19
  define('QLWAPP_PLUGIN_NAME', 'WhatsApp Chat');
20
  }
21
  if (!defined('QLWAPP_PLUGIN_VERSION')) {
22
- define('QLWAPP_PLUGIN_VERSION', '4.5.3');
23
  }
24
  if (!defined('QLWAPP_PLUGIN_FILE')) {
25
  define('QLWAPP_PLUGIN_FILE', __FILE__);
4
  * Plugin Name: WhatsApp Chat
5
  * Plugin URI: https://quadlayers.com/portfolio/wordpress-whatsapp-chat/
6
  * Description: WhatsApp Chat allows your visitors to contact you or your team through WhatsApp chat with a single click.
7
+ * Version: 4.5.4
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPL-2.0+
19
  define('QLWAPP_PLUGIN_NAME', 'WhatsApp Chat');
20
  }
21
  if (!defined('QLWAPP_PLUGIN_VERSION')) {
22
+ define('QLWAPP_PLUGIN_VERSION', '4.5.4');
23
  }
24
  if (!defined('QLWAPP_PLUGIN_FILE')) {
25
  define('QLWAPP_PLUGIN_FILE', __FILE__);