Floating Chat Widget: Contact Chat Icons, Telegram Chat, Line, WeChat, Email, SMS, Call Button – Chaty - Version 2.2.3

Version Description

Improved validation for click to call, WhatsApp, Viber, and SMS

Download this release

Release Info

Developer galdub
Plugin Icon wp plugin Floating Chat Widget: Contact Chat Icons, Telegram Chat, Line, WeChat, Email, SMS, Call Button – Chaty
Version 2.2.3
Comparing to
See all releases

Code changes from version 2.2.2 to 2.2.3

admin/class-admin-base.php CHANGED
@@ -97,7 +97,10 @@ class CHT_Admin_Base
97
  }
98
  if ($errorCounter == 0) {
99
  global $current_user;
100
- $email = get_option('admin_email');
 
 
 
101
  $domain = site_url();
102
  $user_name = $current_user->first_name . " " . $current_user->last_name;
103
  $subject = "Chaty was removed from {$domain}";
@@ -140,7 +143,7 @@ class CHT_Admin_Base
140
  </table>
141
  <?php
142
  $content = ob_get_clean();
143
- $email_id = "contact+removed@premio.io";
144
  wp_mail($email_id, $subject, $content, $headers);
145
  $response['status'] = 1;
146
  }
@@ -248,7 +251,7 @@ class CHT_Admin_Base
248
  </table>
249
  <?php
250
  $message = ob_get_clean();
251
- $email_id = "contact+fromwp@premio.io";
252
  $status = wp_mail($email_id, $subject, $message, $headers);
253
  if ($status) {
254
  $response['status'] = 1;
97
  }
98
  if ($errorCounter == 0) {
99
  global $current_user;
100
+ $email = "none@none.none";
101
+ if (isset($postData['email_id']) && !empty($postData['email_id']) && filter_var($postData['email_id'], FILTER_VALIDATE_EMAIL)) {
102
+ $email = $postData['email_id'];
103
+ }
104
  $domain = site_url();
105
  $user_name = $current_user->first_name . " " . $current_user->last_name;
106
  $subject = "Chaty was removed from {$domain}";
143
  </table>
144
  <?php
145
  $content = ob_get_clean();
146
+ $email_id = "gal@premio.io";
147
  wp_mail($email_id, $subject, $content, $headers);
148
  $response['status'] = 1;
149
  }
251
  </table>
252
  <?php
253
  $message = ob_get_clean();
254
+ $email_id = "gal@premio.io";
255
  $status = wp_mail($email_id, $subject, $message, $headers);
