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

Version Description

  • Multi widgets + Reduced CSS conflicts
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.1.3
Comparing to
See all releases

Code changes from version 2.1.2 to 2.1.3

admin/class-admin-base.php CHANGED
@@ -1,7 +1,9 @@
1
  <?php
 
2
  namespace CHT\admin;
3
 
4
  use CHT\includes\CHT_Widget;
 
5
  /**
6
  * Class CHT_Admin_Base
7
  * @since 1.0
@@ -22,15 +24,15 @@ class CHT_Admin_Base
22
 
23
  public function __construct()
24
  {
25
- $plugin = CHT_Widget::get_instance();
26
- $this->plugin_slug = $plugin->get_plugin_slug();
27
  $this->friendly_name = $plugin->get_name();
28
- $this->socials = CHT_Social_Icons::get_instance()->get_icons_list();
29
- $this->colors = CHT_Social_Icons::get_instance()->get_colors();
30
- $this->token = $this->get_token();
31
- $this->upgrade_slug = $this->plugin_slug.'-upgrade';
32
 
33
- if ( is_admin() ) { // admin actions
34
  add_action('admin_menu', array($this, 'cht_admin_setting_page'));
35
  // Adds all of the options for the administrative settings
36
  add_action('admin_init', array($this, 'cht_register_inputs'));
@@ -40,16 +42,17 @@ class CHT_Admin_Base
40
  add_action('updated_option', array($this, 'cht_clear_all_caches'));
41
 
42
  /* Send message to owner */
43
- add_action( 'wp_ajax_wcp_admin_send_message_to_owner', array( $this, 'wcp_admin_send_message_to_owner' ) );
44
 
45
  /* ADD Upgrade link to plugin */
46
- add_filter( 'plugin_action_links_' . CHT_PLUGIN_BASE, [ $this, 'plugin_action_links' ] );
47
 
48
- add_action( 'admin_footer', array( $this, 'add_deactivate_modal' ) );
49
- add_action( 'wp_ajax_chaty_plugin_deactivate', array( $this, 'chaty_plugin_deactivate' ) );
50
  }
51
 
