WhatsApp Chat WP - Version 4.5.1

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.1
Comparing to
See all releases

Code changes from version 4.5.0 to 4.5.1

assets/css/qlwapp-admin.css CHANGED
@@ -63,6 +63,11 @@
63
  cursor: move;
64
  }
65
  /*end re-order*/
 
 
 
 
 
66
  #qlwapp_modal .edit-attachment-frame .attachment-media-view {
67
  width: 75% ;
68
  }
@@ -72,11 +77,6 @@
72
  #qlwapp_modal input[type=time] {
73
  height: 30px;
74
  }
75
- #qlwapp_modal.qlwapp-modal-contact {
76
- max-width: 890px;
77
- max-height: 560px;
78
- margin: auto;
79
- }
80
  #qlwapp_modal.qlwapp-modal-contact table {
81
  width: 100%;
82
  padding: 15px;
@@ -90,6 +90,33 @@
90
  #qlwapp_modal.qlwapp-modal-contact table td {
91
  width: calc(50% - 70px);
92
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  .settings-save-status .spinner {
94
  float: none;
95
  display: inline-block;
63
  cursor: move;
64
  }
65
  /*end re-order*/
66
+ #qlwapp_modal {
67
+ max-width: 890px;
68
+ max-height: 560px;
69
+ margin: auto;
70
+ }
71
  #qlwapp_modal .edit-attachment-frame .attachment-media-view {
72
  width: 75% ;
73
  }
77
  #qlwapp_modal input[type=time] {
78
  height: 30px;
79
  }
 
 
 
 
 
80
  #qlwapp_modal.qlwapp-modal-contact table {
81
  width: 100%;
82
  padding: 15px;
90
  #qlwapp_modal.qlwapp-modal-contact table td {
91
  width: calc(50% - 70px);
92
  }