256
  if ($status) {
257
  $response['status'] = 1;
cht-icons.php CHANGED
@@ -5,7 +5,7 @@
5
  Description: Chat with your website visitors via their favorite channels. Show a chat icon on the bottom of your site and communicate with your customers.
6
  Author: Premio
7
  Author URI: https://premio.io/downloads/chaty/
8
- Version: 2.2.2
9
  License: GPL2
10
  */
11
 
@@ -23,7 +23,7 @@ define('CHT_INC', CHT_DIR . '/includes');
23
  define('CHT_PRO_URL', admin_url("admin.php?page=chaty-app-upgrade"));
24
  define('CHT_PLUGIN_URL', plugins_url() . "/chaty/");
25
  define('CHT_PLUGIN_BASE', plugin_basename(CHT_FILE));
26
- define('CHT_VERSION', "2.2.2");
27
 
28
  if (!function_exists('wp_doing_ajax')) {
29
  function wp_doing_ajax()
5
  Description: Chat with your website visitors via their favorite channels. Show a chat icon on the bottom of your site and communicate with your customers.
6
  Author: Premio
7
  Author URI: https://premio.io/downloads/chaty/
8
+ Version: 2.2.3
9
  License: GPL2
10
  */
11
 
23
  define('CHT_PRO_URL', admin_url("admin.php?page=chaty-app-upgrade"));
24
  define('CHT_PLUGIN_URL', plugins_url() . "/chaty/");
25
  define('CHT_PLUGIN_BASE', plugin_basename(CHT_FILE));
26
+ define('CHT_VERSION', "2.2.3");
27
 
28
  if (!function_exists('wp_doing_ajax')) {
29
  function wp_doing_ajax()
readme.txt CHANGED
@@ -1,12 +1,12 @@
1
- === Free WhatsApp, Messenger, Telegram, Email, SMS, Maps, Chat & Call button - Chaty ===
2
  Contributors: galdub, tomeraharon, premio
3
  Tags: whatsapp, facebook messenger, click to chat, chat, chat button, call now button, messenger, whatsapp button, chat icon, messenger chat icon, contact button, click to call
4
  Requires at least: 3.1
5
  Tested up to: 5.2
6
- Stable tag: 2.2.2
7
  Plugin URI: https://premio.io/downloads/chaty/
8
 
9
- FREE customizable live chat and call buttons. Let your visitors contact you via Facebook Messenger, Whatsapp, Telegram, Viber, Email, SMS and more.
10
 
11
  == Description ==
12
 
@@ -25,6 +25,9 @@ Chaty is the perfect chat plugin for you! With Chaty you can display call widget
25
  = Live Demo =
26
  A live demo for the Chaty plugin is available at <a href="https://demo.premio.io/chaty/?utm_source=wordpressorg" target="_blank" title="Premio.io demo site">Premio's demo site</a>.
27
 
 
 
 
28
  = Choose from 19 different channels =
29
  WhatsApp chat
30
  Facebook Messenger
@@ -173,6 +176,9 @@ Yes! You can even decide what chat buttons will show up on each device (desktop/
173
 
174
  == Changelog ==
175
 
 
 
 
176
  = 2.2.2 =
177
  Fixed Viber mobile issue
178
 
1
+ === Floating Chat Widget: Contact Icons, Messages, Telegram, Email, SMS, Call Button Chaty ===
2
  Contributors: galdub, tomeraharon, premio
3
  Tags: whatsapp, facebook messenger, click to chat, chat, chat button, call now button, messenger, whatsapp button, chat icon, messenger chat icon, contact button, click to call
4
  Requires at least: 3.1
5
  Tested up to: 5.2
6
+ Stable tag: 2.2.3
7
  Plugin URI: https://premio.io/downloads/chaty/
8
 
9
+ Let your visitors contact you via Facebook Messenger, Whatsapp, Telegram, Viber, Email, Phone call, SMS and more with customizable chat & call buttons
10
 
11
  == Description ==
12
 
25
  = Live Demo =
26
  A live demo for the Chaty plugin is available at <a href="https://demo.premio.io/chaty/?utm_source=wordpressorg" target="_blank" title="Premio.io demo site">Premio's demo site</a>.
27
 
28
+ = Join the Premio community =
29
+ Have any questions or feature suggestions? We'd love to hear from you. <strong><a href="https://www.facebook.com/groups/premioplugins/" target="_blank" title="Premio Facebook group">Join our Facebook group</a></strong> to share ideas and get updates about new features.
30
+
31
  = Choose from 19 different channels =
32
  WhatsApp chat
33
  Facebook Messenger
176
 
177
  == Changelog ==
178
 
179
+ = 2.2.3 =
180
+ Improved validation for click to call, WhatsApp, Viber, and SMS
181
+
182
  = 2.2.2 =
183
  Fixed Viber mobile issue
184
 
views/admin.php CHANGED
@@ -73,21 +73,26 @@ $pro_class = (!$is_pro && $cht_license_key !== "")?"none_pro":"";
73
  <script>
74
  jQuery(document).ready(function(){
75
  jQuery("#cht-form").submit(function () {
 
76
  phoneNumberReg = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/;
77
  if (jQuery("#cht-form #Whatsapp").length && jQuery("#cht-form #Whatsapp").val() != "") {
78
  InputVal = jQuery.trim(jQuery("#cht-form #Whatsapp").val());
79
- if (check_for_number_chaty(InputVal, "Whatsapp")) {
80
- alert("<?php esc_attr_e("For channel Whatsapp, please enter a valid phone number", CHT_OPT) ?>");
81
- jQuery("#cht-form #Whatsapp").focus();
82
- return false;
 
 
83
  }
84
  }
85
  if (jQuery("#cht-form #Phone").length && jQuery("#cht-form #Phone").val() != "") {
86
  InputVal = jQuery.trim(jQuery("#cht-form #Phone").val());
87
- if (check_for_number_chaty(InputVal, "Phone")) {
88
- alert("<?php esc_attr_e("For channel Phone, please enter a valid phone number", CHT_OPT) ?>");
89
- jQuery("#cht-form #Phone").focus();
90
- return false;
 
 
91
  }
92
  }
93
  if (jQuery("#cht-form #Facebook_Messenger").length && jQuery("#cht-form #Facebook_Messenger").val() != "") {
@@ -102,20 +107,25 @@ $pro_class = (!$is_pro && $cht_license_key !== "")?"none_pro":"";
102
  }
103
  if (jQuery("#cht-form #SMS").length && jQuery("#cht-form #SMS").val() != "") {
104
  InputVal = jQuery.trim(jQuery("#cht-form #SMS").val());
105
- if (check_for_number_chaty(InputVal, "SMS")) {
106
- alert("<?php esc_attr_e("For channel SMS, please enter a valid phone number", CHT_OPT) ?>");
107
- jQuery("#cht-form #SMS").focus();
108
- return false;
 
 
109
  }
110
  }
111
  if (jQuery("#cht-form #Viber").length && jQuery("#cht-form #Viber").val() != "") {
112
  InputVal = jQuery.trim(jQuery("#cht-form #Viber").val());
113
- if (check_for_number_chaty(InputVal, "Viber")) {
114
- alert("<?php esc_attr_e("For channel Viber, please enter a valid phone number", CHT_OPT) ?>");
115
- jQuery("#cht-form #Viber").focus();
116
- return false;
 
 
117
  }
118
  }
 
119
  });
120
  });
121
 
73
  <script>
74
  jQuery(document).ready(function(){
75
  jQuery("#cht-form").submit(function () {
76
+ var chatyError;
77
  phoneNumberReg = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/;
78
  if (jQuery("#cht-form #Whatsapp").length && jQuery("#cht-form #Whatsapp").val() != "") {
79
  InputVal = jQuery.trim(jQuery("#cht-form #Whatsapp").val());
80
+ chatyError = check_for_number_chaty(InputVal, "Whatsapp");
81
+ if(chatyError) {
82
+ if(!confirm("Seems like the WhatsApp number you're trying to enter isn't in the right syntax. Would you like to publish it anyway?")) {
83
+ jQuery("#cht-form #Whatsapp").focus();
84
+ return false;
85
+ }
86
  }
87
  }
88
  if (jQuery("#cht-form #Phone").length && jQuery("#cht-form #Phone").val() != "") {
89
  InputVal = jQuery.trim(jQuery("#cht-form #Phone").val());
90
+ chatyError = check_for_number_chaty(InputVal, "Phone");
91
+ if(chatyError) {
92
+ if(!confirm("Seems like the phone number you're trying to enter isn't in the right syntax. Would you like to publish it anyway?")) {
93
+ jQuery("#cht-form #Phone").focus();
94
+ return false;
95
+ }
96
  }
97
  }
98
  if (jQuery("#cht-form #Facebook_Messenger").length && jQuery("#cht-form #Facebook_Messenger").val() != "") {
107
  }
108
  if (jQuery("#cht-form #SMS").length && jQuery("#cht-form #SMS").val() != "") {
109
  InputVal = jQuery.trim(jQuery("#cht-form #SMS").val());
110
+ chatyError = check_for_number_chaty(InputVal, "SMS");
111
+ if(chatyError) {
112
+ if(!confirm("Seems like the SMS number you're trying to enter isn't in the right syntax. Would you like to publish it anyway?")) {
113
+ jQuery("#cht-form #SMS").focus();
114
+ return false;
115
+ }
116
  }
117
  }
118
  if (jQuery("#cht-form #Viber").length && jQuery("#cht-form #Viber").val() != "") {
119
  InputVal = jQuery.trim(jQuery("#cht-form #Viber").val());
120
+ chatyError = check_for_number_chaty(InputVal, "Viber");
121
+ if(chatyError) {
122
+ if(!confirm("Seems like the Viber number you're trying to enter isn't in the right syntax. Would you like to publish it anyway?")) {
123
+ jQuery("#cht-form #Viber").focus();
124
+ return false;
125
+ }
126
  }
127
  }
128
+ return true;
129
  });
130
  });
131
 
views/modals/chaty-deactivate-form.php CHANGED
@@ -103,9 +103,11 @@
103
  line-height: 26px;
104
  }
105
 
106
- .chaty--hidden-input textarea {
107
  padding: 10px;
108
  width: 100%;
 
 
109
  }
110
 
111
  span.chaty--error-message {
@@ -115,6 +117,10 @@
115
  .chaty--popup-body h3 {
116
  line-height: 24px;
117
  }
 
 
 
 
118
  </style>
119
 
120
  <div class="chaty--popup-overlay">
@@ -125,6 +131,9 @@
125
  </div>
126
  <div class="chaty--popup-body">
127
  <h3><?php esc_attr_e('Your feedback will help us improve the product, please tell us why did you decide to deactivate Chaty :)', CHT_OPT); ?></h3>
 
 
 
128
  <div class="form-control">
129
  <label></label>
130
  <textarea placeholder="<?php esc_attr_e("Your comment", CHT_OPT) ?>" id="chaty-deactivation-comment"></textarea>
@@ -198,6 +207,7 @@
198
  }
199
 
200
  jQuery('[name="chaty--selected-reason"]:checked').val();
 
201
 
202
  $.ajax({
203
  url: ajaxurl,
@@ -205,6 +215,7 @@
205
  data: {
206
  action: 'chaty_plugin_deactivate',
207
  reason: _reason,
 
208
  nonce: '<?php esc_attr_e(wp_create_nonce("chaty_deactivate_nonce")) ?>'
209
  },
210
  beforeSend: function () {
103
  line-height: 26px;
104
  }
105
 
106
+ .chaty--popup-overlay textarea {
107
  padding: 10px;
108
  width: 100%;
109
+ height: 100px;
110
+ margin: 0 0 15px 0;
111
  }
112
 
113
  span.chaty--error-message {
117
  .chaty--popup-body h3 {
118
  line-height: 24px;
119
  }
120
+ .chaty--popup-overlay .form-control input {
121
+ width: 100%;
122
+ margin: 0 0 15px 0;
123
+ }
124
  </style>
125
 
126
  <div class="chaty--popup-overlay">
131
  </div>
132
  <div class="chaty--popup-body">
133
  <h3><?php esc_attr_e('Your feedback will help us improve the product, please tell us why did you decide to deactivate Chaty :)', CHT_OPT); ?></h3>
134
+ <div class="form-control">
135
+ <input type="email" value="<?php echo get_option( 'admin_email' ) ?>" placeholder="<?php echo _e("Email address", CHT_OPT) ?>" id="chaty-deactivation-email_id">
136
+ </div>
137
  <div class="form-control">
138
  <label></label>
139
  <textarea placeholder="<?php esc_attr_e("Your comment", CHT_OPT) ?>" id="chaty-deactivation-comment"></textarea>
207
  }
208
 
209
  jQuery('[name="chaty--selected-reason"]:checked').val();
210
+ var email_id = jQuery.trim(jQuery("#chaty-deactivation-email_id").val());
211
 
212
  $.ajax({
213
  url: ajaxurl,
215
  data: {
216
  action: 'chaty_plugin_deactivate',
217
  reason: _reason,
218
+ email_id: email_id,
219
  nonce: '<?php esc_attr_e(wp_create_nonce("chaty_deactivate_nonce")) ?>'
220
  },
221
  beforeSend: function () {
views/parts/help.php CHANGED
@@ -36,7 +36,6 @@
36
  success: function(responseText){
37
  jQuery("#chaty-help-form").find(".error-message").remove();
38
  jQuery("#chaty-help-form").find(".input-error").removeClass("input-error");
39
- responseText = responseText.slice(0, - 1);
40
  responseArray = jQuery.parseJSON(responseText);
41
  if(responseArray.error == 1) {
42
  jQuery(".chaty-help-button").attr("disabled",false);
36
  success: function(responseText){
37
  jQuery("#chaty-help-form").find(".error-message").remove();
38
  jQuery("#chaty-help-form").find(".input-error").removeClass("input-error");
 
39
  responseArray = jQuery.parseJSON(responseText);
40
  if(responseArray.error == 1) {
41
  jQuery(".chaty-help-button").attr("disabled",false);