WhatsApp Chat WP - Version 4.3.2

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

Code changes from version 4.3.1 to 4.3.2

assets/js/qlwapp-admin.js CHANGED
@@ -32,7 +32,8 @@
32
  q: params.term,
33
  name: name,
34
  per_page: 10,
35
- action: 'qlwapp_get_posts'
 
36
  };
37
  },
38
  processResults: function (response) {
32
  q: params.term,
33
  name: name,
34
  per_page: 10,
35
+ action: 'qlwapp_get_posts',
36
+ nonce: $select.data('nonce')
37
  };
38
  },
39
  processResults: function (response) {
assets/js/qlwapp-admin.min.js CHANGED
@@ -1,2 +1,2 @@
1
 
2
- (function(a){a("form :input").keyup(function(b){if(!this.reportValidity()){a(this).closest("td").addClass("form-invalid");a("#btn-save-contact").attr("disabled","disabled")}else{a("#btn-save-contact").removeAttr("disabled");a(this).closest("td").removeClass("form-invalid")}});a(".qlwapp-select2").select2({allowClear:false,theme:"default",minimumResultsForSearch:-1});a(".qlwapp-select2-ajax").each(function(){var c=a(this),b=a(this).data("name");c.select2({allowClear:true,ajax:{url:ajaxurl,dataType:"json",delay:5000,data:function(d){return{q:d.term,name:b,per_page:10,action:"qlwapp_get_posts"}},processResults:function(d){var e=[];if(d){a.each(d,function(f,g){e.push({id:g[0],text:g[1]})})}return{results:e}},cache:true},})});a(".qlwapp-color-field").wpColorPicker();a(document).on("click",".upload_image_button",function(d){d.preventDefault();var b=wp.media.editor.send.attachment,c=a(this);wp.media.editor.send.attachment=function(e,f){a(c).parent().prev().attr("src",f.url);a(c).prev().val(f.url);wp.media.editor.send.attachment=b};wp.media.editor.open(c);return false});a(document).on("click",".remove_image_button",function(b){b.preventDefault();var c=a(this).parent().prev().attr("data-src");a(this).parent().prev().attr("src",c);a(this).prev().prev().val("");return false})})(jQuery);
1
 
2
+ (function(a){a("form :input").keyup(function(b){if(!this.reportValidity()){a(this).closest("td").addClass("form-invalid");a("#btn-save-contact").attr("disabled","disabled")}else{a("#btn-save-contact").removeAttr("disabled");a(this).closest("td").removeClass("form-invalid")}});a(".qlwapp-select2").select2({allowClear:false,theme:"default",minimumResultsForSearch:-1});a(".qlwapp-select2-ajax").each(function(){var c=a(this),b=a(this).data("name");c.select2({allowClear:true,ajax:{url:ajaxurl,dataType:"json",delay:5000,data:function(d){return{q:d.term,name:b,per_page:10,action:"qlwapp_get_posts",nonce:c.data("nonce")}},processResults:function(d){var e=[];if(d){a.each(d,function(f,g){e.push({id:g[0],text:g[1]})})}return{results:e}},cache:true},})});a(".qlwapp-color-field").wpColorPicker();a(document).on("click",".upload_image_button",function(d){d.preventDefault();var b=wp.media.editor.send.attachment,c=a(this);wp.media.editor.send.attachment=function(e,f){a(c).parent().prev().attr("src",f.url);a(c).prev().val(f.url);wp.media.editor.send.attachment=b};wp.media.editor.open(c);return false});a(document).on("click",".remove_image_button",function(b){b.preventDefault();var c=a(this).parent().prev().attr("data-src");a(this).parent().prev().attr("src",c);a(this).prev().prev().val("");return false})})(jQuery);
changelog.txt CHANGED
@@ -1,3 +1,10 @@
 
 
 
 
 
 
 
1
  = 4.3.1 =
2
  * Fix. WhatsApp Chat renamed
3
 
1
+ = 4.3.2 =
2
+ * Fix. sanitize added to ajax search post
3
+ * Fix. nonce validation added to qlwapp_dismiss_notice ajax action
4
+ * Fix. current_user_can validation added to qlwapp_dismiss_notice ajax action
5
+ * Fix. nonce validation added to qlwapp_get_posts ajax action
6
+ * Fix. current_user_can validation added to qlwapp_get_posts ajax action
7
+
8
  = 4.3.1 =
9
  * Fix. WhatsApp Chat renamed
10
 
includes/pages/display.php CHANGED
@@ -45,7 +45,7 @@
45
  <tr class="qlwapp-premium-field">
46
  <th scope="row"><?php esc_html_e(ucwords($type->label)); ?></th>
47
  <td>
48
- <select id="qlwapp_select2_<?php echo esc_attr($type->name); ?>" multiple="multiple" name="<?php echo esc_attr(QLWAPP_DOMAIN . '[display][' . $type->name . '][]'); ?>" style="width:350px" data-placeholder="<?php printf(esc_html__('Select for %s&hellip;', 'wp-whatsapp-chat'), $type->label); ?>" aria-label="<?php echo esc_attr($type->label); ?>" data-name="<?php echo esc_attr($type->name); ?>" class="<?php echo esc_attr($count->publish < 11 ? 'qlwapp-select2' : 'qlwapp-select2-ajax' ); ?>">
49
  <option value="none" <?php echo selected(true, in_array('none', (array) $qlwapp['display'][$type->name])); ?>><?php echo esc_html__('Exclude from all', 'wp-whatsapp-chat'); ?></option>
50
  <option value="archive" <?php echo selected(true, in_array('archive', (array) $qlwapp['display'][$type->name])); ?>><?php echo esc_html__('Archive', 'wp-whatsapp-chat'); ?></option>
51
  <?php
45
  <tr class="qlwapp-premium-field">
46
  <th scope="row"><?php esc_html_e(ucwords($type->label)); ?></th>
47
  <td>
48
+ <select data-nonce="<?php echo wp_create_nonce('qlwapp_get_posts'); ?>" id="qlwapp_select2_<?php echo esc_attr($type->name); ?>" multiple="multiple" name="<?php echo esc_attr(QLWAPP_DOMAIN . '[display][' . $type->name . '][]'); ?>" style="width:350px" data-placeholder="<?php printf(esc_html__('Select for %s&hellip;', 'wp-whatsapp-chat'), $type->label); ?>" aria-label="<?php echo esc_attr($type->label); ?>" data-name="<?php echo esc_attr($type->name); ?>" class="<?php echo esc_attr($count->publish < 11 ? 'qlwapp-select2' : 'qlwapp-select2-ajax' ); ?>">
49
  <option value="none" <?php echo selected(true, in_array('none', (array) $qlwapp['display'][$type->name])); ?>><?php echo esc_html__('Exclude from all', 'wp-whatsapp-chat'); ?></option>
50
  <option value="archive" <?php echo selected(true, in_array('archive', (array) $qlwapp['display'][$type->name])); ?>><?php echo esc_html__('Archive', 'wp-whatsapp-chat'); ?></option>
51
  <?php
includes/settings.php CHANGED
@@ -8,18 +8,6 @@ if (!class_exists('QLWAPP_Settings')) {
8
 
9
  protected static $instance;
10
 
11
- function ajax_dismiss_notice() {
12
-
13
- if ($notice_id = ( isset($_POST['notice_id']) ) ? sanitize_key($_POST['notice_id']) : '') {
14
-
15
- update_user_meta(get_current_user_id(), $notice_id, true);
16
-
17
- wp_send_json($notice_id);
18
- }
19
-
20
- wp_die();
21
- }
22
-
23
  function add_action_links($links) {
24
 
25
  $links[] = '<a target="_blank" href="' . QLWAPP_PURCHASE_URL . '">' . esc_html__('Premium', 'wp-whatsapp-chat') . '</a>';
@@ -31,23 +19,29 @@ if (!class_exists('QLWAPP_Settings')) {
31
 
32
  function ajax_get_posts() {
33
 
34
- $data = array(
35
- array('none', esc_html__('Exclude from all', 'wp-whatsapp-chat'))
36
- );
37
 
38
- $posts = get_posts(array(
39
- 's' => $_GET['q'],
40
- 'post_type' => $_GET['name'],
41
- 'post_status' => 'publish',
42
- 'ignore_sticky_posts' => 1,
43
- 'posts_per_page' => 10
44
- ));
45
 
46
- foreach ($posts as $post) {
47
- $data[] = array($post->post_name, mb_substr($post->post_title, 0, 49));
48
- }
49
 
50
- wp_send_json($data);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
  wp_die();
53
  }
@@ -365,53 +359,6 @@ if (!class_exists('QLWAPP_Settings')) {
365
  return $this->wp_parse_args($value, $qlwapp);
366
  }
367
 
368
- function add_notices() {
369
-
370
- if (!get_transient('qlwapp-first-rating') && !get_user_meta(get_current_user_id(), 'qlwapp-user-rating', true)) {
371
- ?>
372
- <div id="qlwapp-admin-rating" class="qlwapp-notice notice is-dismissible" data-notice_id="qlwapp-user-rating">
373
- <div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
374
- <div class="notice-image">
375
- <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); ?>>">
376
- </div>
377
- <div class="notice-content" style="margin-left: 15px;">
378
- <p>
379
- <?php printf(esc_html__('Hello! Thank you for choosing the %s plugin!', 'wp-whatsapp-chat'), QLWAPP_PLUGIN_NAME); ?>
380
- <br/>
381
- <?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'); ?>
382
- </p>
383
- <a href="<?php echo esc_url(QLWAPP_REVIEW_URL); ?>" class="button-primary" target="_blank">
384
- <?php esc_html_e('Yes, of course!', 'wp-whatsapp-chat'); ?>
385
- </a>
386
- <a href="<?php echo esc_url(QLWAPP_SUPPORT_URL); ?>" class="button-secondary" target="_blank">
387
- <?php esc_html_e('Report a bug', 'wp-whatsapp-chat'); ?>
388
- </a>
389
- </div>
390
- </div>
391
- </div>
392
- <script>
393
- (function ($) {
394
- $('.qlwapp-notice').on('click', '.notice-dismiss', function (e) {
395
- e.preventDefault();
396
- var notice_id = $(e.delegateTarget).data('notice_id');
397
- $.ajax({
398
- type: 'POST',
399
- url: ajaxurl,
400
- data: {
401
- notice_id: notice_id,
402
- action: 'qlwapp_dismiss_notice',
403
- },
404
- success: function (response) {
405
- console.log(response);
406
- },
407
- });
408
- });
409
- })(jQuery);
410
- </script>
411
- <?php
412
- }
413
- }
414
-
415
  function add_css() {
416
  ?>
417
  <style>
@@ -440,9 +387,7 @@ if (!class_exists('QLWAPP_Settings')) {
440
 
441
  function init() {
442
  add_action('wp_ajax_qlwapp_get_posts', array($this, 'ajax_get_posts'));
443
- add_action('wp_ajax_qlwapp_dismiss_notice', array($this, 'ajax_dismiss_notice'));
444
  add_action('admin_enqueue_scripts', array($this, 'add_js'));
445
- add_action('admin_notices', array($this, 'add_notices'));
446
  add_action('admin_head', array($this, 'add_css'));
447
  add_action('admin_menu', array($this, 'add_menu'));
448
  add_action('admin_init', array($this, 'add_settings_register'));
8
 
9
  protected static $instance;
10
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  function add_action_links($links) {
12
 
13
  $links[] = '<a target="_blank" href="' . QLWAPP_PURCHASE_URL . '">' . esc_html__('Premium', 'wp-whatsapp-chat') . '</a>';
19
 
20
  function ajax_get_posts() {
21
 
22
+ if (current_user_can('manage_options')) {
 
 
23
 
24
+ if (!empty($_REQUEST) && check_admin_referer('qlwapp_get_posts', 'nonce')) {
 
 
 
 
 
 
25
 
26
+ $data = array(
27
+ array('none', esc_html__('Exclude from all', 'wp-whatsapp-chat'))
28
+ );
29
 
30
+ $posts = get_posts(array(
31
+ 's' => sanitize_text_field($_REQUEST['q']),
32
+ 'post_type' => sanitize_key($_REQUEST['name']),
33
+ 'post_status' => 'publish',
34
+ 'ignore_sticky_posts' => 1,
35
+ 'posts_per_page' => 10
36
+ ));
37
+
38
+ foreach ($posts as $post) {
39
+ $data[] = array($post->post_name, mb_substr($post->post_title, 0, 49));
40
+ }
41
+
42
+ wp_send_json($data);
43
+ }
44
+ }
45
 
46
  wp_die();
47
  }
359
  return $this->wp_parse_args($value, $qlwapp);
360
  }
361
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
362
  function add_css() {
363
  ?>
364
  <style>
387
 
388
  function init() {
389
  add_action('wp_ajax_qlwapp_get_posts', array($this, 'ajax_get_posts'));
 
390
  add_action('admin_enqueue_scripts', array($this, 'add_js'));
 
391
  add_action('admin_head', array($this, 'add_css'));
392
  add_action('admin_menu', array($this, 'add_menu'));
393
  add_action('admin_init', array($this, 'add_settings_register'));
readme.txt CHANGED
@@ -5,17 +5,17 @@ Tags: whatsapp, button, chat, support, contact, click to chat, directly message
5
  Requires at least: 4.6
6
  Tested up to: 5.2
7
  Requires PHP: 5.3
8
- Stable tag: 4.3.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
- WP Social Chat WP allows your website visitors and customers to contact you or your team through WhatsApp chat with a single click.
13
 
14
  == Description ==
15
 
16
  [Premium](https://quadlayers.com/portfolio/wordpress-whatsapp-chat/) | [Demo](https://quadlayers.com/whatsapp-chat/) | [Community](https://www.facebook.com/groups/quadlayers/)
17
 
18
- WP Social Chat for WordPress allows your customers to open a conversation from your website directly to your WhatsApp phone number. This plugin includes a button where you can include a pre-filled message which will be automatically included in the conversation.
19
 
20
  == Why WhatsApp? ==
21
  WhatsApp is these days the most popular instant messaging application in the world and is available in more than 100 countries and supporting more than 50 languages.
@@ -27,17 +27,17 @@ Generating leads is the key to every business success, and the WhatsApp chat but
27
  With the WhatsApp chat button, your visitors will be allowed to send a message directly to your phone number. To start configuring it, you have to go to the button tab inside the WhatsApp chat section that you can find in your admin dashboard.
28
 
29
  Inside the button tab, you'll to switch between two different layouts, define if you want to include rounded edges, the position where you want to show the WhatsApp button, the text that will be displayed inside, the phone number and the default user message.
30
- == WP Social Chat ==
31
- WP Social Chat also allows you to include a box to show some contact information and a personalized message. This box can be activated through the Box tab inside the WhatsApp chat section and here you can define the header and footer message, contact name, phone, work, and avatar.
32
  == WhatsApp Premium ==
33
- The premium version of the WP Social Chat plugin allows you to include multiple team member agents with their names and labels inside the contact box to provide direct contact to the different support areas of your site.
34
 
35
  A new option to display a chatbox for each agent will be included. This box will be displayed when the user clicks on the WhatsApp contact, and here you can show a custom message from each contact and your users will be able to type the message that will be sent to the WhatsApp contact phone.
36
 
37
  Finally, we’ve included an option that allows you to select between more than fourteen icons to include in the WhatsApp button and full integration with the WordPress live customizer.
38
 
39
 
40
- == WP Social Chat Features ==
41
 
42
  > * WhatsApp button
43
  > * WhatsApp contact box
@@ -53,10 +53,10 @@ Finally, we’ve included an option that allows you to select between more than
53
  == Installation ==
54
 
55
  1. Go to the Plugins Menu in WordPress
56
- 2. Search for "WP Social Chat WP"
57
  3. Click "Install"
58
  4. Click "Activation"
59
- 5. Go to the WP Social Chat options in the dashboard
60
 
61
  == Frequently Asked Questions ==
62
 
@@ -70,11 +70,11 @@ You can contact us trough this channels
70
 
71
  Yes, this option is available in our premium version
72
 
73
- [WP Social Chat Premium](https://quadlayers.com/portfolio/wordpress-whatsapp-chat/)
74
 
75
- = WP Social Chat is GDPR compatible? =
76
 
77
- Yes, WP Social Chat WP don't save any personal data and don't use cookies.
78
 
79
  = Will my WhatsApp number be visible to all users? =
80
 
5
  Requires at least: 4.6
6
  Tested up to: 5.2
7
  Requires PHP: 5.3
8
+ Stable tag: 4.3.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
+ Formerly WhatsApp Chat. This plugin allows your site visitors and customers to contact you or your team through WhatsApp chat with a single click.
13
 
14
  == Description ==
15
 
16
  [Premium](https://quadlayers.com/portfolio/wordpress-whatsapp-chat/) | [Demo](https://quadlayers.com/whatsapp-chat/) | [Community](https://www.facebook.com/groups/quadlayers/)
17
 
18
+ WhatsApp Chat for WordPress allows your customers to open a conversation from your website directly to your WhatsApp phone number. This plugin includes a button where you can include a pre-filled message which will be automatically included in the conversation.
19
 
20
  == Why WhatsApp? ==
21
  WhatsApp is these days the most popular instant messaging application in the world and is available in more than 100 countries and supporting more than 50 languages.
27
  With the WhatsApp chat button, your visitors will be allowed to send a message directly to your phone number. To start configuring it, you have to go to the button tab inside the WhatsApp chat section that you can find in your admin dashboard.
28
 
29
  Inside the button tab, you'll to switch between two different layouts, define if you want to include rounded edges, the position where you want to show the WhatsApp button, the text that will be displayed inside, the phone number and the default user message.
30
+ == WhatsApp Chat ==
31
+ WhatsApp Chat also allows you to include a box to show some contact information and a personalized message. This box can be activated through the Box tab inside the WhatsApp chat section and here you can define the header and footer message, contact name, phone, work, and avatar.
32
  == WhatsApp Premium ==
33
+ The premium version of the WhatsApp Chat plugin allows you to include multiple team member agents with their names and labels inside the contact box to provide direct contact to the different support areas of your site.
34
 
35
  A new option to display a chatbox for each agent will be included. This box will be displayed when the user clicks on the WhatsApp contact, and here you can show a custom message from each contact and your users will be able to type the message that will be sent to the WhatsApp contact phone.
36
 
37
  Finally, we’ve included an option that allows you to select between more than fourteen icons to include in the WhatsApp button and full integration with the WordPress live customizer.
38
 
39
 
40
+ == WhatsApp Chat Features ==
41
 
42
  > * WhatsApp button
43
  > * WhatsApp contact box
53
  == Installation ==
54
 
55
  1. Go to the Plugins Menu in WordPress
56
+ 2. Search for "WhatsApp Chat WP"
57
  3. Click "Install"
58
  4. Click "Activation"
59
+ 5. Go to the WhatsApp Chat options in the dashboard
60
 
61
  == Frequently Asked Questions ==
62
 
70
 
71
  Yes, this option is available in our premium version
72
 
73
+ [WhatsApp Chat Premium](https://quadlayers.com/portfolio/wordpress-whatsapp-chat/)
74
 
75
+ = WhatsApp Chat is GDPR compatible? =
76
 
77
+ Yes, WhatsApp Chat WP don't save any personal data and don't use cookies.
78
 
79
  = Will my WhatsApp number be visible to all users? =
80
 
wp-whatsapp-chat.php CHANGED
@@ -2,9 +2,9 @@
2
  /**
3
  * Plugin Name: WP Social Chat
4
  * Plugin URI: https://quadlayers.com/portfolio/wordpress-whatsapp-chat/
5
- * Description: WP Social Chat allows your visitors to contact you or your team through WhatsApp chat with a single click.
6
- * Version: 4.3.1
7
- * Author: WP Social Chat
8
  * Author URI: https://quadlayers.com
9
  * License: GPL-2.0+
10
  * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
@@ -18,7 +18,7 @@ if (!defined('QLWAPP_PLUGIN_NAME')) {
18
  define('QLWAPP_PLUGIN_NAME', 'WP Social Chat');
19
  }
20
  if (!defined('QLWAPP_PLUGIN_VERSION')) {
21
- define('QLWAPP_PLUGIN_VERSION', '4.3.1');
22
  }
23
  if (!defined('QLWAPP_PLUGIN_FILE')) {
24
  define('QLWAPP_PLUGIN_FILE', __FILE__);
@@ -54,6 +54,70 @@ if (!class_exists('QLWAPP')) {
54
 
55
  protected static $instance;
56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  function includes() {
58
  include_once('includes/defaults.php');
59
  include_once('includes/frontend.php');
@@ -77,12 +141,13 @@ if (!class_exists('QLWAPP')) {
77
  }
78
  </style>
79
  <?php
80
-
81
  }
82
  }
83
 
84
  function init() {
85
  add_action('admin_footer', array($this, 'add_premium_js'));
 
 
86
  }
87
 
88
  public static function do_activation() {
2
  /**
3
  * Plugin Name: WP Social 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.3.2
7
+ * Author: QuadLayers
8
  * Author URI: https://quadlayers.com
9
  * License: GPL-2.0+
10
  * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
18
  define('QLWAPP_PLUGIN_NAME', 'WP Social Chat');
19
  }
20
  if (!defined('QLWAPP_PLUGIN_VERSION')) {
21
+ define('QLWAPP_PLUGIN_VERSION', '4.3.2');
22
  }
23
  if (!defined('QLWAPP_PLUGIN_FILE')) {
24
  define('QLWAPP_PLUGIN_FILE', __FILE__);
54
 
55
  protected static $instance;
56
 
57
+ function ajax_dismiss_notice() {
58
+ if (current_user_can('manage_options')) {
59
+
60
+ if (!empty($_REQUEST) && check_admin_referer('qlwapp_dismiss_notice', 'nonce')) {
61
+
62
+ if ($notice_id = ( isset($_REQUEST['notice_id']) ) ? sanitize_key($_REQUEST['notice_id']) : '') {
63
+
64
+ update_user_meta(get_current_user_id(), $notice_id, true);
65
+
66
+ wp_send_json($notice_id);
67
+ }
68
+ }
69
+ }
70
+ wp_die();
71
+ }
72
+
73
+ function add_notices() {
74
+
75
+ if (!get_transient('qlwapp-first-rating') && !get_user_meta(get_current_user_id(), 'qlwapp-user-rating', true)) {
76
+ ?>
77
+ <div id="qlwapp-admin-rating" class="qlwapp-notice notice is-dismissible" data-notice_id="qlwapp-user-rating">
78
+ <div class="notice-container" style="padding-top: 10px; padding-bottom: 10px; display: flex; justify-content: left; align-items: center;">
79
+ <div class="notice-image">
80
+ <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); ?>>">
81
+ </div>
82
+ <div class="notice-content" style="margin-left: 15px;">
83
+ <p>
84
+ <?php printf(esc_html__('Hello! Thank you for choosing the %s plugin!', 'wp-whatsapp-chat'), QLWAPP_PLUGIN_NAME); ?>
85
+ <br/>
86
+ <?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'); ?>
87
+ </p>
88
+ <a href="<?php echo esc_url(QLWAPP_REVIEW_URL); ?>" class="button-primary" target="_blank">
89
+ <?php esc_html_e('Yes, of course!', 'wp-whatsapp-chat'); ?>
90
+ </a>
91
+ <a href="<?php echo esc_url(QLWAPP_SUPPORT_URL); ?>" class="button-secondary" target="_blank">
92
+ <?php esc_html_e('Report a bug', 'wp-whatsapp-chat'); ?>
93
+ </a>
94
+ </div>
95
+ </div>
96
+ </div>
97
+ <script>
98
+ (function ($) {
99
+ $('.qlwapp-notice').on('click', '.notice-dismiss', function (e) {
100
+ e.preventDefault();
101
+ var notice_id = $(e.delegateTarget).data('notice_id');
102
+ $.ajax({
103
+ type: 'POST',
104
+ url: ajaxurl,
105
+ data: {
106
+ notice_id: notice_id,
107
+ action: 'qlwapp_dismiss_notice',
108
+ nonce: '<?php echo wp_create_nonce('qlwapp_dismiss_notice'); ?>'
109
+ },
110
+ success: function (response) {
111
+ console.log(response);
112
+ },
113
+ });
114
+ });
115
+ })(jQuery);
116
+ </script>
117
+ <?php
118
+ }
119
+ }
120
+
121
  function includes() {
122
  include_once('includes/defaults.php');
123
  include_once('includes/frontend.php');
141
  }
142
  </style>
143
  <?php
 
144
  }
145
  }
146
 
147
  function init() {
148
  add_action('admin_footer', array($this, 'add_premium_js'));
149
+ add_action('admin_notices', array($this, 'add_notices'));
150
+ add_action('wp_ajax_qlwapp_dismiss_notice', array($this, 'ajax_dismiss_notice'));
151
  }
152
 
153
  public static function do_activation() {