WhatsApp Chat WP - Version 2.2.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 2.2.1
Comparing to
See all releases

Code changes from version 6.2.0 to 2.2.1

Files changed (3) hide show
  1. includes/frontend.php +42 -54
  2. readme.txt +5 -2
  3. wp-whatsapp-chat.php +2 -3
includes/frontend.php CHANGED
@@ -1,24 +1,20 @@
1
  <?php
2
- if (!class_exists('QLWAPP_Frontend')) {
3
 
4
- class QLWAPP_Frontend
5
- {
6
 
7
  protected static $instance;
8
 
9
- function add_js()
10
- {
11
  $frontend = include_once QLWAPP_PLUGIN_DIR . 'build/frontend/js/index.asset.php';
12
- wp_enqueue_style(QLWAPP_DOMAIN, plugins_url('/build/frontend/css/style.css', QLWAPP_PLUGIN_FILE), null, QLWAPP_PLUGIN_VERSION, 'all');
13
- wp_enqueue_script(QLWAPP_DOMAIN, plugins_url('/build/frontend/js/index.js', QLWAPP_PLUGIN_FILE), $frontend['dependencies'], $frontend['version'], true);
14
-
15
  }
16
 
17
- function add_box()
18
- {
19
  global $qlwapp;
20
 
21
- if (is_file($file = apply_filters('qlwapp_box_template', QLWAPP_PLUGIN_DIR . 'template/box.php'))) {
22
  include_once QLWAPP_PLUGIN_DIR . 'includes/models/Box.php';
23
  include_once QLWAPP_PLUGIN_DIR . 'includes/models/Contact.php';
24
  include_once QLWAPP_PLUGIN_DIR . 'includes/models/Display.php';
@@ -39,70 +35,65 @@ if (!class_exists('QLWAPP_Frontend')) {
39
  }
40
  }
41
 
42
- function add_frontend_css()
43
- {
44
  $scheme_model = new QLWAPP_Scheme();
45
  $scheme = $scheme_model->get();
46
- ?>
47
  <style>
48
  :root {
49
  <?php
50
 
51
- unset($scheme['_wp_http_referer']);
52
- unset($scheme['_scheme_form_nonce']);
53
- foreach ($scheme as $key => $value) {
54
- if ($value != '') {
55
- if (is_numeric($value)) {
56
  $value = "{$value}px";
57
  }
58
- printf('--%s-scheme-%s:%s;', QLWAPP_DOMAIN, esc_attr($key), esc_attr($value));
59
  }
60
  }
61
  ?>
62
  }
63
  </style>
64
- <?php
65
  }
66
 
67
-
68
- function box_display1($show)
69
- {
70
  global $wp_query;
71
  $display_model = new QLWAPP_Display();
72
  $display = $display_model->get();
73
- if (is_customize_preview()) {
74
  return true;
75
  }
76
  $display_service = new QLWAPP_DisplayServices_Controller();
77
- return $display_service->is_show_view($display);
78
  }
79
 
80
- function do_shortcode($atts, $content = null)
81
- {
82
  $button_model = new QLWAPP_Button();
83
  $button = $button_model->get();
84
 
85
- $atts = wp_parse_args($atts, $button);
86
 
87
  ob_start();
88
- ?>
89
- <div style="width: auto;" id="qlwapp" class="qlwapp-js-ready <?php printf('qlwapp-%s qlwapp-%s', esc_attr($atts['layout']), esc_attr($atts['rounded'] === 'yes' ? 'rounded' : 'square')); ?>">
90
- <a class="qlwapp-toggle" data-action="open" data-phone="<?php echo esc_attr($atts['phone']); ?>" data-message="<?php echo esc_html($atts['message']); ?>" href="#" target="_blank">
91
- <?php if ($atts['icon']) : ?>
92
- <i class="qlwapp-icon <?php echo esc_attr($atts['icon']); ?>"></i>
93
  <?php endif; ?>
94
  <i class="qlwapp-close" data-action="close">&times;</i>
95
- <?php if ($atts['text']) : ?>
96
- <span class="qlwapp-text"><?php echo esc_html($content); ?></span>
97
  <?php endif; ?>
98
  </a>
99
  </div>
100
- <?php
101
  return ob_get_clean();
102
  }
103
 
104
- function display()
105
- {
106
  include_once QLWAPP_PLUGIN_DIR . 'includes/models/QLWAPP_Model.php';
107
  include_once QLWAPP_PLUGIN_DIR . 'includes/models/Display.php';
108
  include_once QLWAPP_PLUGIN_DIR . 'includes/controllers/Display_services.php';
@@ -110,29 +101,26 @@ if (!class_exists('QLWAPP_Frontend')) {
110
  $display = $display_model->get();
111
  $display_service = new QLWAPP_DisplayServices_Controller();
112
 
113
- if ($display_service->is_show_view($display)) {
114
 
115
- do_action('qlwapp_load');
116
  }
117
  }
118
 
119
- function load()
120
- {
121
- add_action('wp_enqueue_scripts', array($this, 'add_js'));
122
- add_action('wp_head', array($this, 'add_frontend_css'), 200);
123
- add_action('wp_footer', array($this, 'add_box'));
124
  }
125
 
126
- function init()
127
- {
128
- add_action('wp', array($this, 'display'));
129
- add_shortcode('whatsapp', array($this, 'do_shortcode'));
130
- add_action('qlwapp_load', array($this, 'load'));
131
  }
132
 
133
- public static function instance()
134
- {
135
- if (!isset(self::$instance)) {
136
  self::$instance = new self();
137
  self::$instance->init();
138
  }
1
  <?php
2
+ if ( ! class_exists( 'QLWAPP_Frontend' ) ) {
3
 
4
+ class QLWAPP_Frontend {
 
5
 
6
  protected static $instance;
7
 
8
+ function add_js() {
 
9
  $frontend = include_once QLWAPP_PLUGIN_DIR . 'build/frontend/js/index.asset.php';
10
+ wp_enqueue_style( QLWAPP_DOMAIN, plugins_url( '/build/frontend/css/style.css', QLWAPP_PLUGIN_FILE ), null, QLWAPP_PLUGIN_VERSION, 'all' );
11
+ wp_enqueue_script( QLWAPP_DOMAIN, plugins_url( '/build/frontend/js/index.js', QLWAPP_PLUGIN_FILE ), $frontend['dependencies'], $frontend['version'], true );
 
12
  }
13
 
14
+ function add_box() {
 
15
  global $qlwapp;
16
 
17
+ if ( is_file( $file = apply_filters( 'qlwapp_box_template', QLWAPP_PLUGIN_DIR . 'template/box.php' ) ) ) {
18
  include_once QLWAPP_PLUGIN_DIR . 'includes/models/Box.php';
19
  include_once QLWAPP_PLUGIN_DIR . 'includes/models/Contact.php';
20
  include_once QLWAPP_PLUGIN_DIR . 'includes/models/Display.php';
35
  }
36
  }
37
 
38
+ function add_frontend_css() {
 
39
  $scheme_model = new QLWAPP_Scheme();
40
  $scheme = $scheme_model->get();
41
+ ?>
42
  <style>
43
  :root {
44
  <?php
45
 
46
+ unset( $scheme['_wp_http_referer'] );
47
+ unset( $scheme['_scheme_form_nonce'] );
48
+ foreach ( $scheme as $key => $value ) {
49
+ if ( $value != '' ) {
50
+ if ( is_numeric( $value ) ) {
51
  $value = "{$value}px";
52
  }
53
+ printf( '--%s-scheme-%s:%s;', QLWAPP_DOMAIN, esc_attr( $key ), esc_attr( $value ) );
54
  }
55
  }
56
  ?>
57
  }
58
  </style>
59
+ <?php
60
  }
61
 
62
+ function box_display1( $show ) {
 
 
63
  global $wp_query;
64
  $display_model = new QLWAPP_Display();
65
  $display = $display_model->get();
66
+ if ( is_customize_preview() ) {
67
  return true;
68
  }
69
  $display_service = new QLWAPP_DisplayServices_Controller();
70
+ return $display_service->is_show_view( $display );
71
  }
72
 
73
+ function do_shortcode( $atts, $content = null ) {
 
74
  $button_model = new QLWAPP_Button();
75
  $button = $button_model->get();
76
 
77
+ $atts = wp_parse_args( $atts, $button );
78
 
79
  ob_start();
80
+ ?>
81
+ <div style="width: auto;" id="qlwapp" class="qlwapp-js-ready <?php printf( 'qlwapp-%s qlwapp-%s', esc_attr( $atts['layout'] ), esc_attr( $atts['rounded'] === 'yes' ? 'rounded' : 'square' ) ); ?>">
82
+ <a class="qlwapp-toggle" data-action="open" data-phone="<?php echo esc_attr( $atts['phone'] ); ?>" data-message="<?php echo esc_html( $atts['message'] ); ?>" href="#" target="_blank">
83
+ <?php if ( $atts['icon'] ) : ?>
84
+ <i class="qlwapp-icon <?php echo esc_attr( $atts['icon'] ); ?>"></i>
85
  <?php endif; ?>
86
  <i class="qlwapp-close" data-action="close">&times;</i>
87
+ <?php if ( $atts['text'] ) : ?>
88
+ <span class="qlwapp-text"><?php echo esc_html( $content ); ?></span>
89
  <?php endif; ?>
90
  </a>
91
  </div>
92
+ <?php
93
  return ob_get_clean();
94
  }
95
 
96
+ function display() {
 
97
  include_once QLWAPP_PLUGIN_DIR . 'includes/models/QLWAPP_Model.php';
98
  include_once QLWAPP_PLUGIN_DIR . 'includes/models/Display.php';
99
  include_once QLWAPP_PLUGIN_DIR . 'includes/controllers/Display_services.php';
101
  $display = $display_model->get();
102
  $display_service = new QLWAPP_DisplayServices_Controller();
103
 
104
+ if ( $display_service->is_show_view( $display ) ) {
105
 
106
+ do_action( 'qlwapp_load' );
107
  }
108
  }
109
 
110
+ function load() {
111
+ add_action( 'wp_enqueue_scripts', array( $this, 'add_js' ) );
112
+ add_action( 'wp_head', array( $this, 'add_frontend_css' ), 200 );
113
+ add_action( 'wp_footer', array( $this, 'add_box' ) );
 
114
  }
115
 
116
+ function init() {
117
+ add_action( 'wp', array( $this, 'display' ) );
118
+ add_shortcode( 'whatsapp', array( $this, 'do_shortcode' ) );
119
+ add_action( 'qlwapp_load', array( $this, 'load' ) );
 
120
  }
121
 
122
+ public static function instance() {
123
+ if ( ! isset( self::$instance ) ) {
 
124
  self::$instance = new self();
125
  self::$instance->init();
126
  }
readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: https://quadlayers.com/portfolio/whatsapp-chat/
4
  Tags: whatsapp, whatsapp business, click to chat, whatsapp chat, woocommerce whatsapp, whatsapp support, whatsapp group, whatsapp message, whatsapp woocommerce, whatsapp wordpress, whatsapp floating button, whatsapp icon, whats app, wame, wp social chat, join chat, wp whatsapp
5
  Requires at least: 4.6
6
  Requires PHP: 5.6
7
- Tested up to: 6.0
8
- Stable tag: 6.2.0
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -135,6 +135,9 @@ Don't use: +001-(555)1234567
135
 
136
  == Changelog ==
137
 
 
 
 
138
  = 6.2.0 =
139
  * Fix. WhatsApp box auto open
140
 
4
  Tags: whatsapp, whatsapp business, click to chat, whatsapp chat, woocommerce whatsapp, whatsapp support, whatsapp group, whatsapp message, whatsapp woocommerce, whatsapp wordpress, whatsapp floating button, whatsapp icon, whats app, wame, wp social chat, join chat, wp whatsapp
5
  Requires at least: 4.6
6
  Requires PHP: 5.6
7
+ Tested up to: 6.1
8
+ Stable tag: 6.2.1
9
  License: GPLv3
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
135
 
136
  == Changelog ==
137
 
138
+ = 6.2.1 =
139
+ * Fix. WordPress compatibility
140
+
141
  = 6.2.0 =
142
  * Fix. WhatsApp box auto open
143
 
wp-whatsapp-chat.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Social Chat
5
  * Description: Social Chat allows your visitors to contact you or your team through WhatsApp chat with a single click.
6
  * Plugin URI: https://quadlayers.com/portfolio/whatsapp-chat/
7
- * Version: 6.2.0
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPLv3
@@ -18,7 +18,7 @@ if ( ! defined( 'ABSPATH' ) ) {
18
  }
19
 
20
  define( 'QLWAPP_PLUGIN_NAME', 'Social Chat' );
21
- define( 'QLWAPP_PLUGIN_VERSION', '6.2.0' );
22
  define( 'QLWAPP_PLUGIN_FILE', __FILE__ );
23
  define( 'QLWAPP_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR );
24
  define( 'QLWAPP_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
@@ -46,7 +46,6 @@ define( 'QLWAPP_CROSS_INSTALL_URL', 'https://quadlayers.com/portfolio/instagram-
46
  if ( ! class_exists( 'QLWAPP' ) ) {
47
  include_once QLWAPP_PLUGIN_DIR . 'includes/qlwapp.php';
48
  }
49
- // compability
50
 
51
  require_once QLWAPP_PLUGIN_DIR . 'compatibility/compatibility.php';
52
  require_once QLWAPP_PLUGIN_DIR . 'includes/quadlayers/widget.php';
4
  * Plugin Name: Social Chat
5
  * Description: Social Chat allows your visitors to contact you or your team through WhatsApp chat with a single click.
6
  * Plugin URI: https://quadlayers.com/portfolio/whatsapp-chat/
7
+ * Version: 6.2.1
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPLv3
18
  }
19
 
20
  define( 'QLWAPP_PLUGIN_NAME', 'Social Chat' );
21
+ define( 'QLWAPP_PLUGIN_VERSION', '6.2.1' );
22
  define( 'QLWAPP_PLUGIN_FILE', __FILE__ );
23
  define( 'QLWAPP_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR );
24
  define( 'QLWAPP_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
46
  if ( ! class_exists( 'QLWAPP' ) ) {
47
  include_once QLWAPP_PLUGIN_DIR . 'includes/qlwapp.php';
48
  }
 
49
 
50
  require_once QLWAPP_PLUGIN_DIR . 'compatibility/compatibility.php';
51
  require_once QLWAPP_PLUGIN_DIR . 'includes/quadlayers/widget.php';