93
+ #qlwapp_modal.qlwapp-modal-icons .attachments {
94
+ top: 0;
95
+ left: 0;
96
+ right: 0;
97
+ }
98
+ #qlwapp_modal.qlwapp-modal-icons .attachments .thumbnail {
99
+ vertical-align: middle;
100
+ text-align: center;
101
+ }
102
+ #qlwapp_modal.qlwapp-modal-icons .attachments .thumbnail > i {
103
+ text-align: center;
104
+ font-size: 3vw;
105
+ display: inline-block;
106
+ vertical-align: middle;
107
+ height: auto;
108
+ width: auto;
109
+ font-size: 2em;
110
+ position: relative;
111
+ left: -1px;
112
+ }
113
+ #qlwapp_modal.qlwapp-modal-icons .attachments .thumbnail:before {
114
+ content: '';
115
+ display: inline-block;
116
+ width: 0px;
117
+ height: 100%;
118
+ vertical-align: middle;
119
+ }
120
  .settings-save-status .spinner {
121
  float: none;
122
  display: inline-block;
assets/css/qlwapp-admin.css.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../less/qlwapp-admin.less"],"names":[],"mappings":";AAEA,sBACE;AADF,sBAEE;EACE,sBAAA;EACA,mBAAA;EACA,mBAAA;;AALJ,sBAQE,GAAG,IAAG;EACJ,WAAA;EACA,YAAA;;AAIA,sBADF,MACG,YACC,qBACE;EACE,kBAAA;EACA,gBAAA;EACA,WAAA;EACA,cAAA;EACA,WAAA;EACA,YAAA;EACA,SAAA;EACA,eAAA;EACA,YAAA;EACA,gBAAA;EACA,cAAA;EACA,oBAAA;EACA,eAAA;EACA,UAAA;;AACA,sBAlBR,MACG,YACC,qBACE,OAeG;EACC,qBAAA;EACA,kBAAA;EACA,MAAA;EACA,QAAA;EACA,WAAA;EACA,YAAA;EACA,gCAAA;EACA,kBAAA;EACA,cAAA;EACA,mCAAA;EACA,kCAAA;;AAEF,sBA/BR,MACG,YACC,qBACE,OA4BG,WAAW;EACV,SAAS,OAAT;;AAEF,sBAlCR,MACG,YACC,qBACE,OA+BG,aAAa;EACZ,SAAS,OAAT;;AAEF,sBArCR,MACG,YACC,qBACE,OAkCG;EACC,wBAAA;EACA,eAAA;EACA,oBAAA;;AAGJ,sBA3CN,MACG,YACC,qBAyCG;EACC,SAAS,OAAT;EACA,sBAAA;EACA,kBAAA;EACA,cAAA;EACA,WAAA;EACA,cAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;EACA,iBAAA;EACA,YAAA;;;AAYV,aAEE,uBAAuB;EACrB,WAAA;;AAHJ,aAKE,uBAAuB;EACrB,UAAA;;AANJ,aASE,MAAK;EACH,YAAA;;AAGF,aAAC;EACC,gBAAA;EACA,iBAAA;EACA,YAAA;;AAHF,aAAC,qBAKC;EACE,WAAA;EACA,aAAA;EACA,uBAAA;EACA,gBAAA;EACA,mBAAA;;AAVJ,aAAC,qBAKC,MAOE;EACE,WAAA;;AAbN,aAAC,qBAKC,MAWE;EACE,uBAAA;;AAOR,qBAEE;EACE,WAAA;EACA,qBAAA;EACA,cAAA;;AALJ,qBAQE;EACE,eAAA;EACA,aAAA;;AACA,qBAHF,OAGG;EACC,qBAAA;;AAKN;AACA;EACE,YAAA;EACA,eAAA;;AAGF;EACE,SAAA;EACA,YAAA;EACA,sBAAA;EACA,mBAAA","file":"qlwapp-admin.css"}
1
+ {"version":3,"sources":["../less/qlwapp-admin.less"],"names":[],"mappings":";AAEA,sBACE;AADF,sBAEE;EACE,sBAAA;EACA,mBAAA;EACA,mBAAA;;AALJ,sBAQE,GAAG,IAAG;EACJ,WAAA;EACA,YAAA;;AAIA,sBADF,MACG,YACC,qBACE;EACE,kBAAA;EACA,gBAAA;EACA,WAAA;EACA,cAAA;EACA,WAAA;EACA,YAAA;EACA,SAAA;EACA,eAAA;EACA,YAAA;EACA,gBAAA;EACA,cAAA;EACA,oBAAA;EACA,eAAA;EACA,UAAA;;AACA,sBAlBR,MACG,YACC,qBACE,OAeG;EACC,qBAAA;EACA,kBAAA;EACA,MAAA;EACA,QAAA;EACA,WAAA;EACA,YAAA;EACA,gCAAA;EACA,kBAAA;EACA,cAAA;EACA,mCAAA;EACA,kCAAA;;AAEF,sBA/BR,MACG,YACC,qBACE,OA4BG,WAAW;EACV,SAAS,OAAT;;AAEF,sBAlCR,MACG,YACC,qBACE,OA+BG,aAAa;EACZ,SAAS,OAAT;;AAEF,sBArCR,MACG,YACC,qBACE,OAkCG;EACC,wBAAA;EACA,eAAA;EACA,oBAAA;;AAGJ,sBA3CN,MACG,YACC,qBAyCG;EACC,SAAS,OAAT;EACA,sBAAA;EACA,kBAAA;EACA,cAAA;EACA,WAAA;EACA,cAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;EACA,iBAAA;EACA,YAAA;;;AAYV;EAEE,gBAAA;EACA,iBAAA;EACA,YAAA;;AAJF,aAME,uBAAuB;EACrB,WAAA;;AAPJ,aASE,uBAAuB;EACrB,UAAA;;AAVJ,aAaE,MAAK;EACH,YAAA;;AAGF,aAAC,qBAEC;EACE,WAAA;EACA,aAAA;EACA,uBAAA;EACA,gBAAA;EACA,mBAAA;;AAPJ,aAAC,qBAEC,MAOE;EACE,WAAA;;AAVN,aAAC,qBAEC,MAWE;EACE,uBAAA;;AAKN,aAAC,mBAEC;EACE,MAAA;EACA,OAAA;EACA,QAAA;;AALJ,aAAC,mBAEC,aAKE;EACE,sBAAA;EACA,kBAAA;;AATN,aAAC,mBAEC,aAKE,WAIE;EACE,kBAAA;EACA,cAAA;EACA,qBAAA;EACA,sBAAA;EACA,YAAA;EACA,WAAA;EACA,cAAA;EACA,kBAAA;EACA,UAAA;;AAGF,aAvBL,mBAEC,aAKE,WAgBG;EACC,SAAS,EAAT;EACA,qBAAA;EACA,UAAA;EACA,YAAA;EACA,sBAAA;;AAQV,qBAEE;EACE,WAAA;EACA,qBAAA;EACA,cAAA;;AALJ,qBAQE;EACE,eAAA;EACA,aAAA;;AACA,qBAHF,OAGG;EACC,qBAAA;;AAKN;AACA;EACE,YAAA;EACA,eAAA;;AAGF;EACE,SAAA;EACA,YAAA;EACA,sBAAA;EACA,mBAAA","file":"qlwapp-admin.css"}
assets/css/qlwapp-admin.min.css CHANGED
@@ -1,2 +1,2 @@
1
 
2
- .ui-sortable .wc-item-reorder-nav button{position:relative;overflow:hidden;float:left;display:block;width:24px;height:24px;margin:0;background:0;border:0;box-shadow:none;color:#82878c;text-indent:-9999px;cursor:pointer;outline:0}.ui-sortable .wc-item-reorder-nav button::before{display:inline-block;position:absolute;top:0;right:0;width:100%;height:100%;font:normal 20px/23px dashicons;text-align:center;text-indent:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ui-sortable .wc-item-reorder-nav button.wc-move-up::before{content:"\f343"}.ui-sortable .wc-item-reorder-nav button.wc-move-down::before{content:"\f347"}.ui-sortable .wc-item-reorder-nav button.wc-move-disabled{color:#d5d5d5!important;cursor:default;pointer-events:none}.ui-sortable .wc-item-reorder-nav::before{content:"\f333";font-family:Dashicons;text-align:center;line-height:1;color:#999;display:block;width:24px;float:left;height:100%;line-height:24px;cursor:move}#qlwapp_modal .edit-attachment-frame .attachment-info .details,#qlwapp_modal .edit-attachment-frame .attachment-info .settings{border-bottom:0}#qlwapp_modal .edit-attachment-frame .attachment-media-view{width:75%}#qlwapp_modal .edit-attachment-frame .attachment-media-view .titleTable{padding-left:15px;padding-top:5px;border-bottom:1px solid #f1f1f1}#qlwapp_modal .edit-attachment-frame .attachment-info{width:25%;padding-top:32px}#qlwapp_modal .edit-attachment-frame .attachment-info .settings-save-status .is-active{display:inline;color:rgba(13,144,29,0.8)}#qlwapp_modal .media-modal-close{float:left}.settings-save-status .spinner{float:none;display:inline-block;margin:0 10px}.settings-save-status .saved{display:none}.settings-save-status .saved.is-active{display:inline-block;color:rgba(13,144,29,0.8)}#qlwapp_modal .attachments-browser .attachments{top:0;left:0;right:0}#qlwapp_modal .wp-core-ui .attachment .thumbnail,#qlwapp_modal .wp-core-ui .attachment-info .thumbnail{vertical-align:middle;text-align:center}#qlwapp_modal .wp-core-ui .attachment .thumbnail:before,#qlwapp_modal .wp-core-ui .attachment-info .thumbnail:before{content:'';display:inline-block;width:0;height:100%;vertical-align:middle}#qlwapp_modal .wp-core-ui .attachment .thumbnail>i,#qlwapp_modal .wp-core-ui .attachment-info .thumbnail>i{text-align:center;font-size:3vw;display:inline-block;vertical-align:middle;height:auto;width:auto}#qlwapp_modal .wp-core-ui .attachment-info .thumbnail{width:60px;height:60px;background-color:#fff}#qlwapp_modal .wp-core-ui .attachment-info .thumbnail>i{font-size:2em;position:relative;left:-1px}#qlwapp_modal .wp-core-ui .attachment-info .qlwapp-color-picker .container{box-sizing:border-box;width:100%;border-bottom:1px solid #ddd;padding:11px 0}#qlwapp_modal .wp-core-ui .attachment-info .qlwapp-color-picker #qlwapp-input-color{box-sizing:border-box;margin:1px;width:75%;float:right}#qlwapp_modal .wp-core-ui .attachment-info .qlwapp-color-picker .wp-picker-container .wp-color-result{width:100%;margin-top:5px!important}#qlwapp_modal .wp-core-ui .attachment-info .qlwapp-color-picker .wp-picker-container .wp-color-result-text{z-index:1;position:relative}.about-wrap .form-table td img.qlwapp-avatar{width:50px;height:50px}.qlwrap .nav-tab i{line-height:26px}.qlwrap .form-table td{vertical-align:middle}.qlwrap .qlwapp-input,.qlwrap .qlwapp-select2{width:350px;max-width:100%}.qlwrap .qlwapp-input{margin:0;padding:6px;box-sizing:border-box;vertical-align:top}#qlwapp_modal.qlwapp-modal-contact{max-width:890px;max-height:800px;margin:auto}#qlwapp_modal.qlwapp-modal-contact table{width:100%;padding:15px}#qlwapp_modal.qlwapp-modal-contact table:not(:last-child){border-bottom:1px solid #ddd}#qlwapp_modal.qlwapp-modal-contact table th{width:60px}#qlwapp_modal.qlwapp-modal-contact table td{max-width:calc(-10%)}#qlwapp_modal .qlwapp-modal-contact-content{bottom:61px}.submit_up p.submit{text-align:left;max-width:100%;margin-top:20px;padding-top:10px}
1
 
2
+ #qlwapp_contacts_table td,#qlwapp_contacts_table th{padding:1em!important;vertical-align:top;line-height:1.75em}#qlwapp_contacts_table td img.qlwapp-avatar{width:50px;height:50px}#qlwapp_contacts_table tbody.ui-sortable .wc-item-reorder-nav button{position:relative;overflow:hidden;float:left;display:block;width:24px;height:24px;margin:0;background:0;border:0;box-shadow:none;color:#82878c;text-indent:-9999px;cursor:pointer;outline:0}#qlwapp_contacts_table tbody.ui-sortable .wc-item-reorder-nav button::before{display:inline-block;position:absolute;top:0;right:0;width:100%;height:100%;font:normal 20px/23px dashicons;text-align:center;text-indent:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#qlwapp_contacts_table tbody.ui-sortable .wc-item-reorder-nav button.wc-move-up::before{content:"\f343"}#qlwapp_contacts_table tbody.ui-sortable .wc-item-reorder-nav button.wc-move-down::before{content:"\f347"}#qlwapp_contacts_table tbody.ui-sortable .wc-item-reorder-nav button.wc-move-disabled{color:#d5d5d5!important;cursor:default;pointer-events:none}#qlwapp_contacts_table tbody.ui-sortable .wc-item-reorder-nav::before{content:"\f333";font-family:Dashicons;text-align:center;line-height:1;color:#999;display:block;width:24px;float:left;height:100%;line-height:24px;cursor:move}#qlwapp_modal{max-width:890px;max-height:560px;margin:auto}#qlwapp_modal .edit-attachment-frame .attachment-media-view{width:75%}#qlwapp_modal .edit-attachment-frame .attachment-info{width:25%}#qlwapp_modal input[type=time]{height:30px}#qlwapp_modal.qlwapp-modal-contact table{width:100%;padding:15px;border-width:1px 0 0 0;box-shadow:none;table-layout:fixed}#qlwapp_modal.qlwapp-modal-contact table th{width:70px}#qlwapp_modal.qlwapp-modal-contact table td{width:calc(50% - 70px)}#qlwapp_modal.qlwapp-modal-icons .attachments{top:0;left:0;right:0}#qlwapp_modal.qlwapp-modal-icons .attachments .thumbnail{vertical-align:middle;text-align:center}#qlwapp_modal.qlwapp-modal-icons .attachments .thumbnail>i{text-align:center;font-size:3vw;display:inline-block;vertical-align:middle;height:auto;width:auto;font-size:2em;position:relative;left:-1px}#qlwapp_modal.qlwapp-modal-icons .attachments .thumbnail:before{content:'';display:inline-block;width:0;height:100%;vertical-align:middle}.settings-save-status .spinner{float:none;display:inline-block;margin:0 10px}.settings-save-status .saved{font-size:12px;display:none}.settings-save-status .saved.is-active{display:inline-block}.qlwapp-input,.qlwapp-select2{width:350px;max-width:100%}.qlwapp-input{margin:0;padding:6px;box-sizing:border-box;vertical-align:top}
assets/js/{qlwapp-contact-modal.js → qlwapp-admin-contact.js} RENAMED
File without changes
assets/js/{qlwapp-contact-modal.min.js → qlwapp-admin-contact.min.js} RENAMED
@@ -1 +1,2 @@
 
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){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
+
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);
assets/js/qlwapp-admin.js CHANGED
@@ -1,50 +1,17 @@
1
  (function ($) {
2
- //
3
- // $.fn.serializeArrayAll = function () {
4
- // var o = {};
5
- // var a = this.serializeArray();
6
- // $.each(a, function () {
7
- // if (o[this.name] !== undefined) {
8
- // if (!o[this.name].push) {
9
- // o[this.name] = [o[this.name]];
10
- // }
11
- // o[this.name].push(this.value || '');
12
- // } else {
13
- // o[this.name] = this.value || '';
14
- // }
15
- // });
16
- // var $radio = $('input[type=radio],input[type=checkbox]', this);
17
- // $.each($radio, function () {
18
- // if (!o.hasOwnProperty(this.name)) {
19
- // o[this.name] = '';
20
- // }
21
- // });
22
- // return o;
23
- // };
24
 
25
  // Disbled all
26
  // ---------------------------------------------------------------------------
27
  function disabled(value) {
28
  if (value) {
29
- $('.button-primary').attr('disabled', true);
30
  } else {
31
- $('.button-primary').attr('disabled', false);
32
  }
33
  }
34
 
35
- // Validation box.contact.phone number
36
- // ---------------------------------------------------------------------------
37
- $('form :input').keyup(function (e) {
38
- if (!this.reportValidity()) {
39
- $(this).closest('td').addClass('form-invalid');
40
- $('#btn-save-contact').attr('disabled', 'disabled');
41
- } else {
42
- $('#btn-save-contact').removeAttr('disabled');
43
- $(this).closest('td').removeClass('form-invalid');
44
- ;
45
- }
46
- });
47
-
48
  $('form').change(function (e) {
49
  disabled(false);
50
  });
@@ -62,7 +29,9 @@
62
  },
63
  });
64
 
65
- disabled(true);
 
 
66
 
67
  $('.qlwapp-select2').select2({allowClear: false, theme: 'default', minimumResultsForSearch: -1});
68
 
@@ -107,8 +76,6 @@
107
  });
108
 
109
  $('.qlwapp-color-field').wpColorPicker();
110
- //});
111
-
112
 
113
  $(document).on('click', '.upload_image_button', function (e) {
114
  e.preventDefault();
@@ -135,7 +102,7 @@
135
  $(this).parent().prev().attr('src', src);
136
 
137
  $(this).prev().prev().val('').trigger('change');
138
-
139
  return false;
140
  });
141
 