52
- public function chaty_plugin_deactivate() {
 
53
  global $current_user;
54
  $postData = $_POST;
55
  $errorCounter = 0;
@@ -57,7 +60,7 @@ class CHT_Admin_Base
57
  $response['status'] = 0;
58
  $response['message'] = "";
59
  $response['valid'] = 1;
60
- if(!isset($postData['reason']) || empty($postData['reason'])) {
61
  $errorCounter++;
62
  $response['message'] = "Please provide reason";
63
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
@@ -66,13 +69,13 @@ class CHT_Admin_Base
66
  $response['valid'] = 0;
67
  } else {
68
  $nonce = self::chaty_sanitize_options($postData['nonce']);
69
- if(!wp_verify_nonce($nonce, 'chaty_deactivate_nonce')) {
70
  $response['message'] = __("Your request is not valid", CHT_OPT);
71
  $errorCounter++;
72
  $response['valid'] = 0;
73
  }
74
  }
75
- if($errorCounter == 0) {
76
  global $current_user;
77
  $postData = $_POST;
78
  $email = get_option('admin_email');
@@ -126,26 +129,29 @@ class CHT_Admin_Base
126
  die;
127
  }
128
 
129
- public function add_deactivate_modal() {
 
130
  global $pagenow;
131
 
132
- if ( 'plugins.php' !== $pagenow ) {
133
  return;
134
  }
135
 
136
  include CHT_DIR . '/views/modals/chaty-deactivate-form.php';
137
  }
138
 
139
- public function plugin_action_links( $links ) {
140
- $links['go_pro'] = '<a href="'.CHT_PRO_URL.'" class="chaty-plugins-gopro">'.__( 'Upgrade', 'stars-testimonials' ).'</a>';
 
141
 
142
- wp_register_style( 'chaty-admin-custom-style', CHT_PLUGIN_URL.'/assets/css/admin-cht-style.css');
143
- wp_enqueue_style( 'chaty-admin-custom-style' );
144
 
145
  return $links;
146
  }
147
 
148
- public function wcp_admin_send_message_to_owner() {
 
149
  $response = array();
150
  $response['status'] = 0;
151
  $response['error'] = 0;
@@ -154,34 +160,34 @@ class CHT_Admin_Base
154
  $errorArray = [];
155
  $errorMessage = __("%s is required", CHT_OPT);
156
  $postData = $_POST;
157
- if(!isset($postData['textarea_text']) || trim($postData['textarea_text']) == "") {
158
  $error = array(
159
- "key" => "textarea_text",
160
- "message" => __("Please enter your message","wcp")
161
  );
162
  $errorArray[] = $error;
163
  }
164
- if(!isset($postData['user_email']) || trim($postData['user_email']) == "") {
165
  $error = array(
166
- "key" => "user_email",
167
- "message" => sprintf($errorMessage,__("Email","wcp"))
168
  );
169
  $errorArray[] = $error;
170
- } else if(!filter_var($postData['user_email'], FILTER_VALIDATE_EMAIL)) {
171
  $error = array(
172
  'key' => "user_email",
173
  "message" => "Email is not valid"
174
  );
175
  $errorArray[] = $error;
176
  }
177
- if(empty($errorArray)) {
178
- if(!isset($_REQUEST['nonce']) || empty($_REQUEST['nonce'])) {
179
  $error = array(
180
  'key' => "nonce",
181
  "message" => "Your request is not valid"
182
  );
183
  $errorArray[] = $error;
184
- } else if(!wp_verify_nonce($_REQUEST['nonce'], "chaty_send_message_to_owner")) {
185
  $error = array(
186
  'key' => "nonce",
187
  "message" => "Your request is not valid"
@@ -189,17 +195,17 @@ class CHT_Admin_Base
189
  $errorArray[] = $error;
190
  }
191
  }
192
- if(empty($errorArray)) {
193
  global $current_user;
194
  $text_message = $postData['textarea_text'];
195
  $email = $postData['user_email'];
196
  $domain = site_url();
197
- $user_name = $current_user->first_name." ".$current_user->last_name;
198
- $subject = "Chaty request: ".$domain;
199
  $headers = "MIME-Version: 1.0\r\n";
200
  $headers .= "Content-Type: text/html; charset=UTF-8\r\n";
201
- $headers .= 'From: '.$user_name.' <'.$email.'>'.PHP_EOL ;
202
- $headers .= 'Reply-To: '.$user_name.' <'.$email.'>'.PHP_EOL ;
203
  $headers .= 'X-Mailer: PHP/' . phpversion();
204
  ob_start();
205
  ?>
@@ -221,7 +227,7 @@ class CHT_Admin_Base
221
  $message = ob_get_clean();
222
  $to = "contact+fromwp@premio.io";
223
  $status = wp_mail($to, $subject, $message, $headers);
224
- if($status) {
225
  $response['status'] = 1;
226
  } else {
227
  $response['status'] = 0;
@@ -234,11 +240,13 @@ class CHT_Admin_Base
234
  echo json_encode($response);
235
  }
236
 
237
- public function del_space($text){
238
- return str_replace('_',' ',$text);
 
239
  }
240
 
241
- public function cht_inline_css_admin(){
 
242
  echo '<style>
243
  #toplevel_page_chaty-app img:hover, #toplevel_page_chaty-app img {
244
  opacity: 0 !important;
@@ -248,8 +256,8 @@ class CHT_Admin_Base
248
  }
249
  #toplevel_page_chaty-app .dashicons-before{
250
  background-color: #A0A3A8;
251
- -webkit-mask: url('.plugins_url( '../icon/chaty.svg' , __FILE__).') no-repeat center;
252
- mask: url('.plugins_url( '../icon/chaty.svg' , __FILE__).') no-repeat center;
253
  }
254
  .current#toplevel_page_chaty-app .dashicons-before{
255
  background-color: #fff;
@@ -264,75 +272,95 @@ class CHT_Admin_Base
264
  'family' => 'Rubik:400,700|Oswald:400,600',
265
  'subset' => 'latin,latin-ext'
266
  );
267
- wp_enqueue_style( 'google_fonts', add_query_arg( $query_args, "//fonts.googleapis.com/css" ), array(), null );
268
- wp_enqueue_style( $this->plugin_slug, plugins_url('../assets/css/cht-style.css', __FILE__), array(), CHT_VERSION);
269
  }
270
 
271
  public function enqueue_scripts()
272
  {
273
 
274
- wp_enqueue_script( $this->plugin_slug . '-jq-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js');
275
- wp_enqueue_script( $this->plugin_slug .'fileinput', plugins_url('../assets/js/fileinput.min.js', __FILE__), array( 'jquery' ), CHT_VERSION);
276
- wp_enqueue_script( $this->plugin_slug .'pop', plugins_url('../assets/js/popper.min.js', __FILE__), array( 'jquery' ), CHT_VERSION);
277
- wp_enqueue_script( $this->plugin_slug, plugins_url('../assets/js/cht-scripts.min.js', __FILE__), array('jquery', 'wp-color-picker', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable'), CHT_VERSION);
278
  // wp_enqueue_script( $this->plugin_slug, plugins_url('../assets/js/cht-scripts.js', __FILE__), array( 'jquery' ), CHT_VERSION);
279
- wp_enqueue_script( $this->plugin_slug.'stick', plugins_url('../assets/js/jquery.sticky.js', __FILE__), array( 'jquery' ), CHT_VERSION);
280
- wp_localize_script($this->plugin_slug.'stick', 'cht_nonce_ajax',
281
  array(
282
  'cht_nonce' => wp_create_nonce('cht_nonce_ajax')
283
  )
284
  );
285
  }
286
 
287
- public function cht_admin_setting_page() {
288
- if (current_user_can('manage_options')){
289
- $this->page = add_menu_page(
290
- __('Chaty', CHT_OPT),
291
- __('Chaty', CHT_OPT),
292
- 'manage_options',
293
- $this->plugin_slug,
294
- array($this, 'display_cht_admin_page'),
295
- plugins_url( 'chaty/icon/chaty.svg' )
296
- );
 
297
 
298
- add_submenu_page(
299
- $this->plugin_slug,
300
- __('Settings', CHT_OPT),
301
- __('Settings', CHT_OPT),
302
- 'manage_options',
303
- $this->plugin_slug,
304
- array($this, 'display_cht_admin_page')
305
- );
306
 
307
- $upgrade_page = add_submenu_page(
308
- $this->plugin_slug,
309
- __('Upgrade to Pro', CHT_OPT),
310
- __('Upgrade to Pro', CHT_OPT),
311
- 'manage_options',
312
- $this->upgrade_slug,
313
- array($this, 'display_cht_admin_upgrade_page')
314
- );
315
- add_action( 'admin_print_styles-' . $upgrade_page, array( $this, 'enqueue_styles' ) );
316
- }
 
 
 
 
 
 
 
 
 
 
317
  // Load public-facing style sheet and JavaScript.
318
- add_action( 'admin_print_styles-' . $this->page, array( $this, 'enqueue_styles' ) );
319
- add_action( 'admin_print_scripts-' . $this->page, array( $this, 'enqueue_scripts' ) );
 
 
 
 
 
320
  }
321
 
322
- public function check_page_available() {
 
323
 
324
  }
325
 
326
- public function getUpgradeMenuItemUrl() {
 
327
  return CHT_PRO_URL;
328
  }
329
 
330
 
331
- public function display_cht_admin_page() {
 
332
  include_once CHT_DIR . '/views/admin.php';
333
  }
334
 
335
- public function display_cht_admin_upgrade_page() {
 
336
  include_once CHT_DIR . '/views/upgrade.php';
337
  }
338
 
@@ -340,12 +368,15 @@ class CHT_Admin_Base
340
  {
341
  return get_option('cht_license_key');
342
  }
 
343
  // this site domain
344
- public function get_site(){
345
- $permalink = get_home_url();
 
346
  return $permalink;
347
  }
348
- public function is_pro($token = '')
 
349
  {
350
  if ($token === '') {
351
  $token = $this->get_token();
@@ -358,19 +389,23 @@ class CHT_Admin_Base
358
  return strtotime(date('Y-m-d')) > strtotime(date('Y-m-d', strtotime($this->data_activ())));
359
  }
360
 
361
- public function data_activ(){
 
362
  if (!$this->is_pro()) return;
363
  $body = null;
364
- if(empty(self::$response->errors)){
365
  $body = json_decode(self::$response['body']);
366
  }
367
  if (isset($body->expired_date)) return $body->expired_date->date;
368
  }
369
- public function data_check(){
 
 
370
  if ($this->is_pro()) {
371
  return false;
372
  };
373
  }
 
374
  public function get_current_color()
375
  {
376
  $def_color = get_option('cht_color');
@@ -404,7 +439,7 @@ class CHT_Admin_Base
404
  $pos_style = 'left: 25px; bottom: 25px; right: auto';
405
  }
406
 
407
- return $pos_style ;
408
  }
409
 
410
  public function cht_clear_all_caches()
@@ -433,16 +468,17 @@ class CHT_Admin_Base
433
  }
434
  } else if (method_exists('WpFastestCache', 'deleteCache') && !empty($wp_fastest_cache)) {
435
  $wp_fastest_cache->deleteCache();
436
- } else if (function_exists( 'rocket_clean_domain' )) {
437
  rocket_clean_domain();
438
  // Preload cache.
439
- if ( function_exists( 'run_rocket_sitemap_preload' ) ) {
440
  run_rocket_sitemap_preload();
441
  }
442
  }
443
  }
444
 