1
  (function ($) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  // Disbled all
4
  // ---------------------------------------------------------------------------
5
  function disabled(value) {
6
  if (value) {
7
+ $('input[type=submit]').attr('disabled', true);
8
  } else {
9
+ $('input[type=submit]').attr('disabled', false);
10
  }
11
  }
12
 
13
+ disabled(true);
14
+
 
 
 
 
 
 
 
 
 
 
 
15
  $('form').change(function (e) {
16
  disabled(false);
17
  });
29
  },
30
  });
31
 
32
+ $(document).on('tinymce_change', function (e) {
33
+ disabled(false);
34
+ });
35
 
36
  $('.qlwapp-select2').select2({allowClear: false, theme: 'default', minimumResultsForSearch: -1});
37
 
76
  });
77
 
78
  $('.qlwapp-color-field').wpColorPicker();
 
 
79
 
80
  $(document).on('click', '.upload_image_button', function (e) {
81
  e.preventDefault();
102
  $(this).parent().prev().attr('src', src);
103
 
104
  $(this).prev().prev().val('').trigger('change');
105
+
106
  return false;
107
  });
108
 
assets/js/qlwapp-admin.min.js CHANGED
@@ -1 +1 @@
1
- (function(b){function a(c){if(c){b(".button-primary").attr("disabled",true)}else{b(".button-primary").attr("disabled",false)}}b("form :input").keyup(function(c){if(!this.reportValidity()){b(this).closest("td").addClass("form-invalid");b("#btn-save-contact").attr("disabled","disabled")}else{b("#btn-save-contact").removeAttr("disabled");b(this).closest("td").removeClass("form-invalid")}});b("form").change(function(c){a(false)});b(".button").click(function(){a(false)});b("button").click(function(){a(false)});b(".qlwapp-color-field").wpColorPicker({change:function(c,d){a(false)},});a(true);b(".qlwapp-select2").select2({allowClear:false,theme:"default",minimumResultsForSearch:-1});b(".qlwapp-select2-ajax").each(function(){var d=b(this),c=b(this).data("name");d.select2({allowClear:true,ajax:{url:ajaxurl,dataType:"json",data:function(e){return{name:c,per_page:10,q:e.term||0,selected:d.select2("val")||0,action:"qlwapp_get_posts",nonce:qlwapp.nonce.qlwapp_get_posts}},processResults:function(e){var f=[];if(e){b.each(e,function(g,h){f.push({id:h[0],text:h[1]})})}return{results:f}},cache:true},minimumInputLength:3})});b(".qlwapp-color-field").wpColorPicker();b(document).on("click",".upload_image_button",function(f){f.preventDefault();var c=wp.media.editor.send.attachment,d=b(this);wp.media.editor.send.attachment=function(e,g){b(d).parent().prev().attr("src",g.url);b(d).prev().val(g.url).trigger("change");wp.media.editor.send.attachment=c};wp.media.editor.open(d);return false});b(document).on("click",".remove_image_button",function(c){c.preventDefault();var d=b(this).parent().prev().attr("data-src");b(this).parent().prev().attr("src",d);b(this).prev().prev().val("").trigger("change");return false});b(document).on("qlwapp.save","form",function(i,h,f){var c=b(i.currentTarget),g=c.find(".settings-save-status .spinner"),d=c.find(".settings-save-status .saved");b.ajax({url:ajaxurl,data:{action:h,nonce:f,form_data:c.serialize()},dataType:"json",type:"POST",beforeSend:function(){a(true);g.addClass("is-active")},complete:function(){g.removeClass("is-active")},error:function(e){console.log(e)},success:function(e){d.addClass("is-active");if(e.success){setTimeout(function(){d.removeClass("is-active")},2000);console.log(e.data)}else{alert(e.data)}}});return false});b(document).on("submit","#qlwapp_button_form",function(f){f.preventDefault();var c=b(this),d=c.find("#qlwapp_button_form_nonce").val();c.trigger("qlwapp.save",["qlwapp_save_button",d])});b(document).on("submit","#qlwapp_box_form",function(f){f.preventDefault();var c=b(this),d=c.find("#qlwapp_box_form_nonce").val();c.trigger("qlwapp.save",["qlwapp_save_box",d])});b(document).on("submit","#qlwapp_display_form",function(f){f.preventDefault();var c=b(this),d=c.find("#qlwapp_display_form_nonce").val();c.trigger("qlwapp.save",["qlwapp_save_display",d])});b(document).on("submit","#qlwapp_scheme_form",function(f){f.preventDefault();var c=b(this),d=c.find("#qlwapp_scheme_form_nonce").val();c.trigger("qlwapp.save",["qlwapp_save_scheme",d])})})(jQuery);
1
+ (function(b){function a(c){if(c){b("input[type=submit]").attr("disabled",true)}else{b("input[type=submit]").attr("disabled",false)}}a(true);b("form").change(function(c){a(false)});b(".button").click(function(){a(false)});b("button").click(function(){a(false)});b(".qlwapp-color-field").wpColorPicker({change:function(c,d){a(false)},});b(document).on("tinymce_change",function(c){a(false)});b(".qlwapp-select2").select2({allowClear:false,theme:"default",minimumResultsForSearch:-1});b(".qlwapp-select2-ajax").each(function(){var d=b(this),c=b(this).data("name");d.select2({allowClear:true,ajax:{url:ajaxurl,dataType:"json",data:function(e){return{name:c,per_page:10,q:e.term||0,selected:d.select2("val")||0,action:"qlwapp_get_posts",nonce:qlwapp.nonce.qlwapp_get_posts}},processResults:function(e){var f=[];if(e){b.each(e,function(g,h){f.push({id:h[0],text:h[1]})})}return{results:f}},cache:true},minimumInputLength:3})});b(".qlwapp-color-field").wpColorPicker();b(document).on("click",".upload_image_button",function(f){f.preventDefault();var c=wp.media.editor.send.attachment,d=b(this);wp.media.editor.send.attachment=function(e,g){b(d).parent().prev().attr("src",g.url);b(d).prev().val(g.url).trigger("change");wp.media.editor.send.attachment=c};wp.media.editor.open(d);return false});b(document).on("click",".remove_image_button",function(c){c.preventDefault();var d=b(this).parent().prev().attr("data-src");b(this).parent().prev().attr("src",d);b(this).prev().prev().val("").trigger("change");return false});b(document).on("qlwapp.save","form",function(i,h,f){var c=b(i.currentTarget),g=c.find(".settings-save-status .spinner"),d=c.find(".settings-save-status .saved");b.ajax({url:ajaxurl,data:{action:h,nonce:f,form_data:c.serialize()},dataType:"json",type:"POST",beforeSend:function(){a(true);g.addClass("is-active")},complete:function(){g.removeClass("is-active")},error:function(e){console.log(e)},success:function(e){d.addClass("is-active");if(e.success){setTimeout(function(){d.removeClass("is-active")},2000);console.log(e.data)}else{alert(e.data)}}});return false});b(document).on("submit","#qlwapp_button_form",function(f){f.preventDefault();var c=b(this),d=c.find("#qlwapp_button_form_nonce").val();c.trigger("qlwapp.save",["qlwapp_save_button",d])});b(document).on("submit","#qlwapp_box_form",function(f){f.preventDefault();var c=b(this),d=c.find("#qlwapp_box_form_nonce").val();c.trigger("qlwapp.save",["qlwapp_save_box",d])});b(document).on("submit","#qlwapp_display_form",function(f){f.preventDefault();var c=b(this),d=c.find("#qlwapp_display_form_nonce").val();c.trigger("qlwapp.save",["qlwapp_save_display",d])});b(document).on("submit","#qlwapp_scheme_form",function(f){f.preventDefault();var c=b(this),d=c.find("#qlwapp_scheme_form_nonce").val();c.trigger("qlwapp.save",["qlwapp_save_scheme",d])})})(jQuery);
includes/controllers/BoxController.php CHANGED
@@ -13,6 +13,7 @@ class QLWAPP_Box_Controller extends QLWAPP_Controller {
13
  }
14
 
15
  function add_panel() {
 
16
  $box_model = new QLWAPP_Box();
17
  $box = $box_model->get();
18
  include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
@@ -25,13 +26,13 @@ class QLWAPP_Box_Controller extends QLWAPP_Controller {
25
  }
26
 
27
  public function ajax_qlwapp_save_box() {
28
- $box = new QLWAPP_Box();
29
  if (current_user_can('manage_options')) {
30
  if (check_ajax_referer('qlwapp_save_box', 'nonce', false) && isset($_REQUEST['form_data'])) {
31
  $form_data = array();
32
  parse_str($_REQUEST['form_data'], $form_data);
33
- if (is_array($form_data)) {
34
- $box->save($form_data);
35
  return parent::success_save($form_data);
36
  }
37
  return parent::error_reload_page();
13
  }
14
 
15
  function add_panel() {
16
+ global $submenu;
17
  $box_model = new QLWAPP_Box();
18
  $box = $box_model->get();
19
  include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
26
  }
27
 
28
  public function ajax_qlwapp_save_box() {
29
+ $box_model = new QLWAPP_Box();
30
  if (current_user_can('manage_options')) {
31
  if (check_ajax_referer('qlwapp_save_box', 'nonce', false) && isset($_REQUEST['form_data'])) {
32
  $form_data = array();
33
  parse_str($_REQUEST['form_data'], $form_data);
34
+ if (is_array($form_data)) {
35
+ $box_model->save($form_data);
36
  return parent::success_save($form_data);
37
  }
38
  return parent::error_reload_page();
includes/controllers/ButtonController.php CHANGED
@@ -13,9 +13,11 @@ class QLWAPP_Button_Controller extends QLWAPP_Controller {
13
  }
14
 
15
  function add_panel() {
16
-
 
 
17
  $button_model = new QLWAPP_Button();
18
- $button = $button_model->get();
19
  include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
20
  include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/button.php');
21
  }
@@ -26,13 +28,13 @@ class QLWAPP_Button_Controller extends QLWAPP_Controller {
26
  }
27
 
28
  public function ajax_qlwapp_save_button() {
29
- $button = new QLWAPP_Button();
30
  if (current_user_can('manage_options')) {
31
  if (check_ajax_referer('qlwapp_save_button', 'nonce', false) && isset($_REQUEST['form_data'])) {
32
  $form_data = array();
33
  parse_str($_REQUEST['form_data'], $form_data);
34
  if (is_array($form_data)) {
35
- $button->save($form_data);
36
  return parent::success_save($form_data);
37
  }
38
  return parent::error_reload_page();
13
  }
14
 
15
  function add_panel() {
16
+
17
+ global $submenu;
18
+
19
  $button_model = new QLWAPP_Button();
20
+ $button = $button_model->get();
21
  include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
22
  include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/button.php');
23
  }
28
  }
29
 
30
  public function ajax_qlwapp_save_button() {
31
+ $button_model = new QLWAPP_Button();
32
  if (current_user_can('manage_options')) {
33
  if (check_ajax_referer('qlwapp_save_button', 'nonce', false) && isset($_REQUEST['form_data'])) {
34
  $form_data = array();
35
  parse_str($_REQUEST['form_data'], $form_data);
36
  if (is_array($form_data)) {
37
+ $button_model->save($form_data);
38
  return parent::success_save($form_data);
39
  }
40
  return parent::error_reload_page();
includes/controllers/ContactController.php CHANGED
@@ -13,6 +13,7 @@ class QLWAPP_Contact_Controller extends QLWAPP_Controller {
13
  }
14
 
15
  function add_panel() {
 
16
  $contact_model = new QLWAPP_Contact();
17
  $contacts = $contact_model->get_contacts_reorder();
18
  $contact_args = $contact_model->get_args();
@@ -117,9 +118,9 @@ class QLWAPP_Contact_Controller extends QLWAPP_Controller {
117
  if (isset($_GET['page']) && ($_GET['page'] === 'qlwapp_contacts')) {
118
  $contact_model = new QLWAPP_Contact();
119
  wp_enqueue_media();
120
- wp_enqueue_script('qlwapp-contact-modal', plugins_url('/assets/js/qlwapp-contact-modal' . QLWAPP::is_min() . '.js', QLWAPP_PLUGIN_FILE), array('jquery', 'backbone',), QLWAPP_PLUGIN_VERSION, true);
121
 
122
- wp_localize_script('qlwapp-contact-modal', 'qlwapp_contact', array(
123
  'nonce' => array(
124
  'qlwapp_get_contact' => wp_create_nonce('qlwapp_get_contact'),
125
  'qlwapp_edit_contact' => wp_create_nonce('qlwapp_edit_contact'),
13
  }
14
 
15
  function add_panel() {
16
+ global $submenu;
17
  $contact_model = new QLWAPP_Contact();
18
  $contacts = $contact_model->get_contacts_reorder();
19
  $contact_args = $contact_model->get_args();
118
  if (isset($_GET['page']) && ($_GET['page'] === 'qlwapp_contacts')) {
119
  $contact_model = new QLWAPP_Contact();
120
  wp_enqueue_media();
121
+ wp_enqueue_script('qlwapp-admin-contact', plugins_url('/assets/js/qlwapp-admin-contact' . QLWAPP::is_min() . '.js', QLWAPP_PLUGIN_FILE), array('jquery', 'backbone'), QLWAPP_PLUGIN_VERSION, true);
122
 
123
+ wp_localize_script('qlwapp-admin-contact', 'qlwapp_contact', array(
124
  'nonce' => array(
125
  'qlwapp_get_contact' => wp_create_nonce('qlwapp_get_contact'),
126
  'qlwapp_edit_contact' => wp_create_nonce('qlwapp_edit_contact'),
includes/controllers/DisplayController.php CHANGED
@@ -13,6 +13,7 @@ class QLWAPP_Display_Controller extends QLWAPP_Controller {
13
  }
14
 
15
  function add_panel() {
 
16
  $display_model = new QLWAPP_Display();
17
  $display = $display_model->get();
18
  include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
@@ -25,13 +26,13 @@ class QLWAPP_Display_Controller extends QLWAPP_Controller {
25
  }
26
 
27
  public function ajax_qlwapp_save_display() {
28
- $display = new QLWAPP_Display();
29
  if (current_user_can('manage_options')) {
30
  if (check_ajax_referer('qlwapp_save_display', 'nonce', false) && isset($_REQUEST['form_data'])) {
31
  $form_data = array();
32
  parse_str($_REQUEST['form_data'], $form_data);
33
  if (is_array($form_data)) {
34
- $display->save($form_data);
35
  return parent::success_save($form_data);
36
  }
37
  return parent::error_reload_page();
@@ -40,31 +41,6 @@ class QLWAPP_Display_Controller extends QLWAPP_Controller {
40
  }
41
  }
42
 
43
- //// debe ser de compatibilidatda
44
- function wac_options($options) {
45
-
46
- if ($mobile = get_option('whatsapp_chat_mobile')) {
47
- $options['display']['devices'] = 'mobile';
48
- }
49
- if (get_option('whatsapp_chat_hide_button')) {
50
- $options['display']['devices'] = 'hide';
51
- }
52
- if (get_option('whatsapp_chat_hide_post')) {
53
- $options['display']['post'] = array('none');
54
- }
55
- if (get_option('whatsapp_chat_hide_page')) {
56
- $options['display']['page'] = array('none');
57
- }
58
- if (get_option('whatsapp_chat_hide_product')) {
59
- $options['display']['product'] = array('none');
60
- }
61
- if (get_option('whatsapp_chat_hide_project')) {
62
- $options['display']['project'] = array('none');
63
- }
64
-
65
- return $options;
66
- }
67
-
68
  public static function instance() {
69
  if (!isset(self::$instance)) {
70
  self::$instance = new self();
13
  }
14
 
15
  function add_panel() {
16
+ global $submenu;
17
  $display_model = new QLWAPP_Display();
18
  $display = $display_model->get();
19
  include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
26
  }
27
 
28
  public function ajax_qlwapp_save_display() {
29
+ $display_model = new QLWAPP_Display();
30
  if (current_user_can('manage_options')) {
31
  if (check_ajax_referer('qlwapp_save_display', 'nonce', false) && isset($_REQUEST['form_data'])) {
32
  $form_data = array();
33
  parse_str($_REQUEST['form_data'], $form_data);
34
  if (is_array($form_data)) {
35
+ $display_model->save($form_data);
36
  return parent::success_save($form_data);
37
  }
38
  return parent::error_reload_page();
41
  }
42
  }
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  public static function instance() {
45
  if (!isset(self::$instance)) {
46
  self::$instance = new self();
includes/controllers/PremiumController.php CHANGED
@@ -2,29 +2,29 @@
2
 
3
  class QLWAPP_Premium_Controller {
4
 
5
- protected static $instance;
6
-
7
- function add_menu() {
8
- add_submenu_page(QLWAPP_DOMAIN, esc_html__('Premium', 'wp-whatsapp-chat'), sprintf('%s <i class="dashicons dashicons-awards"></i>', esc_html__('Premium', 'wp-whatsapp-chat')), 'edit_posts', QLWAPP_DOMAIN . '_premium', array($this, 'add_panel'));
9
- }
10
-
11
- function add_panel() {
12
-
13
- include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
14
- include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/premium.php');
15
- }
16
-
17
- function init() {
18
- add_action('admin_menu', array($this, 'add_menu'));
19
- }
20
-
21
- public static function instance() {
22
- if (!isset(self::$instance)) {
23
- self::$instance = new self();
24
- self::$instance->init();
25
- }
26
- return self::$instance;
27
  }
 
 
28
 
29
  }
30
 
2
 
3
  class QLWAPP_Premium_Controller {
4
 
5
+ protected static $instance;
6
+
7
+ function add_menu() {
8
+ add_submenu_page(QLWAPP_DOMAIN, esc_html__('Premium', 'wp-whatsapp-chat'), sprintf('%s <i class="dashicons dashicons-awards"></i>', esc_html__('Premium', 'wp-whatsapp-chat')), 'edit_posts', QLWAPP_DOMAIN . '_premium', array($this, 'add_panel'));
9
+ }
10
+
11
+ function add_panel() {
12
+ global $submenu;
13
+ include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
14
+ include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/premium.php');
15
+ }
16
+
17
+ function init() {
18
+ add_action('admin_menu', array($this, 'add_menu'));
19
+ }
20
+
21
+ public static function instance() {
22
+ if (!isset(self::$instance)) {
23
+ self::$instance = new self();
24
+ self::$instance->init();
 
 
25
  }
26
+ return self::$instance;
27
+ }
28
 
29
  }
30
 
includes/controllers/QLWAPP_Controller.php CHANGED
@@ -16,7 +16,7 @@ class QLWAPP_Controller {
16
  }
17
 
18
  function error_access_denied() {
19
- wp_send_json_error(esc_html__('access denied', 'wp-whatsapp-chat'));
20
  }
21
 
22
 
16
  }
17
 
18
  function error_access_denied() {
19
+ wp_send_json_error(esc_html__('Access denied', 'wp-whatsapp-chat'));
20
  }
21
 
22
 
includes/controllers/SchemeController.php CHANGED
@@ -14,6 +14,7 @@ class QLWAPP_Scheme_Controller extends QLWAPP_Controller {
14
  }
15
 
16
  function add_panel() {
 
17
  $scheme_model = new QLWAPP_Scheme();
18
  $scheme = $scheme_model->get();
19
  include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
@@ -26,13 +27,13 @@ class QLWAPP_Scheme_Controller extends QLWAPP_Controller {
26
  }
27
 
28
  public function ajax_qlwapp_save_scheme() {
29
- $scheme = new QLWAPP_Scheme();
30
  if (current_user_can('manage_options')) {
31
  if (check_ajax_referer('qlwapp_save_scheme', 'nonce', false) && isset($_REQUEST['form_data'])) {
32
  $form_data = array();
33
  parse_str($_REQUEST['form_data'], $form_data);
34
- if (is_array($form_data)) {
35
- $scheme->save($form_data);
36
  return parent::success_save($form_data);
37
  }
38
  return parent::error_reload_page();
14
  }
15
 
16
  function add_panel() {
17
+ global $submenu;
18
  $scheme_model = new QLWAPP_Scheme();
19
  $scheme = $scheme_model->get();
20
  include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
27
  }
28
 
29
  public function ajax_qlwapp_save_scheme() {
30
+ $scheme_model = new QLWAPP_Scheme();
31
  if (current_user_can('manage_options')) {
32
  if (check_ajax_referer('qlwapp_save_scheme', 'nonce', false) && isset($_REQUEST['form_data'])) {
33
  $form_data = array();
34
  parse_str($_REQUEST['form_data'], $form_data);
35
+ if (is_array($form_data)) {
36
+ $scheme_model->save($form_data);
37
  return parent::success_save($form_data);
38
  }
39
  return parent::error_reload_page();
includes/controllers/SuggestionsController.php CHANGED
@@ -2,58 +2,57 @@
2
 
3
  class QLWAPP_Suggestions_Controller {
4
 
5
- protected static $instance;
6
-
7
- function add_menu() {
8
- add_submenu_page(QLWAPP_DOMAIN, esc_html__('Suggestions', 'wp-whatsapp-chat'), sprintf('%s', esc_html__('Suggestions', 'wp-whatsapp-chat')), 'edit_posts', QLWAPP_DOMAIN . '_suggestions', array($this, 'add_panel'), 99);
9
- }
10
-
11
- function add_panel() {
12
-
13
- include_once(QLWAPP_PLUGIN_DIR . 'includes/models/Suggestions.php');
14
-
15
- $wp_list_table = new QLWAPP_Suggestions_List_Table();
16
- $wp_list_table->prepare_items();
17
- include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
18
- include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/suggestions.php');
19
- }
20
-
21
- // fix for activateUrl on install now button
22
- public function network_admin_url($url, $path) {
23
-
24
- if (wp_doing_ajax() && !is_network_admin()) {
25
- if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'install-plugin') {
26
- if (strpos($url, 'plugins.php') !== false) {
27
- $url = self_admin_url($path);
28
- }
29
- }
30
  }
31
-
32
- return $url;
33
  }
34
 
35
- public function add_redirect() {
 
36
 
37
- if (isset($_REQUEST['activate']) && $_REQUEST['activate'] == 'true') {
38
- if (wp_get_referer() == admin_url('admin.php?page=' . QLWAPP_DOMAIN . '_suggestions')) {
39
- wp_redirect(admin_url('admin.php?page=' . QLWAPP_DOMAIN . '_suggestions'));
40
- }
41
- }
42
- }
43
 
44
- function init() {
45
- add_action('admin_menu', array($this, 'add_menu'));
46
- add_action('admin_init', array($this, 'add_redirect'));
47
- add_filter('network_admin_url', array($this, 'network_admin_url'), 10, 2);
48
  }
49
-
50
- public static function instance() {
51
- if (!isset(self::$instance)) {
52
- self::$instance = new self();
53
- self::$instance->init();
54
- }
55
- return self::$instance;
 
 
 
 
 
56
  }
 
 
57
 
58
  }
59
 
2
 
3
  class QLWAPP_Suggestions_Controller {
4
 
5
+ protected static $instance;
6
+
7
+ function add_menu() {
8
+ add_submenu_page(QLWAPP_DOMAIN, esc_html__('Suggestions', 'wp-whatsapp-chat'), sprintf('%s', esc_html__('Suggestions', 'wp-whatsapp-chat')), 'edit_posts', QLWAPP_DOMAIN . '_suggestions', array($this, 'add_panel'), 99);
9
+ }
10
+
11
+ function add_panel() {
12
+ global $submenu;
13
+ include_once(QLWAPP_PLUGIN_DIR . 'includes/models/Suggestions.php');
14
+ $wp_list_table = new QLWAPP_Suggestions_List_Table();
15
+ $wp_list_table->prepare_items();
16
+ include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
17
+ include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/suggestions.php');
18
+ }
19
+
20
+ // fix for activateUrl on install now button
21
+ public function network_admin_url($url, $path) {
22
+
23
+ if (wp_doing_ajax() && !is_network_admin()) {
24
+ if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'install-plugin') {
25
+ if (strpos($url, 'plugins.php') !== false) {
26
+ $url = self_admin_url($path);
 
 
 
27
  }
28
+ }
 
29
  }
30
 
31
+ return $url;
32
+ }
33
 
34
+ public function add_redirect() {
 
 
 
 
 
35
 
36
+ if (isset($_REQUEST['activate']) && $_REQUEST['activate'] == 'true') {
37
+ if (wp_get_referer() == admin_url('admin.php?page=' . QLWAPP_DOMAIN . '_suggestions')) {
38
+ wp_redirect(admin_url('admin.php?page=' . QLWAPP_DOMAIN . '_suggestions'));
39
+ }
40
  }
41
+ }
42
+
43
+ function init() {
44
+ add_action('admin_menu', array($this, 'add_menu'));
45
+ add_action('admin_init', array($this, 'add_redirect'));
46
+ add_filter('network_admin_url', array($this, 'network_admin_url'), 10, 2);
47
+ }
48
+
49
+ public static function instance() {
50
+ if (!isset(self::$instance)) {
51
+ self::$instance = new self();
52
+ self::$instance->init();
53
  }
54
+ return self::$instance;
55
+ }
56
 
57
  }
58
 
includes/controllers/WelcomeController.php CHANGED
@@ -1,32 +1,32 @@
1
  <?php
2
-
3
 
4
  class QLWAPP_Welcome_Controller {
5
 
6
- protected static $instance;
7
 
8
- function add_menu() {
9
- add_menu_page(QLWAPP_PLUGIN_NAME, QLWAPP_PLUGIN_NAME, 'edit_posts', QLWAPP_DOMAIN, array($this, 'add_panel'), plugins_url('/assets/img/icon.png', QLWAPP_PLUGIN_FILE));
10
 
11
- add_submenu_page(QLWAPP_DOMAIN, esc_html__('Welcome', 'wp-whatsapp-chat'), esc_html__('Welcome', 'wp-whatsapp-chat'), 'edit_posts', QLWAPP_DOMAIN, array($this, 'add_panel'));
12
- }
13
 
14
- function add_panel() {
15
- include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
16
- include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/welcome.php');
17
- }
 
18
 
19
- function init() {
20
- add_action('admin_menu', array($this, 'add_menu'));
21
- }
22
 
23
- public static function instance() {
24
- if (!isset(self::$instance)) {
25
- self::$instance = new self();
26
- self::$instance->init();
27
- }
28
- return self::$instance;
29
  }
 
 
30
 
31
  }
32
 
1
  <?php
 
2
 
3
  class QLWAPP_Welcome_Controller {
4
 
5
+ protected static $instance;
6
 
7
+ function add_menu() {
8
+ add_menu_page(QLWAPP_PLUGIN_NAME, QLWAPP_PLUGIN_NAME, 'edit_posts', QLWAPP_DOMAIN, array($this, 'add_panel'), plugins_url('/assets/img/icon.png', QLWAPP_PLUGIN_FILE));
9
 
10
+ add_submenu_page(QLWAPP_DOMAIN, esc_html__('Welcome', 'wp-whatsapp-chat'), esc_html__('Welcome', 'wp-whatsapp-chat'), 'edit_posts', QLWAPP_DOMAIN, array($this, 'add_panel'));
11
+ }
12
 
13
+ function add_panel() {
14
+ global $submenu;
15
+ include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
16
+ include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/welcome.php');
17
+ }
18
 
19
+ function init() {
20
+ add_action('admin_menu', array($this, 'add_menu'));
21
+ }
22
 
23
+ public static function instance() {
24
+ if (!isset(self::$instance)) {
25
+ self::$instance = new self();
26
+ self::$instance->init();
 
 
27
  }
28
+ return self::$instance;
29
+ }
30
 
31
  }
32
 
includes/notices.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class QLWAPP_Notices {
4
+
5
+ protected static $instance;
6
+
7
+ public static function instance() {
8
+ if (is_null(self::$instance)) {
9
+ self::$instance = new self();
10
+ self::$instance->init();
11
+ }
12
+ return self::$instance;
13
+ }
14
+
15
+ function init() {
16
+ add_filter('plugin_action_links_' . plugin_basename(QLWAPP_PLUGIN_FILE), array($this, 'add_action_links'));
17
+ add_action('admin_notices', array($this, 'add_notices'));
18
+ add_action('wp_ajax_qlwapp_dismiss_notice', array($this, 'ajax_dismiss_notice'));
19
+ }
20
+
21
+ function ajax_dismiss_notice() {
22
+
23
+ if (check_admin_referer('qlwapp_dismiss_notice', 'nonce') && isset($_REQUEST['notice_id'])) {
24
+
25
+ $notice_id = sanitize_key($_REQUEST['notice_id']);
26
+
27
+ update_user_meta(get_current_user_id(), $notice_id, true);
28
+
29
+ wp_send_json($notice_id);
30
+ }
31
+
32
+ wp_die();
33
+ }
34
+
35
+ function add_notices() {
36
+
37
+ if (!get_transient('qlwapp-first-rating') && !get_user_meta(get_current_user_id(), 'qlwapp-user-rating', true)) {
38
+ ?>
39
+ <div id="qlwapp-admin-rating" class="qlwapp-notice notice is-dismissible" data-notice_id="qlwapp-user-rating">
40
+ <div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
41
+ <div class="notice-image">
42
+ <img style="border-radius:50%;max-width: 90px;" src="<?php echo plugins_url('/assets/img/logo.jpg', QLWAPP_PLUGIN_FILE); ?>" alt="<?php echo esc_html(QLWAPP_PLUGIN_NAME); ?>>">
43
+ </div>
44
+ <div class="notice-content" style="margin-left: 15px;">
45
+ <p>
46
+ <?php printf(esc_html__('Hello! Thank you for choosing the %s plugin!', 'wp-whatsapp-chat'), QLWAPP_PLUGIN_NAME); ?>
47
+ <br/>
48
+ <?php esc_html_e('Could you please give it a 5-star rating on WordPress? We know its a big favor, but we\'ve worked very much and very hard to release this great product. Your feedback will boost our motivation and help us promote and continue to improve this product.', 'wp-whatsapp-chat'); ?>
49
+ </p>
50
+ <a href="<?php echo esc_url(QLWAPP_REVIEW_URL); ?>" class="button-primary" target="_blank">
51
+ <?php esc_html_e('Yes, of course!', 'wp-whatsapp-chat'); ?>
52
+ </a>
53
+ <a href="<?php echo esc_url(QLWAPP_SUPPORT_URL); ?>" class="button-secondary" target="_blank">
54
+ <?php esc_html_e('Report a bug', 'wp-whatsapp-chat'); ?>
55
+ </a>
56
+ </div>
57
+ </div>
58
+ </div>
59
+ <script>
60
+ (function ($) {
61
+ $('.qlwapp-notice').on('click', '.notice-dismiss', function (e) {
62
+ e.preventDefault();
63
+ var notice_id = $(e.delegateTarget).data('notice_id');
64
+ $.ajax({
65
+ type: 'POST',
66
+ url: ajaxurl,
67
+ data: {
68
+ notice_id: notice_id,
69
+ action: 'qlwapp_dismiss_notice',
70
+ nonce: '<?php echo wp_create_nonce('qlwapp_dismiss_notice'); ?>'
71
+ },
72
+ success: function (response) {
73
+ console.log(response);
74
+ },
75
+ });
76
+ });
77
+ })(jQuery);
78
+ </script>
79
+ <?php
80
+ }
81
+ }
82
+
83
+ public function add_action_links($links) {
84
+
85
+ $links[] = '<a target="_blank" href="' . QLWAPP_PURCHASE_URL . '">' . esc_html__('Premium', 'woocommerce-checkout-manager') . '</a>';
86
+ $links[] = '<a href="' . admin_url('admin.php?page=wc-settings&tab=' . sanitize_title(QLWAPP_PREFIX)) . '">' . esc_html__('Settings', 'woocommerce-checkout-manager') . '</a>';
87
+
88
+ return $links;
89
+ }
90
+
91
+ }
92
+
93
+ QLWAPP_Notices::instance();
includes/qlwapp.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class QLWAPP {
4
+
5
+ protected static $instance;
6
+
7
+ function includes() {
8
+ include_once('notices.php');
9
+ include_once('settings.php');
10
+ include_once('frontend.php');
11
+ include_once('backend.php');
12
+ }
13
+
14
+ public static function is_min() {
15
+ if (!defined('SCRIPT_DEBUG') || !SCRIPT_DEBUG) {
16
+ return '.min';
17
+ }
18
+ }
19
+
20
+ function add_premium_js() {
21
+ if (!class_exists('QLWAPP_PRO')) {
22
+ ?>
23
+ <style>
24
+ .qlwapp-premium-field {
25
+ opacity: 0.5;
26
+ pointer-events: none;
27
+ }
28
+ .qlwapp-premium-field .description {
29
+ display: block!important;
30
+ }
31
+ </style>
32
+ <?php
33
+
34
+ }
35
+ }
36
+
37
+ function init() {
38
+ add_action('admin_footer', array($this, 'add_premium_js'));
39
+ load_plugin_textdomain('wp-whatsapp-chat', false, dirname(plugin_basename(__FILE__)) . '/languages/');
40
+ do_action('qlwapp_init');
41
+ }
42
+
43
+ public static function do_activation() {
44
+ set_transient('qlwapp-first-rating', true, MONTH_IN_SECONDS);
45
+ }
46
+
47
+ public static function instance() {
48
+ if (!isset(self::$instance)) {
49
+ self::$instance = new self();
50
+ self::$instance->includes();
51
+ self::$instance->init();
52
+ }
53
+ return self::$instance;
54
+ }
55
+
56
+ }
57
+
58
+ QLWAPP::instance();
includes/settings.php CHANGED
@@ -8,6 +8,7 @@ class QLWAPP_Settings {
8
 
9
  // fix required header in license tab
10
  function settings_header() {
 
11
  include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
12
  }
13
 
8
 
9
  // fix required header in license tab
10
  function settings_header() {
11
+ global $submenu;
12
  include (QLWAPP_PLUGIN_DIR . '/includes/view/backend/pages/parts/header.php');
13
  }
14
 
includes/view/backend/pages/box.php CHANGED
@@ -14,14 +14,14 @@
14
  <tr>
15
  <th scope="row"><?php esc_html_e('Header', 'wp-whatsapp-chat'); ?></th>
16
  <td>
17
- <?php wp_editor($box['header'], 'qlwapp_box_header', array('editor_height' => 100, 'textarea_name' => 'header', 'tinymce' => array('init_instance_callback' => 'function(editor) { editor.on("change", function(){ $(".button-primary").attr("disabled", false);}); }'))); ?>
18
  </td>
19
  </tr>
20
  <tr>
21
  <th scope="row"><?php esc_html_e('Footer', 'wp-whatsapp-chat'); ?></th>
22
  <td>
23
  <?php //wp_editor($box['footer'], 'qlwapp_box_footer', array('editor_height' => 50, 'textarea_name' => 'footer')); ?>
24
- <?php wp_editor($box['footer'], 'qlwapp_box_footer', array('editor_height' => 50, 'textarea_name' => 'footer', 'tinymce' => array('init_instance_callback' => 'function(editor) { editor.on("change", function(){ $(".button-primary").attr("disabled", false);}); }'))); ?>
25
  </td>
26
  </tr>
27
  <tr>
14
  <tr>
15
  <th scope="row"><?php esc_html_e('Header', 'wp-whatsapp-chat'); ?></th>
16
  <td>
17
+ <?php wp_editor($box['header'], 'qlwapp_box_header', array('editor_height' => 100, 'textarea_name' => 'header', 'tinymce' => array('init_instance_callback' => 'function(editor) { editor.on("change", function(e){jQuery(document).trigger("tinymce_change");}); }'))); ?>
18
  </td>
19
  </tr>
20
  <tr>
21
  <th scope="row"><?php esc_html_e('Footer', 'wp-whatsapp-chat'); ?></th>
22
  <td>
23
  <?php //wp_editor($box['footer'], 'qlwapp_box_footer', array('editor_height' => 50, 'textarea_name' => 'footer')); ?>
24
+ <?php wp_editor($box['footer'], 'qlwapp_box_footer', array('editor_height' => 50, 'textarea_name' => 'footer', 'tinymce' => array('init_instance_callback' => 'function(editor) { editor.on("change", function(){jQuery(document).trigger("tinymce_change");}); }'))); ?>
25
  </td>
26
  </tr>
27
  <tr>
includes/view/backend/pages/button.php CHANGED
@@ -38,7 +38,7 @@
38
  <th scope="row"><?php esc_html_e('Icon', 'wp-whatsapp-chat'); ?></th>
39
  <td>
40
  <div class="submit qlwapp-premium-field">
41
- <?php submit_button(esc_html__('Add Icon', 'wp-whatsapp-chat'), 'secondary', null, false, array('id' => 'btn-add-icon')); ?>
42
  <p class="description hidden"><small><?php esc_html_e('This is a premium feature', 'wp-whatsapp-chat'); ?></small></p>
43
  </div>
44
  <input type="text" name="icon" placeholder="<?php echo esc_html($button['icon']); ?>" value="<?php echo esc_attr($button['icon']); ?>" class="qlwapp-input"/>
@@ -117,5 +117,4 @@
117
  </span>
118
  </p>
119
  </form>
120
- </div>
121
- <?php include_once('modals/icons-modal.php'); ?>
38
  <th scope="row"><?php esc_html_e('Icon', 'wp-whatsapp-chat'); ?></th>
39
  <td>
40
  <div class="submit qlwapp-premium-field">
41
+ <?php submit_button(esc_html__('Add Icon', 'wp-whatsapp-chat'), 'secondary', null, false, array('id' => 'qlwapp_icon_add')); ?>
42
  <p class="description hidden"><small><?php esc_html_e('This is a premium feature', 'wp-whatsapp-chat'); ?></small></p>
43
  </div>
44
  <input type="text" name="icon" placeholder="<?php echo esc_html($button['icon']); ?>" value="<?php echo esc_attr($button['icon']); ?>" class="qlwapp-input"/>
117
  </span>
118
  </p>
119
  </form>
120
+ </div>
 
includes/view/backend/pages/contacts.php CHANGED
@@ -32,8 +32,8 @@
32
  <tr data-contact_id="<?php echo esc_attr($id) ?>" data-contact_order="<?php echo esc_attr($c['order']) ?>">
33
  <td class="sort ui-sortable-handle">
34
  <div class="wc-item-reorder-nav">
35
- <button type="button" class="wc-move-up " tabindex="-1" aria-hidden="true" aria-label="<?php ///echo ///esc_attr(sprintf(__('Move the "%s" payment method up', 'woocommerce-checkout-manager'), $contact['label'])); ?>"><?php esc_html_e('Move up', 'wp-whatsapp-chat'); ?></button>
36
- <button type="button" class="wc-move-down" tabindex="0" aria-hidden="false" aria-label="<?php ///echo esc_attr(sprintf(__('Move the "%s" payment method down', 'woocommerce-checkout-manager'), $field['label'])); ?>"><?php esc_html_e('Move down', 'wp-whatsapp-chat'); ?></button>
37
  <input type="hidden" name="contact_order[]" value="<?php echo esc_attr($id); ?>">
38
  </div>
39
  </td>
@@ -67,7 +67,7 @@
67
  </table>
68
  <?php wp_nonce_field('qlwapp_delete_contact', 'qlwapp_delete_contact_nonce'); ?>
69
  </form>
70
- <script type="text/html" id='tmpl-qlwapp-modal-window'>
71
- <?php include_once('modals/contact-modal.php'); ?>
72
- </script>
73
- </div>
32
  <tr data-contact_id="<?php echo esc_attr($id) ?>" data-contact_order="<?php echo esc_attr($c['order']) ?>">
33
  <td class="sort ui-sortable-handle">
34
  <div class="wc-item-reorder-nav">
35
+ <button type="button" class="wc-move-up " tabindex="-1" aria-hidden="true" aria-label="<?php ///echo ///esc_attr(sprintf(__('Move the "%s" payment method up', 'woocommerce-checkout-manager'), $contact['label'])); ?>"><?php esc_html_e('Move up', 'wp-whatsapp-chat'); ?></button>
36
+ <button type="button" class="wc-move-down" tabindex="0" aria-hidden="false" aria-label="<?php ///echo esc_attr(sprintf(__('Move the "%s" payment method down', 'woocommerce-checkout-manager'), $field['label'])); ?>"><?php esc_html_e('Move down', 'wp-whatsapp-chat'); ?></button>
37
  <input type="hidden" name="contact_order[]" value="<?php echo esc_attr($id); ?>">
38
  </div>
39
  </td>
67
  </table>
68
  <?php wp_nonce_field('qlwapp_delete_contact', 'qlwapp_delete_contact_nonce'); ?>
69
  </form>
70
+ </div>
71
+ <script type="text/html" id='tmpl-qlwapp-modal-window'>
72
+ <?php include_once('modals/contact-modal.php'); ?>
73
+ </script>
includes/view/backend/pages/modals/contact-modal.php CHANGED
@@ -113,6 +113,7 @@
113
  <div class="media-toolbar-primary search-form">
114
  <button type="submit" class="media-modal-submit button button-primary media-button button-large" disabled="disabled"><?php esc_html_e('Save'); ?></button>
115
  <button type="button" class="media-modal-close button button-secondary media-button button-large" style="
 
116
  float: none;
117
  position: inherit;
118
  padding: inherit;
113
  <div class="media-toolbar-primary search-form">
114
  <button type="submit" class="media-modal-submit button button-primary media-button button-large" disabled="disabled"><?php esc_html_e('Save'); ?></button>
115
  <button type="button" class="media-modal-close button button-secondary media-button button-large" style="
116
+ height: auto;
117
  float: none;
118
  position: inherit;
119
  padding: inherit;
includes/view/backend/pages/modals/icons-modal.php DELETED
@@ -1,60 +0,0 @@
1
- <script type="text/html" id='tmpl-qlwapp-modal-backdrop'>
2
- <div class="media-modal-backdrop">&nbsp;</div>
3
- </script>
4
- <script type="text/html" id='tmpl-qlwapp-modal-window'>
5
- <div id="qlwapp_modal" class="media-modal wp-core-ui">
6
- <button type="button" class="media-modal-close close">
7
- <span class="media-modal-icon">
8
- <span class="screen-reader-text"><?php esc_html_e('Close media panel'); ?></span>
9
- </span>
10
- </button>
11
- <div class="media-frame mode-select wp-core-ui hide-menu">
12
- <div class="media-frame-title">
13
- <h1><?php echo esc_html(QLWAPP_PLUGIN_NAME); ?><span class="dashicons dashicons-arrow-down"></span></h1>
14
- </div>
15
- <div class="media-frame-router">
16
- <div class="media-router">
17
- <a href="#" class="media-menu-item active"><?php esc_html_e('Select icon', 'wp-whatsapp-chat'); ?></a>
18
- </div>
19
- </div>
20
- <div class="media-modal-content">
21
- <div class="media-frame mode-select wp-core-ui">
22
- <div class="media-frame-menu">
23
- <div class="media-menu">
24
- <a href="#" class="media-menu-item active"><?php esc_html_e('Featured Image'); ?></a>
25
- </div>
26
- </div>
27
- <div class="media-frame-content" data-columns="10">
28
- <div class="attachments-browser">
29
- <input type="hidden" id="qlwapp_icon" value="{{ data.icon }}">
30
- <ul tabindex="-1" class="attachments">
31
- <?php foreach (explode(',', 'qlwf-chat,qlwf-chat1,qlwf-chat2,qlwf-comments,qlwf-chat3,qlwf-bubble1,qlwf-chat-alt-fill,qlwf-chat-alt-stroke,qlwf-comment-alt2-fill,qlwf-comment-alt2-stroke,qlwf-comment-fill,qlwf-comment-stroke,qlwf-comment,qlwf-comment-alt1-stroke,qlwf-chat4,qlwf-comments1,qlwf-chat5,qlwf-comment1,qlwf-bubble,qlwf-bubbles,qlwf-bubbles2,qlwf-bubble2,qlwf-bubbles3,qlwf-bubbles4,qlwf-whatsapp,qlwf-chat6,qlwf-mode_comment,qlwf-insert_comment,qlwf-chat_bubble_outline,qlwf-chat_bubble,qlwf-bubble_chart,qlwf-comment2,qlwf-chat7,qlwf-commenting-o,qlwf-commenting,qlwf-comments-o,qlwf-comment-o,qlwf-wechat,qlwf-comments2,qlwf-comment3,qlwf-chat8,qlwf-chat-bubble-dots,qlwf-bubbles1,qlwf-bubble3') as $id => $icon) : ?>
32
- <li tabindex="0" role="checkbox" aria-label="<?php echo esc_attr($icon); ?>" aria-checked="false" data-id="<?php echo esc_attr($id); ?>" class="attachment save-ready icon _<?php echo esc_attr(str_replace(' ', '_', trim($icon))); ?>">
33
- <div class="attachment-preview js--select-attachment type-image subtype-jpeg landscape">
34
- <div class="thumbnail">
35
- <i class="<?php echo esc_attr($icon); ?>"></i>
36
- </div>
37
- </div>
38
- <button type="button" class="check" tabindex="-1">
39
- <span class="media-modal-icon"></span>
40
- <span class="screen-reader-text"><?php esc_html_e('Deselect'); ?></span>
41
- </button>
42
- </li>
43
- <?php endforeach; ?>
44
- </ul>
45
- </div>
46
- </div>
47
- <div class="media-frame-toolbar">
48
- <div class="media-toolbar">
49
- <div class="media-toolbar-secondary"></div>
50
- <div class="media-toolbar-primary search-form">
51
- <button type="button" class="button media-button button-large button-primary media-button-select save"><?php esc_html_e('Save'); ?></button>
52
- <button type="button" class="button media-button button-large button-secondary remove"><?php esc_html_e('Remove'); ?></button>
53
- </div>
54
- </div>
55
- </div>
56
- </div>
57
- </div>
58
- </div>
59
- </div>
60
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/view/backend/pages/parts/header.php CHANGED
@@ -1,6 +1,3 @@
1
- <?php
2
- global $submenu;
3
- ?>
4
  <div class="wrap about-wrap full-width-layout qlwrap">
5
 
6
  <h1><?php echo esc_html(QLWAPP_PLUGIN_NAME); ?></h1>
 
 
 
1
  <div class="wrap about-wrap full-width-layout qlwrap">
2
 
3
  <h1><?php echo esc_html(QLWAPP_PLUGIN_NAME); ?></h1>
wp-whatsapp-chat.php CHANGED
@@ -1,9 +1,10 @@
1
  <?php
 
2
  /**
3
  * Plugin Name: WhatsApp Chat
4
  * Plugin URI: https://quadlayers.com/portfolio/wordpress-whatsapp-chat/
5
  * Description: WhatsApp Chat allows your visitors to contact you or your team through WhatsApp chat with a single click.
6
- * Version: 4.5.0
7
  * Author: QuadLayers
8
  * Author URI: https://quadlayers.com
9
  * License: GPL-2.0+
@@ -12,178 +13,50 @@
12
  * Domain Path: /languages
13
  */
14
  if (!defined('ABSPATH')) {
15
- die('-1');
16
  }
17
  if (!defined('QLWAPP_PLUGIN_NAME')) {
18
- define('QLWAPP_PLUGIN_NAME', 'WhatsApp Chat');
19
  }
20
  if (!defined('QLWAPP_PLUGIN_VERSION')) {
21
- define('QLWAPP_PLUGIN_VERSION', '4.5.0');
22
  }
23
  if (!defined('QLWAPP_PLUGIN_FILE')) {
24
- define('QLWAPP_PLUGIN_FILE', __FILE__);
25
  }
26
  if (!defined('QLWAPP_PLUGIN_DIR')) {
27
- define('QLWAPP_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR);
 
 
 
28
  }
29
  if (!defined('QLWAPP_DOMAIN')) {
30
- define('QLWAPP_DOMAIN', 'qlwapp');
31
  }
32
  if (!defined('QLWAPP_WORDPRESS_URL')) {
33
- define('QLWAPP_WORDPRESS_URL', 'https://wordpress.org/plugins/wp-whatsapp-chat/');
34
  }
35
  if (!defined('QLWAPP_REVIEW_URL')) {
36
- define('QLWAPP_REVIEW_URL', 'https://wordpress.org/support/plugin/wp-whatsapp-chat/reviews/?filter=5#new-post');
37
  }
38
  if (!defined('QLWAPP_DEMO_URL')) {
39
- define('QLWAPP_DEMO_URL', 'https://quadlayers.com/portfolio/wordpress-whatsapp-chat/?utm_source=qlwapp_admin');
40
  }
41
  if (!defined('QLWAPP_PURCHASE_URL')) {
42
- define('QLWAPP_PURCHASE_URL', QLWAPP_DEMO_URL);
43
  }
44
  if (!defined('QLWAPP_SUPPORT_URL')) {
45
- define('QLWAPP_SUPPORT_URL', 'https://quadlayers.com/account/support/?utm_source=qlwapp_admin');
46
  }
47
  if (!defined('QLWAPP_DOCUMENTATION_URL')) {
48
  define('QLWAPP_DOCUMENTATION_URL', 'https://quadlayers.com/documentation/whatsapp-chat/?utm_source=qlwapp_admin');
49
  }
50
  if (!defined('QLWAPP_GROUP_URL')) {
51
- define('QLWAPP_GROUP_URL', 'https://www.facebook.com/groups/quadlayers');
52
  }
53
 
54
  if (!class_exists('QLWAPP')) {
55
-
56
- class QLWAPP {
57
-
58
- protected static $instance;
59
-
60
- function ajax_dismiss_notice() {
61
-
62
- if (check_admin_referer('qlwapp_dismiss_notice', 'nonce') && isset($_REQUEST['notice_id'])) {
63
-
64
- $notice_id = sanitize_key($_REQUEST['notice_id']);
65
-
66
- update_user_meta(get_current_user_id(), $notice_id, true);
67
-
68
- wp_send_json($notice_id);
69
- }
70
-
71
- wp_die();
72
- }
73
-
74
- function add_notices() {
75
-
76
- if (!get_transient('qlwapp-first-rating') && !get_user_meta(get_current_user_id(), 'qlwapp-user-rating', true)) {
77
- ?>
78
- <div id="qlwapp-admin-rating" class="qlwapp-notice notice is-dismissible" data-notice_id="qlwapp-user-rating">
79
- <div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
80
- <div class="notice-image">
81
- <img style="border-radius:50%;max-width: 90px;" src="<?php echo plugins_url('/assets/img/logo.jpg', QLWAPP_PLUGIN_FILE); ?>" alt="<?php echo esc_html(QLWAPP_PLUGIN_NAME); ?>>">
82
- </div>
83
- <div class="notice-content" style="margin-left: 15px;">
84
- <p>
85
- <?php printf(esc_html__('Hello! Thank you for choosing the %s plugin!', 'wp-whatsapp-chat'), QLWAPP_PLUGIN_NAME); ?>
86
- <br/>
87
- <?php esc_html_e('Could you please give it a 5-star rating on WordPress? We know its a big favor, but we\'ve worked very much and very hard to release this great product. Your feedback will boost our motivation and help us promote and continue to improve this product.', 'wp-whatsapp-chat'); ?>
88
- </p>
89
- <a href="<?php echo esc_url(QLWAPP_REVIEW_URL); ?>" class="button-primary" target="_blank">
90
- <?php esc_html_e('Yes, of course!', 'wp-whatsapp-chat'); ?>
91
- </a>
92
- <a href="<?php echo esc_url(QLWAPP_SUPPORT_URL); ?>" class="button-secondary" target="_blank">
93
- <?php esc_html_e('Report a bug', 'wp-whatsapp-chat'); ?>
94
- </a>
95
- </div>
96
- </div>
97
- </div>
98
- <script>
99
- (function ($) {
100
- $('.qlwapp-notice').on('click', '.notice-dismiss', function (e) {
101
- e.preventDefault();
102
- var notice_id = $(e.delegateTarget).data('notice_id');
103
- $.ajax({
104
- type: 'POST',
105
- url: ajaxurl,
106
- data: {
107
- notice_id: notice_id,
108
- action: 'qlwapp_dismiss_notice',
109
- nonce: '<?php echo wp_create_nonce('qlwapp_dismiss_notice'); ?>'
110
- },
111
- success: function (response) {
112
- console.log(response);
113
- },
114
- });
115
- });
116
- })(jQuery);
117
- </script>
118
- <?php
119
- }
120
- }
121
-
122
- function includes() {
123
- include_once('includes/settings.php');
124
- include_once('includes/frontend.php');
125
- include_once('includes/backend.php');
126
- }
127
-
128
- public static function is_min() {
129
- if (!defined('SCRIPT_DEBUG') || !SCRIPT_DEBUG) {
130
- return '.min';
131
- }
132
- }
133
-
134
- function languages() {
135
- load_plugin_textdomain('wp-whatsapp-chat', false, dirname(plugin_basename(__FILE__)) . '/languages/');
136
- }
137
-
138
- function add_premium_js() {
139
- if (!class_exists('QLWAPP_PRO')) {
140
- ?>
141
- <style>
142
- .qlwapp-premium-field {
143
- opacity: 0.5;
144
- pointer-events: none;
145
- }
146
- .qlwapp-premium-field .description {
147
- display: block!important;
148
- }
149
- </style>
150
- <?php
151
- }
152
- }
153
-
154
- function add_action_links($links) {
155
-
156
- $links[] = '<a target="_blank" href="' . QLWAPP_PURCHASE_URL . '">' . esc_html__('Premium', 'wp-whatsapp-chat') . '</a>';
157
-
158
- $links[] = '<a href="' . admin_url('admin.php?page=' . QLWAPP_DOMAIN) . '">' . esc_html__('Settings', 'wp-whatsapp-chat') . '</a>';
159
-
160
- return $links;
161
- }
162
-
163
- function init() {
164
- add_filter('plugin_action_links_' . plugin_basename(QLWAPP_PLUGIN_FILE), array($this, 'add_action_links'));
165
- add_action('admin_footer', array($this, 'add_premium_js'));
166
- add_action('admin_notices', array($this, 'add_notices'));
167
- add_action('wp_ajax_qlwapp_dismiss_notice', array($this, 'ajax_dismiss_notice'));
168
- }
169
-
170
- public static function do_activation() {
171
- set_transient('qlwapp-first-rating', true, MONTH_IN_SECONDS);
172
- }
173
-
174
- public static function instance() {
175
- if (!isset(self::$instance)) {
176
- self::$instance = new self();
177
- self::$instance->languages();
178
- self::$instance->includes();
179
- self::$instance->init();
180
- }
181
- return self::$instance;
182
- }
183
-
184
- }
185
-
186
- add_action('plugins_loaded', array('QLWAPP', 'instance'));
187
-
188
- register_activation_hook(QLWAPP_PLUGIN_FILE, array('QLWAPP', 'do_activation'));
189
  }
 
 
1
  <?php
2
+
3
  /**
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.1
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPL-2.0+
13
  * Domain Path: /languages
14
  */
15
  if (!defined('ABSPATH')) {
16
+ die('-1');
17
  }
18
  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.1');
23
  }
24
  if (!defined('QLWAPP_PLUGIN_FILE')) {
25
+ define('QLWAPP_PLUGIN_FILE', __FILE__);
26
  }
27
  if (!defined('QLWAPP_PLUGIN_DIR')) {
28
+ define('QLWAPP_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR);
29
+ }
30
+ if (!defined('QLWAPP_PREFIX')) {
31
+ define('QLWAPP_PREFIX', 'qlwapp');
32
  }
33
  if (!defined('QLWAPP_DOMAIN')) {
34
+ define('QLWAPP_DOMAIN', QLWAPP_PREFIX);
35
  }
36
  if (!defined('QLWAPP_WORDPRESS_URL')) {
37
+ define('QLWAPP_WORDPRESS_URL', 'https://wordpress.org/plugins/wp-whatsapp-chat/');
38
  }
39
  if (!defined('QLWAPP_REVIEW_URL')) {
40
+ define('QLWAPP_REVIEW_URL', 'https://wordpress.org/support/plugin/wp-whatsapp-chat/reviews/?filter=5#new-post');
41
  }
42
  if (!defined('QLWAPP_DEMO_URL')) {
43
+ define('QLWAPP_DEMO_URL', 'https://quadlayers.com/portfolio/wordpress-whatsapp-chat/?utm_source=qlwapp_admin');
44
  }
45
  if (!defined('QLWAPP_PURCHASE_URL')) {
46
+ define('QLWAPP_PURCHASE_URL', QLWAPP_DEMO_URL);
47
  }
48
  if (!defined('QLWAPP_SUPPORT_URL')) {
49
+ define('QLWAPP_SUPPORT_URL', 'https://quadlayers.com/account/support/?utm_source=qlwapp_admin');
50
  }
51
  if (!defined('QLWAPP_DOCUMENTATION_URL')) {
52
  define('QLWAPP_DOCUMENTATION_URL', 'https://quadlayers.com/documentation/whatsapp-chat/?utm_source=qlwapp_admin');
53
  }
54
  if (!defined('QLWAPP_GROUP_URL')) {
55
+ define('QLWAPP_GROUP_URL', 'https://www.facebook.com/groups/quadlayers');
56
  }
57
 
58
  if (!class_exists('QLWAPP')) {
59
+ include_once( QLWAPP_PLUGIN_DIR . 'includes/qlwapp.php' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  }
61
+
62
+ register_activation_hook(QLWAPP_PLUGIN_FILE, array('QLWAPP', 'do_activation'));