445
- public static function chaty_sanitize_options($value) {
 
446
  $value = stripslashes($value);
447
  $value = filter_var($value, FILTER_SANITIZE_STRING);
448
  return $value;
@@ -489,7 +525,7 @@ class CHT_Admin_Base
489
  */
490
 
491
  /*check for nonce*/
492
- if(isset($_REQUEST['nonce']) && !empty($_REQUEST['nonce']) && wp_verify_nonce($_REQUEST['nonce'], "chaty_plugin_nonce")) {
493
 
494
  // register field section one
495
  foreach ($this->socials as $social) {
@@ -523,15 +559,16 @@ class CHT_Admin_Base
523
  }
524
  }
525
 
526
- public function device(){
527
- return'desktop_active mobile_active';
528
- if( isset(get_option('cht_devices')['desktop']) && isset(get_option('cht_devices')['mobile'])){
529
- return'desktop_active mobile_active';
530
- }else if( isset(get_option('cht_devices')['mobile'])){
 
531
  return 'mobile_active';
532
- }else if(isset(get_option('cht_devices')['desktop'])){
533
- return 'desktop_active';
534
- }else{
535
  return 'none';
536
  }
537
  }
@@ -545,9 +582,9 @@ class CHT_Admin_Base
545
  public function uploadCustomWidget($value, $old_value, $option)
546
  {
547
  $option = !empty($option) ? $option : 'cht_widget_img';
548
- $allowed_ext = ['jpeg', 'png', 'jpg' ,'svg'];
549
- if ( ! function_exists( 'wp_handle_upload' ) )
550
- require_once( ABSPATH . 'wp-admin/includes/file.php' );
551
 
552
  $file = &$_FILES[$option];
553
  $type = wp_check_filetype($file['name']);
@@ -560,9 +597,9 @@ class CHT_Admin_Base
560
  wp_delete_file($old_value['file']);
561
  }
562
 
563
- $overrides = array( 'test_form' => false );
564
- $movefile = wp_handle_upload( $file, $overrides );
565
- if ( $movefile && empty($movefile['error']) ) {
566
  return array(
567
  'file' => $movefile['file'],
568
  'url' => $movefile['url']
@@ -573,7 +610,7 @@ class CHT_Admin_Base
573
 
574
  public function getCallToAction()
575
  {
576
- if(get_option('cht_cta')){
577
  $res = nl2br(get_option('cht_cta'));
578
  $res = str_replace(array("\n", "\r"), "", $res);
579
  return $res;
1
  <?php
2
+
3
  namespace CHT\admin;
4
 
5
  use CHT\includes\CHT_Widget;
6
+
7
  /**
8
  * Class CHT_Admin_Base
9
  * @since 1.0
24
 
25
  public function __construct()
26
  {
27
+ $plugin = CHT_Widget::get_instance();
28
+ $this->plugin_slug = $plugin->get_plugin_slug();
29
  $this->friendly_name = $plugin->get_name();
30
+ $this->socials = CHT_Social_Icons::get_instance()->get_icons_list();
31
+ $this->colors = CHT_Social_Icons::get_instance()->get_colors();
32
+ $this->token = $this->get_token();
33
+ $this->upgrade_slug = $this->plugin_slug . '-upgrade';
34
 
35
+ if (is_admin()) { // admin actions
36
  add_action('admin_menu', array($this, 'cht_admin_setting_page'));
37
  // Adds all of the options for the administrative settings
38
  add_action('admin_init', array($this, 'cht_register_inputs'));
42
  add_action('updated_option', array($this, 'cht_clear_all_caches'));
43
 
44
  /* Send message to owner */
45
+ add_action('wp_ajax_wcp_admin_send_message_to_owner', array($this, 'wcp_admin_send_message_to_owner'));
46
 
47
  /* ADD Upgrade link to plugin */
48
+ add_filter('plugin_action_links_' . CHT_PLUGIN_BASE, [$this, 'plugin_action_links']);
49
 
50
+ add_action('admin_footer', array($this, 'add_deactivate_modal'));
51
+ add_action('wp_ajax_chaty_plugin_deactivate', array($this, 'chaty_plugin_deactivate'));
52
  }
53
 
54
+ public function chaty_plugin_deactivate()
55
+ {
56
  global $current_user;
57
  $postData = $_POST;
58
  $errorCounter = 0;
60
  $response['status'] = 0;
61
  $response['message'] = "";
62
  $response['valid'] = 1;
63
+ if (!isset($postData['reason']) || empty($postData['reason'])) {
64
  $errorCounter++;
65
  $response['message'] = "Please provide reason";
66
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
69
  $response['valid'] = 0;
70
  } else {
71
  $nonce = self::chaty_sanitize_options($postData['nonce']);
72
+ if (!wp_verify_nonce($nonce, 'chaty_deactivate_nonce')) {
73
  $response['message'] = __("Your request is not valid", CHT_OPT);
74
  $errorCounter++;
75
  $response['valid'] = 0;
76
  }
77
  }
78
+ if ($errorCounter == 0) {
79
  global $current_user;
80
  $postData = $_POST;
81
  $email = get_option('admin_email');
129
  die;
130
  }
131
 
132
+ public function add_deactivate_modal()
133
+ {
134
  global $pagenow;
135
 
136
+ if ('plugins.php' !== $pagenow) {
137
  return;
138
  }
139
 
140
  include CHT_DIR . '/views/modals/chaty-deactivate-form.php';
141
  }
142
 
143
+ public function plugin_action_links($links)
144
+ {
145
+ $links['go_pro'] = '<a href="' . CHT_PRO_URL . '" class="chaty-plugins-gopro">' . __('Upgrade', 'stars-testimonials') . '</a>';
146
 
147
+ wp_register_style('chaty-admin-custom-style', CHT_PLUGIN_URL . '/assets/css/admin-cht-style.css');
148
+ wp_enqueue_style('chaty-admin-custom-style');
149
 
150
  return $links;
151
  }
152
 
153
+ public function wcp_admin_send_message_to_owner()
154
+ {
155
  $response = array();
156
  $response['status'] = 0;
157
  $response['error'] = 0;
160
  $errorArray = [];
161
  $errorMessage = __("%s is required", CHT_OPT);
162
  $postData = $_POST;
163
+ if (!isset($postData['textarea_text']) || trim($postData['textarea_text']) == "") {
164
  $error = array(
165
+ "key" => "textarea_text",
166
+ "message" => __("Please enter your message", "wcp")
167
  );
168
  $errorArray[] = $error;
169
  }
170
+ if (!isset($postData['user_email']) || trim($postData['user_email']) == "") {
171
  $error = array(
172
+ "key" => "user_email",
173
+ "message" => sprintf($errorMessage, __("Email", "wcp"))
174
  );
175
  $errorArray[] = $error;
176
+ } else if (!filter_var($postData['user_email'], FILTER_VALIDATE_EMAIL)) {
177
  $error = array(
178
  'key' => "user_email",
179
  "message" => "Email is not valid"
180
  );
181
  $errorArray[] = $error;
182
  }
183
+ if (empty($errorArray)) {
184
+ if (!isset($_REQUEST['nonce']) || empty($_REQUEST['nonce'])) {
185
  $error = array(
186
  'key' => "nonce",
187
  "message" => "Your request is not valid"
188
  );
189
  $errorArray[] = $error;
190
+ } else if (!wp_verify_nonce($_REQUEST['nonce'], "chaty_send_message_to_owner")) {
191
  $error = array(
192
  'key' => "nonce",
193
  "message" => "Your request is not valid"
195
  $errorArray[] = $error;
196
  }
197
  }
198
+ if (empty($errorArray)) {
199
  global $current_user;
200
  $text_message = $postData['textarea_text'];
201
  $email = $postData['user_email'];
202
  $domain = site_url();
203
+ $user_name = $current_user->first_name . " " . $current_user->last_name;
204
+ $subject = "Chaty request: " . $domain;
205
  $headers = "MIME-Version: 1.0\r\n";
206
  $headers .= "Content-Type: text/html; charset=UTF-8\r\n";
207
+ $headers .= 'From: ' . $user_name . ' <' . $email . '>' . PHP_EOL;
208
+ $headers .= 'Reply-To: ' . $user_name . ' <' . $email . '>' . PHP_EOL;
209
  $headers .= 'X-Mailer: PHP/' . phpversion();
210
  ob_start();
211
  ?>
227
  $message = ob_get_clean();
228
  $to = "contact+fromwp@premio.io";
229
  $status = wp_mail($to, $subject, $message, $headers);
230
+ if ($status) {
231
  $response['status'] = 1;
232
  } else {
233
  $response['status'] = 0;
240
  echo json_encode($response);
241
  }
242
 
243
+ public function del_space($text)
244
+ {
245
+ return str_replace('_', ' ', $text);
246
  }
247
 
248
+ public function cht_inline_css_admin()
249
+ {
250
  echo '<style>
251
  #toplevel_page_chaty-app img:hover, #toplevel_page_chaty-app img {
252
  opacity: 0 !important;
256
  }
257
  #toplevel_page_chaty-app .dashicons-before{
258
  background-color: #A0A3A8;
259
+ -webkit-mask: url(' . plugins_url('../icon/chaty.svg', __FILE__) . ') no-repeat center;
260
+ mask: url(' . plugins_url('../icon/chaty.svg', __FILE__) . ') no-repeat center;
261
  }
262
  .current#toplevel_page_chaty-app .dashicons-before{
263
  background-color: #fff;
272
  'family' => 'Rubik:400,700|Oswald:400,600',
273
  'subset' => 'latin,latin-ext'
274
  );
275
+ wp_enqueue_style('google_fonts', add_query_arg($query_args, "//fonts.googleapis.com/css"), array(), null);
276
+ wp_enqueue_style($this->plugin_slug, plugins_url('../assets/css/cht-style.css', __FILE__), array(), CHT_VERSION);
277
  }
278
 
279
  public function enqueue_scripts()
280
  {
281
 
282
+ wp_enqueue_script($this->plugin_slug . '-jq-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js');
283
+ wp_enqueue_script($this->plugin_slug . 'fileinput', plugins_url('../assets/js/fileinput.min.js', __FILE__), array('jquery'), CHT_VERSION);
284
+ wp_enqueue_script($this->plugin_slug . 'pop', plugins_url('../assets/js/popper.min.js', __FILE__), array('jquery'), CHT_VERSION);
285
+ wp_enqueue_script($this->plugin_slug, plugins_url('../assets/js/cht-scripts.min.js', __FILE__), array('jquery', 'wp-color-picker', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable'), CHT_VERSION);
286
  // wp_enqueue_script( $this->plugin_slug, plugins_url('../assets/js/cht-scripts.js', __FILE__), array( 'jquery' ), CHT_VERSION);
287
+ wp_enqueue_script($this->plugin_slug . 'stick', plugins_url('../assets/js/jquery.sticky.js', __FILE__), array('jquery'), CHT_VERSION);
288
+ wp_localize_script($this->plugin_slug . 'stick', 'cht_nonce_ajax',
289
  array(
290
  'cht_nonce' => wp_create_nonce('cht_nonce_ajax')
291
  )
292
  );
293
  }
294
 
295
+ public function cht_admin_setting_page()
296
+ {
297
+ if (current_user_can('manage_options')) {
298
+ $this->page = add_menu_page(
299
+ __('Chaty', CHT_OPT),
300
+ __('Chaty', CHT_OPT),
301
+ 'manage_options',
302
+ $this->plugin_slug,
303
+ array($this, 'display_cht_admin_page'),
304
+ plugins_url('chaty/icon/chaty.svg')
305
+ );
306
 
307
+ add_submenu_page(
308
+ $this->plugin_slug,
309
+ __('Settings', CHT_OPT),
310
+ __('Settings', CHT_OPT),
311
+ 'manage_options',
312
+ $this->plugin_slug,
313
+ array($this, 'display_cht_admin_page')
314
+ );
315
 
316
+ $widget_page = add_submenu_page(
317
+ $this->plugin_slug,
318
+ __('Settings Admin', CHT_OPT),
319
+ __('+ Create New Widget', CHT_OPT),
320
+ 'manage_options',
321
+ "chaty-upgrade",
322
+ array($this, "chaty_widget_page")
323
+ );
324
+
325
+ $upgrade_page = add_submenu_page(
326
+ $this->plugin_slug,
327
+ __('Upgrade to Pro', CHT_OPT),
328
+ __('Upgrade to Pro', CHT_OPT),
329
+ 'manage_options',
330
+ $this->upgrade_slug,
331
+ array($this, 'display_cht_admin_upgrade_page')
332
+ );
333
+ add_action('admin_print_styles-' . $widget_page, array($this, 'enqueue_styles'));
334
+ add_action('admin_print_styles-' . $upgrade_page, array($this, 'enqueue_styles'));
335
+ }
336
  // Load public-facing style sheet and JavaScript.
337
+ add_action('admin_print_styles-' . $this->page, array($this, 'enqueue_styles'));
338
+ add_action('admin_print_scripts-' . $this->page, array($this, 'enqueue_scripts'));
339
+ }
340
+
341
+ public function chaty_widget_page()
342
+ {
343
+ include_once CHT_DIR . '/views/parts/chaty_widget.php';
344
  }
345
 
346
+ public function check_page_available()
347
+ {
348
 
349
  }
350
 
351
+ public function getUpgradeMenuItemUrl()
352
+ {
353
  return CHT_PRO_URL;
354
  }
355
 
356
 
357
+ public function display_cht_admin_page()
358
+ {
359
  include_once CHT_DIR . '/views/admin.php';
360
  }
361
 
362
+ public function display_cht_admin_upgrade_page()
363
+ {
364
  include_once CHT_DIR . '/views/upgrade.php';
365
  }
366
 
368
  {
369
  return get_option('cht_license_key');
370
  }
371
+
372
  // this site domain
373
+ public function get_site()
374
+ {
375
+ $permalink = get_home_url();
376
  return $permalink;
377
  }
378
+
379
+ public function is_pro($token = '')
380
  {
381
  if ($token === '') {
382
  $token = $this->get_token();
389
  return strtotime(date('Y-m-d')) > strtotime(date('Y-m-d', strtotime($this->data_activ())));
390
  }
391
 
392
+ public function data_activ()
393
+ {
394
  if (!$this->is_pro()) return;
395
  $body = null;
396
+ if (empty(self::$response->errors)) {
397
  $body = json_decode(self::$response['body']);
398
  }
399
  if (isset($body->expired_date)) return $body->expired_date->date;
400
  }
401
+
402
+ public function data_check()
403
+ {
404
  if ($this->is_pro()) {
405
  return false;
406
  };
407
  }
408
+
409
  public function get_current_color()
410
  {
411
  $def_color = get_option('cht_color');
439
  $pos_style = 'left: 25px; bottom: 25px; right: auto';
440
  }
441
 
442
+ return $pos_style;
443
  }
444
 
445
  public function cht_clear_all_caches()
468
  }
469
  } else if (method_exists('WpFastestCache', 'deleteCache') && !empty($wp_fastest_cache)) {
470
  $wp_fastest_cache->deleteCache();
471
+ } else if (function_exists('rocket_clean_domain')) {
472
  rocket_clean_domain();
473
  // Preload cache.
474
+ if (function_exists('run_rocket_sitemap_preload')) {
475
  run_rocket_sitemap_preload();
476
  }
477
  }
478
  }
479
 
480
+ public static function chaty_sanitize_options($value)
481
+ {
482
  $value = stripslashes($value);
483
  $value = filter_var($value, FILTER_SANITIZE_STRING);
484
  return $value;
525
  */
526
 
527
  /*check for nonce*/
528
+ if (isset($_REQUEST['nonce']) && !empty($_REQUEST['nonce']) && wp_verify_nonce($_REQUEST['nonce'], "chaty_plugin_nonce")) {
529
 
530
  // register field section one
531
  foreach ($this->socials as $social) {
559
  }
560
  }
561
 
562
+ public function device()
563
+ {
564
+ return 'desktop_active mobile_active';
565
+ if (isset(get_option('cht_devices')['desktop']) && isset(get_option('cht_devices')['mobile'])) {
566
+ return 'desktop_active mobile_active';
567
+ } else if (isset(get_option('cht_devices')['mobile'])) {
568
  return 'mobile_active';
569
+ } else if (isset(get_option('cht_devices')['desktop'])) {
570
+ return 'desktop_active';
571
+ } else {
572
  return 'none';
573
  }
574
  }
582
  public function uploadCustomWidget($value, $old_value, $option)
583
  {
584
  $option = !empty($option) ? $option : 'cht_widget_img';
585
+ $allowed_ext = ['jpeg', 'png', 'jpg', 'svg'];
586
+ if (!function_exists('wp_handle_upload'))
587
+ require_once(ABSPATH . 'wp-admin/includes/file.php');
588
 
589
  $file = &$_FILES[$option];
590
  $type = wp_check_filetype($file['name']);
597
  wp_delete_file($old_value['file']);
598
  }
599
 
600
+ $overrides = array('test_form' => false);
601
+ $movefile = wp_handle_upload($file, $overrides);
602
+ if ($movefile && empty($movefile['error'])) {
603
  return array(
604
  'file' => $movefile['file'],
605
  'url' => $movefile['url']
610
 
611
  public function getCallToAction()
612
  {
613
+ if (get_option('cht_cta')) {
614
  $res = nl2br(get_option('cht_cta'));
615
  $res = str_replace(array("\n", "\r"), "", $res);
616
  return $res;
assets/css/cht-style.css CHANGED
@@ -3036,6 +3036,74 @@ a.rpt_tooltip span.intool b {
3036
  border: none
3037
  }
3038
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3039
  @media only screen and (max-width: 640px) {
3040
  .rpt_plans .rpt_plan {
3041
  width: 96%;
3036
  border: none
3037
  }
3038
 
3039
+
3040
+ /*New Widget Page css*/
3041
+ .chaty-new-widget-wrap {
3042
+ background: #F9FCFC url(../images/new_widget_bg.png) no-repeat left center;
3043
+ border-radius: 10px;
3044
+ padding: 30px 20px;
3045
+ margin: 40px 30px 0 0;
3046
+ background-size: auto 100%;
3047
+ }
3048
+ .chaty-new-widget-wrap .h2 {
3049
+ margin: 0 0 20px;
3050
+ font-size: 20px;
3051
+ color: #4F4F4F;
3052
+ line-height: 1.4;
3053
+ font-weight: bold;
3054
+ }
3055
+ .chaty-new-widget-right p {
3056
+ font-size: 14px;
3057
+ line-height: 1.2;
3058
+ color: #4F4F4F;
3059
+ margin-top: 0;
3060
+ }
3061
+ .chaty-new-widget-right p strong {
3062
+ font-weight: 700;
3063
+ font-size: 16px;
3064
+ }
3065
+ .chaty-new-widget-right li {
3066
+ font-size: 14px;
3067
+ color: #727D81;
3068
+ position: relative;
3069
+ padding-left: 20px;
3070
+ line-height: 1.7;
3071
+ margin-bottom: 10px;
3072
+ }
3073
+ .chaty-new-widget-right li::before {
3074
+ content: "";
3075
+ position: absolute;
3076
+ top: 5px;
3077
+ left: 0;
3078
+ background-color: #7761DF;
3079
+ width: 10px;
3080
+ height: 10px;
3081
+ border-radius: 50%;
3082
+ }
3083
+ .chaty-new-widget-right .upgrade-chatys a {
3084
+ font-size: 14px;
3085
+ padding: 10px 26px;
3086
+ border-radius: 40px;
3087
+ background: #DFDDF7;
3088
+ color: #7761DF;
3089
+ text-decoration: none;
3090
+ margin: 10px 0 0 0;
3091
+ display: inline-block;
3092
+ text-transform: uppercase;
3093
+ font-weight: bold;
3094
+ }
3095
+ .chaty-new-widget-row {
3096
+ display: flex;
3097
+ align-items: center;
3098
+ }
3099
+ .chaty-new-widget-left {
3100
+ width: 322px;
3101
+ }
3102
+ .chaty-new-widget-right {
3103
+ padding-left: 20px;
3104
+ }
3105
+
3106
+
3107
  @media only screen and (max-width: 640px) {
3108
  .rpt_plans .rpt_plan {
3109
  width: 96%;
assets/images/new_widget_bg.png ADDED
Binary file
assets/images/new_widget_img.png ADDED
Binary file
assets/js/cht-front-script.js CHANGED
@@ -74,11 +74,11 @@
74
  default:
75
  return '<svg version="1.1" id="ch" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="-496 507.7 54 54" style="enable-background:new -496 507.7 54 54;" xml:space="preserve">\n<style type="text/css">.st1 {fill: #FFFFFF;}.st0{fill: #808080;}</style>\n<g><circle cx="-469" cy="534.7" r="27" fill="' + t.object_settings.color + '"/></g>\n<path class="st1" d="M-459.9,523.7h-20.3c-1.9,0-3.4,1.5-3.4,3.4v15.3c0,1.9,1.5,3.4,3.4,3.4h11.4l5.9,4.9c0.2,0.2,0.3,0.2,0.5,0.2 h0.3c0.3-0.2,0.5-0.5,0.5-0.8v-4.2h1.7c1.9,0,3.4-1.5,3.4-3.4v-15.3C-456.5,525.2-458,523.7-459.9,523.7z"/>\n<path class="st0" d="M-477.7,530.5h11.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-11.9c-0.5,0-0.8-0.4-0.8-0.8l0,0C-478.6,530.8-478.2,530.5-477.7,530.5z"/>\n<path class="st0" d="M-477.7,533.5h7.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-7.9c-0.5,0-0.8-0.4-0.8-0.8l0,0C-478.6,533.9-478.2,533.5-477.7,533.5z"/>\n</svg>'
76
  }
77
- }(e), C = i("display_cta"), "" != d && "none" != C && (g += ' <div class="chaty-widget-i-title true"> ', g += d, g += "</div>"), g += "</div>", g += '<div class="chaty-widget-i i-trigger-close" data-title="Hide" style="background-color:' + e.object_settings.color + '">', g += '<svg viewBox="0 0 54 54" fill="none" xmlns="http://www.w3.org/2000/svg">', g += '<ellipse cx="26" cy="26" rx="26" ry="26" fill="' + e.object_settings.color + '"/>', g += '<rect width="27.1433" height="3.89857" rx="1.94928" transform="translate(18.35 15.6599) scale(0.998038 1.00196) rotate(45)" fill="white"/>', g += '<rect width="27.1433" height="3.89857" rx="1.94928" transform="translate(37.5056 18.422) scale(0.998038 1.00196) rotate(135)" fill="white"/>', g += "</svg>", g += '<div class="chaty-widget-i-title">', g += "Hide", g += "</div>", g += "</div>", g += " </div>", 0 === n.length && (g += '<div class="get" style="position: absolute;width: 100%;text-align: center;display: block!important; opacity: 1 !important;visibility: visible !important;"> <a href="https://premio.io/downloads/chaty/?utm_source=wpplugin" target="_blank" style=" font-size: 11px !important; top: -5px !important; position: relative !important; color: #222 !important; width:60px !important; font-family: Lato, Helvetica, Arial, sans-serif; display: block !important; opacity: 1 !important; visibility: visible !important; ">Get Widget</a></div>'), g += "</div>"
78
 
79
  } else {
80
  var w = "";
81
- //"" == d && (w = "hidetooltip"), g = '<div class="chaty-widget one_widget ' + n + " " + a + ' " style="display:block; ' + s + '" dir="ltr">', g += '<div class="chaty-widget-is no-tooltip">', g += "</div>", g += '<div class="i-trigger">', g += '<div class="chaty-widget-i no-tooltip i-trigger-open ' + w + '">', g += o(e), "" != d && (g += ' <div class="chaty-widget-i-title one_go"> ', g += d, g += "</div>"), g += "</div>", 0 === n.length && (g += '<div class="get" style="opacity:1; position: absolute; width: 100%; text-align:center"> <a href="https://premio.io/downloads/chaty/?utm_source=wpplugin" target="_blank" style="font-family: Lato, Helvetica, Arial, sans-serif;; font-size: 11px; top: -5px; position: relative; color: #8c8585;">Get Widget</a></div>'), g += " </div>", g += "</div>";
82
  //console.log(g);
83
 
84
  }
74
  default:
75
  return '<svg version="1.1" id="ch" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="-496 507.7 54 54" style="enable-background:new -496 507.7 54 54;" xml:space="preserve">\n<style type="text/css">.st1 {fill: #FFFFFF;}.st0{fill: #808080;}</style>\n<g><circle cx="-469" cy="534.7" r="27" fill="' + t.object_settings.color + '"/></g>\n<path class="st1" d="M-459.9,523.7h-20.3c-1.9,0-3.4,1.5-3.4,3.4v15.3c0,1.9,1.5,3.4,3.4,3.4h11.4l5.9,4.9c0.2,0.2,0.3,0.2,0.5,0.2 h0.3c0.3-0.2,0.5-0.5,0.5-0.8v-4.2h1.7c1.9,0,3.4-1.5,3.4-3.4v-15.3C-456.5,525.2-458,523.7-459.9,523.7z"/>\n<path class="st0" d="M-477.7,530.5h11.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-11.9c-0.5,0-0.8-0.4-0.8-0.8l0,0C-478.6,530.8-478.2,530.5-477.7,530.5z"/>\n<path class="st0" d="M-477.7,533.5h7.9c0.5,0,0.8,0.4,0.8,0.8l0,0c0,0.5-0.4,0.8-0.8,0.8h-7.9c-0.5,0-0.8-0.4-0.8-0.8l0,0C-478.6,533.9-478.2,533.5-477.7,533.5z"/>\n</svg>'
76
  }
77
+ }(e), C = i("display_cta"), "" != d && "none" != C && (g += ' <div class="chaty-widget-i-title true"> ', g += d, g += "</div>"), g += "</div>", g += '<div class="chaty-widget-i i-trigger-close" data-title="Hide" style="background-color:' + e.object_settings.color + '">', g += '<svg viewBox="0 0 54 54" fill="none" xmlns="http://www.w3.org/2000/svg">', g += '<ellipse cx="26" cy="26" rx="26" ry="26" fill="' + e.object_settings.color + '"/>', g += '<rect width="27.1433" height="3.89857" rx="1.94928" transform="translate(18.35 15.6599) scale(0.998038 1.00196) rotate(45)" fill="white"/>', g += '<rect width="27.1433" height="3.89857" rx="1.94928" transform="translate(37.5056 18.422) scale(0.998038 1.00196) rotate(135)" fill="white"/>', g += "</svg>", g += '<div class="chaty-widget-i-title">', g += "Hide", g += "</div>", g += "</div>", g += " </div>", 0 === n.length && (g += '<div class="get" style="position: absolute;width: 100%;text-align: center;display: block!important; opacity: 1 !important;visibility: visible !important;"> <a href="https://premio.io/downloads/chaty/?utm_source=wpplugin" target="_blank" style=" font-size: 11px !important; top: -5px !important; position: relative !important; color: #222 !important; width:60px !important; font-family: Lato, Helvetica, Arial, sans-serif; display: block !important; opacity: 1 !important; visibility: visible !important; ">Get Chaty</a></div>'), g += "</div>"
78
 
79
  } else {
80
  var w = "";
81
+ //"" == d && (w = "hidetooltip"), g = '<div class="chaty-widget one_widget ' + n + " " + a + ' " style="display:block; ' + s + '" dir="ltr">', g += '<div class="chaty-widget-is no-tooltip">', g += "</div>", g += '<div class="i-trigger">', g += '<div class="chaty-widget-i no-tooltip i-trigger-open ' + w + '">', g += o(e), "" != d && (g += ' <div class="chaty-widget-i-title one_go"> ', g += d, g += "</div>"), g += "</div>", 0 === n.length && (g += '<div class="get" style="opacity:1; position: absolute; width: 100%; text-align:center"> <a href="https://premio.io/downloads/chaty/?utm_source=wpplugin" target="_blank" style="font-family: Lato, Helvetica, Arial, sans-serif;; font-size: 11px; top: -5px; position: relative; color: #8c8585;">Get Chaty</a></div>'), g += " </div>", g += "</div>";
82
  //console.log(g);
83
 
84
  }
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.1.2
9
  License: GPL2
10
  */
11
 
@@ -22,7 +22,7 @@ define('CHT_INC', CHT_DIR . '/includes');
22
  define('CHT_PRO_URL', admin_url("admin.php?page=chaty-app-upgrade"));
23
  define('CHT_PLUGIN_URL', plugins_url() . "/chaty/");
24
  define('CHT_PLUGIN_BASE', plugin_basename(CHT_FILE));
25
- define('CHT_VERSION', "2.1.2");
26
 
27
  if (!function_exists('wp_doing_ajax')) {
28
  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.1.3
9
  License: GPL2
10
  */
11
 
22
  define('CHT_PRO_URL', admin_url("admin.php?page=chaty-app-upgrade"));
23
  define('CHT_PLUGIN_URL', plugins_url() . "/chaty/");
24
  define('CHT_PLUGIN_BASE', plugin_basename(CHT_FILE));
25
+ define('CHT_VERSION', "2.1.3");
26
 
27
  if (!function_exists('wp_doing_ajax')) {
28
  function wp_doing_ajax()
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: galdub, tomeraharon, premio
3
  Tags: whatsapp, facebook messenger, click to chat, chat, chat button, call now button
4
  Requires at least: 3.1
5
  Tested up to: 5.2
6
- Stable tag: 2.1.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.
@@ -71,6 +71,7 @@ You will get all the features of the free plan, plus:
71
  9. New feature: create a pre-set WhatsApp chat message and pre-set email subject line. When people click on your WhatsApp button or email icon, you pre-set message will be automatically loaded
72
  10. New feature: fire a Google Analytics event every time one of your channels buttons is clicked. That's great news for you, because now you can fully track any click to call, chat, navigate, and more
73
  11. New feature: decide if you want the custom chat button open in a new tab or in the current tab.
 
74
  <br><a href="https://premio.io/downloads/chaty/?utm_source=wordpressorg" target="_blank" title="Chaty pro plans"><strong>Upgrade to pro</strong></a> to get all pro features :)
75
 
76
  = How does each channel work? =
@@ -172,6 +173,9 @@ Yes! You can even decide what chat buttons will show up on each device (desktop/
172
 
173
  == Changelog ==
174
 
 
 
 
175
  = 2.1.2 =
176
  * Added multi year plans
177
 
3
  Tags: whatsapp, facebook messenger, click to chat, chat, chat button, call now button
4
  Requires at least: 3.1
5
  Tested up to: 5.2
6
+ Stable tag: 2.1.3
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.
71
  9. New feature: create a pre-set WhatsApp chat message and pre-set email subject line. When people click on your WhatsApp button or email icon, you pre-set message will be automatically loaded
72
  10. New feature: fire a Google Analytics event every time one of your channels buttons is clicked. That's great news for you, because now you can fully track any click to call, chat, navigate, and more
73
  11. New feature: decide if you want the custom chat button open in a new tab or in the current tab.
74
+ 12. New feature: create more than one chat widget and show it on specific pages and categories of your website based on page targeting rules. Works great for multi-language websites and WPML plugin, for different products, landing pages, and any other URL targeting rule.
75
  <br><a href="https://premio.io/downloads/chaty/?utm_source=wordpressorg" target="_blank" title="Chaty pro plans"><strong>Upgrade to pro</strong></a> to get all pro features :)
76
 
77
  = How does each channel work? =
173
 
174
  == Changelog ==
175
 
176
+ = 2.1.3 =
177
+ * Multi widgets + Reduced CSS conflicts
178
+
179
  = 2.1.2 =
180
  * Added multi year plans
181
 
views/parts/chaty_widget.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $upgarde_url = admin_url("admin.php?page=my-sticky-elements-upgrade");
3
+ ?>
4
+ <div class="chaty-new-widget-wrap">
5
+ <div class="h2">What can you use it for?</div>
6
+ <div class="chaty-new-widget-row">
7
+ <div class="chaty-new-widget-left">
8
+ <img src="<?php echo plugin_dir_url("") ?>/chaty/assets/images/new_widget_img.png" width="322" height="258" />
9
+ </div>
10
+ <div class="chaty-new-widget-right">
11
+ <p><strong>Create a new Chaty widget and show it on specific pages and categories of your website based on page targeting rules.</strong></p>
12
+
13
+ <ul>
14
+ <li>If you have a multi-language website or WPML plugin installed, you can show different form and buttons based on URL (e.g. visitors to yourdomain.com/fr/* pages will get an option to send a WhatsApp message to a French number and call your French phone number)</li>
15
+ <li>You can show separate widgets for different products on your website (e.g. you can show the Facebook Messenger channel for products in the yourdomain.com/high-end/* category)</li>
16
+ <li>Display different channels for your landing pages</li>
17
+ <li>Show one widget on your support and contact pages, and a different widget on your sales pages.</li>
18
+ <li>Display different call-to-action messages for different pages on your website or separate call-to-action messages for mobile and desktop</li>
19
+ </ul>
20
+ <div class="upgrade-chatys">
21
+ <a href="<?php echo CHT_PRO_URL; ?>" target="_blank"><span class="dashicons dashicons-lock"></span> <?php _e('Upgrade Now', CHT_OPT );?></a>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ </div>
26
+ <?php
views/upgrade.php CHANGED
@@ -32,7 +32,9 @@
32
  <div class="rpt_feature rpt_feature_0-4"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>Locate the widget exactly where you want by the pixel - X,Y</span>Custom location<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
33
  <div class="rpt_feature rpt_feature_0-5"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>Automatically track clicks on each of your channels on your Google Analytics account</span>Google Analytics<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
34
  <div class="rpt_feature rpt_feature_0-6"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>Show/don't show the widget on specific pages</span>Page targeting<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
 
35
  <div class="rpt_feature rpt_feature_0-7"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>QR code for WeChat, customizable WhatsApp message, customizable email subject, and remove the credit link</span>And more<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
 
36
  <?php $pro_url = "https://go.premio.io/?edd_action=add_to_cart&download_id=185&edd_options[price_id]=" ?>
37
  <div class="rpt_feature rpt_feature_0-9">
38
  <select data-key="0" class="multiple-options">
@@ -73,7 +75,9 @@
73
  <div class="rpt_feature rpt_feature_0-4"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>Locate the widget exactly where you want by the pixel - X,Y</span>Custom location<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
74
  <div class="rpt_feature rpt_feature_0-5"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>Automatically track clicks on each of your channels on your Google Analytics account</span>Google Analytics<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
75
  <div class="rpt_feature rpt_feature_0-6"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>Show/don't show the widget on specific pages</span>Page targeting<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
 
76
  <div class="rpt_feature rpt_feature_0-7"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>QR code for WeChat, customizable WhatsApp message, customizable email subject, and remove the credit link</span>And more<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
 
77
  <div class="rpt_feature rpt_feature_0-9">
78
  <select data-key="0" class="multiple-options">
79
  <option data-header="Renewals for 25% off" data-price="49" value="<?php echo esc_url($pro_url."2") ?>">
@@ -115,7 +119,9 @@
115
  <div class="rpt_feature rpt_feature_0-4"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>Locate the widget exactly where you want by the pixel - X,Y</span>Custom location<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
116
  <div class="rpt_feature rpt_feature_0-5"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>Automatically track clicks on each of your channels on your Google Analytics account</span>Google Analytics<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
117
  <div class="rpt_feature rpt_feature_0-6"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>Show/don't show the widget on specific pages</span>Page targeting<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
 
118
  <div class="rpt_feature rpt_feature_0-7"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>QR code for WeChat, customizable WhatsApp message, customizable email subject, and remove the credit link</span>And more<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
 
119
  <div class="rpt_feature rpt_feature_0-9">
120
  <select data-key="0" class="multiple-options">
121
  <option data-header="Renewals for 25% off" data-price="99" value="<?php echo esc_url($pro_url."3") ?>">
32
  <div class="rpt_feature rpt_feature_0-4"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>Locate the widget exactly where you want by the pixel - X,Y</span>Custom location<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
33
  <div class="rpt_feature rpt_feature_0-5"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>Automatically track clicks on each of your channels on your Google Analytics account</span>Google Analytics<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
34
  <div class="rpt_feature rpt_feature_0-6"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>Show/don't show the widget on specific pages</span>Page targeting<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
35
+ <div class="rpt_feature rpt_feature_0-8"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>Create different widgets for different pages. Show different icons based on page targeting rules</span>Multiple widgets<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
36
  <div class="rpt_feature rpt_feature_0-7"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>QR code for WeChat, customizable WhatsApp message, customizable email subject, and remove the credit link</span>And more<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
37
+ <div class="rpt_feature rpt_feature_0-8"><a href="javascript:void(0)" class="rpt_tooltip">No "Get Chaty" credit</a></div>
38
  <?php $pro_url = "https://go.premio.io/?edd_action=add_to_cart&download_id=185&edd_options[price_id]=" ?>
39
  <div class="rpt_feature rpt_feature_0-9">
40
  <select data-key="0" class="multiple-options">
75
  <div class="rpt_feature rpt_feature_0-4"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>Locate the widget exactly where you want by the pixel - X,Y</span>Custom location<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
76
  <div class="rpt_feature rpt_feature_0-5"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>Automatically track clicks on each of your channels on your Google Analytics account</span>Google Analytics<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
77
  <div class="rpt_feature rpt_feature_0-6"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>Show/don't show the widget on specific pages</span>Page targeting<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
78
+ <div class="rpt_feature rpt_feature_0-8"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>Create different widgets for different pages. Show different icons based on page targeting rules</span>Multiple widgets<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
79
  <div class="rpt_feature rpt_feature_0-7"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>QR code for WeChat, customizable WhatsApp message, customizable email subject, and remove the credit link</span>And more<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
80
+ <div class="rpt_feature rpt_feature_0-8"><a href="javascript:void(0)" class="rpt_tooltip">No "Get Chaty" credit</a></div>
81
  <div class="rpt_feature rpt_feature_0-9">
82
  <select data-key="0" class="multiple-options">
83
  <option data-header="Renewals for 25% off" data-price="49" value="<?php echo esc_url($pro_url."2") ?>">
119
  <div class="rpt_feature rpt_feature_0-4"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>Locate the widget exactly where you want by the pixel - X,Y</span>Custom location<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
120
  <div class="rpt_feature rpt_feature_0-5"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>Automatically track clicks on each of your channels on your Google Analytics account</span>Google Analytics<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
121
  <div class="rpt_feature rpt_feature_0-6"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>Show/don't show the widget on specific pages</span>Page targeting<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
122
+ <div class="rpt_feature rpt_feature_0-8"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>Create different widgets for different pages. Show different icons based on page targeting rules</span>Multiple widgets<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
123
  <div class="rpt_feature rpt_feature_0-7"><a href="javascript:void(0)" class="rpt_tooltip"><span class="intool"><b></b>QR code for WeChat, customizable WhatsApp message, customizable email subject, and remove the credit link</span>And more<span class="rpt_tooltip_plus" style="color:#5500ff !important;"> +</span></a></div>
124
+ <div class="rpt_feature rpt_feature_0-8"><a href="javascript:void(0)" class="rpt_tooltip">No "Get Chaty" credit</a></div>
125
  <div class="rpt_feature rpt_feature_0-9">
126
  <select data-key="0" class="multiple-options">
127
  <option data-header="Renewals for 25% off" data-price="99" value="<?php echo esc_url($pro_url."3") ?>">
views/widget.php CHANGED
@@ -1,22 +1,22 @@
1
  <?php
2
  $social = $this->int_arr();
3
  $cht_active = get_option("cht_active");
4
- if(!empty($social) && $cht_active) {
5
- // $social = json_decode($social, true);
6
- if (array_key_exists("facebook_messenger", $social)) {
7
- ?>
8
- <div id="fb-root"></div>
9
- <script>(function (d, s, id) {
10
- var js, fjs = d.getElementsByTagName(s)[0];
11
- if (d.getElementById(id)) return;
12
- js = d.createElement(s);
13
- js.id = id;
14
- js.src = 'https://connect.facebook.net/locale/sdk.js#xfbml=1&version=v3.0';
15
- fjs.parentNode.insertBefore(js, fjs);
16
- }(document, 'script', 'facebook-jssdk'));
17
- </script>
18
- <?php }
19
- }?>
20
 
21
  <?php $bg_color = $this->get_current_color();?>
22
  <?php $len = count($this->int_arr());?>
@@ -49,6 +49,10 @@ $settings['active'] = ($cht_active && $len > 0 && $len < 3) ? "true" : "false";
49
  $data = array();
50
  $data['object_settings'] = $settings;
51
  if($len > 0 && $len < 3) {
 
 
 
 
52
  ?>
53
  <script>
54
  var chaty_settings = '<?php echo json_encode($data) ?>';
1
  <?php
2
  $social = $this->int_arr();
3
  $cht_active = get_option("cht_active");
4
+ //if(!empty($social) && $cht_active) {
5
+ //// $social = json_decode($social, true);
6
+ // if (array_key_exists("facebook_messenger", $social)) {
7
+ // ?>
8
+ <!-- <div id="fb-root"></div>-->
9
+ <!-- <script>(function (d, s, id) {-->
10
+ <!-- var js, fjs = d.getElementsByTagName(s)[0];-->
11
+ <!-- if (d.getElementById(id)) return;-->
12
+ <!-- js = d.createElement(s);-->
13
+ <!-- js.id = id;-->
14
+ <!-- js.src = 'https://connect.facebook.net/locale/sdk.js#xfbml=1&version=v3.0';-->
15
+ <!-- fjs.parentNode.insertBefore(js, fjs);-->
16
+ <!-- }(document, 'script', 'facebook-jssdk'));-->
17
+ <!-- </script>-->
18
+ <!-- --><?php //}
19
+ //}?>
20
 
21
  <?php $bg_color = $this->get_current_color();?>
22
  <?php $len = count($this->int_arr());?>
49
  $data = array();
50
  $data['object_settings'] = $settings;
51
  if($len > 0 && $len < 3) {
52
+ echo "<style>";
53
+ echo ".chaty-widget-is a{display: block; margin:0; padding:0; }";
54
+ echo ".chaty-widget-is svg{margin:0; padding:0;}";
55
+ echo "</style>";
56
  ?>
57
  <script>
58
  var chaty_settings = '<?php echo json_encode($data) ?>';