Click to Chat for WhatsApp Chat - Version 3.3.4

Version Description

  • Display Settings for WooCommerce Cart, Checkout, Account, Shop page
  • Enchantment: WhatsApp Number field
Download this release

Release Info

Developer bhvreddy
Plugin Icon 128x128 Click to Chat for WhatsApp Chat
Version 3.3.4
Comparing to
See all releases

Code changes from version 3.3.3 to 3.3.4

click-to-chat.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Click to Chat
4
  Plugin URI: https://wordpress.org/plugins/click-to-chat-for-whatsapp/
5
  Description: Lets make your Web page visitors contact you through WhatsApp with a single click/tap
6
- Version: 3.3.3
7
  Author: HoliThemes
8
  Author URI: https://holithemes.com/plugins/click-to-chat/
9
  License: GPL2
@@ -17,7 +17,7 @@ if ( ! defined( 'WPINC' ) ) {
17
 
18
  // ctc - Version - update version at readme 'Stable tag'
19
  if ( ! defined( 'HT_CTC_VERSION' ) ) {
20
- define( 'HT_CTC_VERSION', '3.3.3' );
21
  }
22
 
23
  // define HT_CTC_PLUGIN_FILE
3
  Plugin Name: Click to Chat
4
  Plugin URI: https://wordpress.org/plugins/click-to-chat-for-whatsapp/
5
  Description: Lets make your Web page visitors contact you through WhatsApp with a single click/tap
6
+ Version: 3.3.4
7
  Author: HoliThemes
8
  Author URI: https://holithemes.com/plugins/click-to-chat/
9
  License: GPL2
17
 
18
  // ctc - Version - update version at readme 'Stable tag'
19
  if ( ! defined( 'HT_CTC_VERSION' ) ) {
20
+ define( 'HT_CTC_VERSION', '3.3.4' );
21
  }
22
 
23
  // define HT_CTC_PLUGIN_FILE
new/admin/admin_assets/js/333.admin.js CHANGED
@@ -163,6 +163,8 @@ document.addEventListener('DOMContentLoaded', function () {
163
 
164
  var cc = $("#whatsapp_cc").val();
165
  var num = $("#whatsapp_number").val();
 
 
166
 
167
  $("#whatsapp_cc").on("change paste keyup", function (e) {
168
  cc = $("#whatsapp_cc").val();
@@ -171,12 +173,13 @@ document.addEventListener('DOMContentLoaded', function () {
171
 
172
  $("#whatsapp_number").on("change paste keyup", function (e) {
173
  num = $("#whatsapp_number").val();
 
174
  call();
175
  });
176
 
177
  function call() {
178
  $(".ht_ctc_wn").html(cc + '' + num);
179
- $("#ctc_whatsapp_number").val(cc + '' + num);
180
  }
181
 
182
  }
163
 
164
  var cc = $("#whatsapp_cc").val();
165
  var num = $("#whatsapp_number").val();
166
+ var num2 = num;
167
+
168
 
169
  $("#whatsapp_cc").on("change paste keyup", function (e) {
170
  cc = $("#whatsapp_cc").val();
173
 
174
  $("#whatsapp_number").on("change paste keyup", function (e) {
175
  num = $("#whatsapp_number").val();
176
+ num2 = num.replace(/^0+/, '');
177
  call();
178
  });
179
 
180
  function call() {
181
  $(".ht_ctc_wn").html(cc + '' + num);
182
+ $("#ctc_whatsapp_number").val(cc + '' + num2);
183
  }
184
 
185
  }
new/admin/admin_assets/js/admin.js CHANGED
@@ -163,6 +163,8 @@ document.addEventListener('DOMContentLoaded', function () {
163
 
164
  var cc = $("#whatsapp_cc").val();
165
  var num = $("#whatsapp_number").val();
 
 
166
 
167
  $("#whatsapp_cc").on("change paste keyup", function (e) {
168
  cc = $("#whatsapp_cc").val();
@@ -171,12 +173,13 @@ document.addEventListener('DOMContentLoaded', function () {
171
 
172
  $("#whatsapp_number").on("change paste keyup", function (e) {
173
  num = $("#whatsapp_number").val();
 
174
  call();
175
  });
176
 
177
  function call() {
178
  $(".ht_ctc_wn").html(cc + '' + num);
179
- $("#ctc_whatsapp_number").val(cc + '' + num);
180
  }
181
 
182
  }
163
 
164
  var cc = $("#whatsapp_cc").val();
165
  var num = $("#whatsapp_number").val();
166
+ var num2 = num;
167
+
168
 
169
  $("#whatsapp_cc").on("change paste keyup", function (e) {
170
  cc = $("#whatsapp_cc").val();
173
 
174
  $("#whatsapp_number").on("change paste keyup", function (e) {
175
  num = $("#whatsapp_number").val();
176
+ num2 = num.replace(/^0+/, '');
177
  call();
178
  });
179
 
180
  function call() {
181
  $(".ht_ctc_wn").html(cc + '' + num);
182
+ $("#ctc_whatsapp_number").val(cc + '' + num2);
183
  }
184
 
185
  }
new/admin/admin_commons/admin-device-settings.php CHANGED
@@ -133,7 +133,7 @@ if ( isset( $options['same_settings'] ) ) {
133
 
134
  ?>
135
 
136
- <blockquote class="not_samesettings " style="margin-bottom: 25px;">Mobile:</blockquote>
137
 
138
  <!-- style -->
139
  <p class="description ht_ctc_admin_mobile ht_ctc_subtitle not_samesettings"><?php _e( 'Select Style (Mobile)', 'click-to-chat-for-whatsapp' ); ?>:</p class="description">
133
 
134
  ?>
135
 
136
+ <blockquote class="not_samesettings " style="margin-bottom: 25px;"><?php _e( 'Mobile', 'click-to-chat-for-whatsapp' ); ?>:</blockquote>
137
 
138
  <!-- style -->
139
  <p class="description ht_ctc_admin_mobile ht_ctc_subtitle not_samesettings"><?php _e( 'Select Style (Mobile)', 'click-to-chat-for-whatsapp' ); ?>:</p class="description">
new/admin/admin_commons/admin-show-hide.php CHANGED
@@ -40,10 +40,14 @@ $show_hide_settings = array(
40
  // 'Post Types' => '',
41
  );
42
 
43
- // woo single product page
44
  if ( class_exists( 'WooCommerce' ) ) {
45
  $show_hide_settings['WooCommerce'] = '';
46
  $show_hide_settings['woo_product'] = 'Single Product pages';
 
 
 
 
47
  }
48
 
49
  // custom post types
@@ -150,7 +154,7 @@ $display_mobile = (isset($options['display_mobile'])) ? esc_attr( $options['disp
150
 
151
  <br>
152
 
153
- <p class="description" style="margin:16px 0px 20px 0px;"><strong>Override the Global settings</strong></p>
154
  <?php
155
 
156
  foreach ($show_hide_settings as $key => $value) {
40
  // 'Post Types' => '',
41
  );
42
 
43
+ // woocommerce
44
  if ( class_exists( 'WooCommerce' ) ) {
45
  $show_hide_settings['WooCommerce'] = '';
46
  $show_hide_settings['woo_product'] = 'Single Product pages';
47
+ $show_hide_settings['woo_shop'] = 'Shop (Product Archive page)';
48
+ $show_hide_settings['woo_cart'] = 'Cart page';
49
+ $show_hide_settings['woo_checkout'] = 'Checkout page';
50
+ $show_hide_settings['woo_account'] = 'Account page';
51
  }
52
 
53
  // custom post types
154
 
155
  <br>
156
 
157
+ <p class="description" style="margin:16px 0px 20px 0px;"><strong><?php _e( 'Override the Global settings', 'click-to-chat-for-whatsapp' ); ?></strong></p>
158
  <?php
159
 
160
  foreach ($show_hide_settings as $key => $value) {
new/admin/class-ht-ctc-admin-main-page.php CHANGED
@@ -332,6 +332,9 @@ class HT_CTC_Admin_Main_Page {
332
 
333
  if ( 'pre_filled' == $key || 'woo_pre_filled' == $key ) {
334
  // $new_input[$key] = esc_textarea( $input[$key] );
 
 
 
335
  $new_input[$key] = sanitize_textarea_field( $input[$key] );
336
  } elseif ( 'side_1_value' == $key || 'side_2_value' == $key || 'mobile_side_1_value' == $key || 'mobile_side_2_value' == $key ) {
337
  $input[$key] = str_replace( ' ', '', $input[$key] );
332
 
333
  if ( 'pre_filled' == $key || 'woo_pre_filled' == $key ) {
334
  // $new_input[$key] = esc_textarea( $input[$key] );
335
+ // if (function_exists('wp_encode_emoji')) {
336
+ // $input[$key] = wp_encode_emoji( $input[$key] );
337
+ // }
338
  $new_input[$key] = sanitize_textarea_field( $input[$key] );
339
  } elseif ( 'side_1_value' == $key || 'side_2_value' == $key || 'mobile_side_1_value' == $key || 'mobile_side_2_value' == $key ) {
340
  $input[$key] = str_replace( ' ', '', $input[$key] );
new/admin/class-ht-ctc-admin-other-settings.php CHANGED
@@ -96,7 +96,7 @@ class HT_CTC_Admin_Other_Settings {
96
  ?>
97
  <ul class="collapsible" data-collapsible="accordion" id="ht_ctc_analytics">
98
  <li class="active">
99
- <div class="collapsible-header"><?php _e( 'Google Analytics, Facebook Pixel', 'click-to-chat-for-whatsapp' ); ?></div>
100
  <div class="collapsible-body">
101
 
102
  <?php
@@ -224,9 +224,7 @@ class HT_CTC_Admin_Other_Settings {
224
  <div class="collapsible-header"><?php _e( 'Webhooks', 'click-to-chat-for-whatsapp' ); ?></div>
225
  <div class="collapsible-body">
226
 
227
- <p class="description" style="margin-bottom: 20px;">Integarte, Automation using Webhooks.</p>
228
- <p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/webhooks/"><?php _e( 'Webhooks', 'click-to-chat-for-whatsapp' ); ?></a></p>
229
- <br><br><br>
230
 
231
  <!-- Webhook URL -->
232
  <div class="row">
96
  ?>
97
  <ul class="collapsible" data-collapsible="accordion" id="ht_ctc_analytics">
98
  <li class="active">
99
+ <div class="collapsible-header"><?php _e( 'Google Analytics, Facebook Pixel, Google Ads Conversion', 'click-to-chat-for-whatsapp' ); ?></div>
100
  <div class="collapsible-body">
101
 
102
  <?php
224
  <div class="collapsible-header"><?php _e( 'Webhooks', 'click-to-chat-for-whatsapp' ); ?></div>
225
  <div class="collapsible-body">
226
 
227
+ <p class="description" style="margin-bottom: 40px;"><?php _e( 'Integarte, Automation', 'click-to-chat-for-whatsapp' ); ?> <?php _e( 'using', 'click-to-chat-for-whatsapp' ); ?> <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/webhooks/"><?php _e( 'Webhooks', 'click-to-chat-for-whatsapp' ); ?></a></p>
 
 
228
 
229
  <!-- Webhook URL -->
230
  <div class="row">
new/inc/commons/show-hide.php CHANGED
@@ -82,14 +82,37 @@ if ( 'hide' == $show_or_hide ) {
82
  }
83
  }
84
 
85
- // woocommerce single product pages.
86
- if ( class_exists( 'WooCommerce' ) && function_exists( 'is_product' ) ) {
87
- if ( is_product() ) {
 
88
  if ( isset( $display_settings['woo_product'] ) && 'show' == $display_settings['woo_product'] ) {
89
  $display = 'yes';
90
  return;
91
  }
92
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  }
94
 
95
  // based on post id's
@@ -129,6 +152,16 @@ if ( 'hide' == $show_or_hide ) {
129
  } elseif ( is_archive() ) {
130
  // loop posts
131
 
 
 
 
 
 
 
 
 
 
 
132
  // category
133
  if ( is_category() ) {
134
  if ( isset( $display_settings['category'] ) && 'show' == $display_settings['category'] ) {
@@ -209,14 +242,37 @@ if ( 'hide' == $show_or_hide ) {
209
  }
210
  }
211
 
212
- // woocommerce single product pages.
213
- if ( class_exists( 'WooCommerce' ) && function_exists( 'is_product' ) ) {
214
- if ( is_product() ) {
 
215
  if ( isset( $display_settings['woo_product'] ) && 'hide' == $display_settings['woo_product'] ) {
216
  $display = 'no';
217
  return;
218
  }
219
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  }
221
 
222
 
@@ -263,6 +319,16 @@ if ( 'hide' == $show_or_hide ) {
263
  } elseif ( is_archive() ) {
264
  // loop posts
265
 
 
 
 
 
 
 
 
 
 
 
266
  // category
267
  if ( is_category() ) {
268
  if ( isset( $display_settings['category'] ) && 'hide' == $display_settings['category'] ) {
82
  }
83
  }
84
 
85
+ // woocommerce (shop page is at archive)
86
+ if ( class_exists( 'WooCommerce' ) ) {
87
+
88
+ if ( function_exists( 'is_product' ) && is_product() ) {
89
  if ( isset( $display_settings['woo_product'] ) && 'show' == $display_settings['woo_product'] ) {
90
  $display = 'yes';
91
  return;
92
  }
93
  }
94
+
95
+ if ( function_exists( 'is_cart' ) && is_cart() ) {
96
+ if ( isset( $display_settings['woo_cart'] ) && 'show' == $display_settings['woo_cart'] ) {
97
+ $display = 'yes';
98
+ return;
99
+ }
100
+ }
101
+
102
+ if ( function_exists( 'is_checkout' ) && is_checkout() ) {
103
+ if ( isset( $display_settings['woo_checkout'] ) && 'show' == $display_settings['woo_checkout'] ) {
104
+ $display = 'yes';
105
+ return;
106
+ }
107
+ }
108
+
109
+ if ( function_exists( 'is_account_page' ) && is_account_page() ) {
110
+ if ( isset( $display_settings['woo_account'] ) && 'show' == $display_settings['woo_account'] ) {
111
+ $display = 'yes';
112
+ return;
113
+ }
114
+ }
115
+
116
  }
117
 
118
  // based on post id's
152
  } elseif ( is_archive() ) {
153
  // loop posts
154
 
155
+ // woocommerce shop - archive
156
+ if ( class_exists( 'WooCommerce' ) ) {
157
+ if ( function_exists( 'is_shop' ) && is_shop() ) {
158
+ if ( isset( $display_settings['woo_shop'] ) && 'show' == $display_settings['woo_shop'] ) {
159
+ $display = 'yes';
160
+ return;
161
+ }
162
+ }
163
+ }
164
+
165
  // category
166
  if ( is_category() ) {
167
  if ( isset( $display_settings['category'] ) && 'show' == $display_settings['category'] ) {
242
  }
243
  }
244
 
245
+ // woocommerce (shop page is at archive)
246
+ if ( class_exists( 'WooCommerce' ) ) {
247
+
248
+ if ( function_exists( 'is_product' ) && is_product() ) {
249
  if ( isset( $display_settings['woo_product'] ) && 'hide' == $display_settings['woo_product'] ) {
250
  $display = 'no';
251
  return;
252
  }
253
  }
254
+
255
+ if ( function_exists( 'is_cart' ) && is_cart() ) {
256
+ if ( isset( $display_settings['woo_cart'] ) && 'hide' == $display_settings['woo_cart'] ) {
257
+ $display = 'no';
258
+ return;
259
+ }
260
+ }
261
+
262
+ if ( function_exists( 'is_checkout' ) && is_checkout() ) {
263
+ if ( isset( $display_settings['woo_checkout'] ) && 'hide' == $display_settings['woo_checkout'] ) {
264
+ $display = 'no';
265
+ return;
266
+ }
267
+ }
268
+
269
+ if ( function_exists( 'is_account_page' ) && is_account_page() ) {
270
+ if ( isset( $display_settings['woo_account'] ) && 'hide' == $display_settings['woo_account'] ) {
271
+ $display = 'no';
272
+ return;
273
+ }
274
+ }
275
+
276
  }
277
 
278
 
319
  } elseif ( is_archive() ) {
320
  // loop posts
321
 
322
+ // woocommerce shop - archive
323
+ if ( class_exists( 'WooCommerce' ) ) {
324
+ if ( function_exists( 'is_shop' ) && is_shop() ) {
325
+ if ( isset( $display_settings['woo_shop'] ) && 'hide' == $display_settings['woo_shop'] ) {
326
+ $display = 'no';
327
+ return;
328
+ }
329
+ }
330
+ }
331
+
332
  // category
333
  if ( is_category() ) {
334
  if ( isset( $display_settings['category'] ) && 'hide' == $display_settings['category'] ) {
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Click to Chat ===
2
  Requires at least: 4.6
3
- Tested up to: 5.7.2
4
  Requires PHP: 5.6
5
  Contributors: holithemes
6
- Stable tag: 3.3.3
7
  Tags: whatsapp, whatsapp business, click to chat, whatsapp chat, whatsapp support, whatsapp group, whatsapp message, social chat, whatsapp wordpress, whatsapp floating button, whatsapp icon, holithemes
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -115,10 +115,12 @@ Creates an Event when the user clicks on the WhatsApp Icon/button.
115
 
116
  [Google Ads Conversations](https://holithemes.com/plugins/click-to-chat/google-ads-conversion/?utm_source=wp&utm_medium=readme&utm_campaign=ht)
117
 
118
- = [Webhooks](https://holithemes.com/plugins/click-to-chat/webhooks) =
119
 
120
  Connect other applications using Integarate, Automation tools like Zapier, IFTTT, Pipedream
121
 
 
 
122
  = 🔆 Localization =
123
 
124
  Click to Chat is Compatible with [WPML](https://wpml.org/), Polylang.
@@ -196,19 +198,19 @@ i.e. if position is set to right: 10px then plugin will display at left: 10px
196
 
197
  1. 8 Styles, 1 Add own image / GIF Style
198
  1. Chat Settings - Enter WhatsApp Number, prefilled message, call to action, desktop: web view / desktop app view
199
- 1. Desktop settings - style, position to place (at any position of the screen)
200
- 1. Mobile settings - style, position to place (at any position of the screen)
201
  1. Change Values at page level: 'WhatsApp Number', 'Call to action', 'Group ID'
202
  1. Shortcodes - add style with inline the content
203
  1. Style - 5 - Image with content box
204
  1. Style - 8 - Materialize button
205
  1. Style - 99 - Add your own Image / GIF(Animated Image)
206
  1. Customize Styles
207
- 1. Enable Chat, Group, Share Settings
208
  1. Group settings page
209
  1. Share settings page
210
- 1. Hide on Selected pages
211
- 1. Show on Selected pages
212
  1. prefilled, call to action for WooCommerce single product pages
213
  1. Animations
214
  1. Analytics - Google analytics, Facebook Pixel, Google Ads Conversations
@@ -423,6 +425,10 @@ After Activate the plugin, add WhatsApp Number at plugin settings.
423
 
424
  == Changelog ==
425
 
 
 
 
 
426
  = 3.3.3 =
427
  * User Interface: Display settings
428
  * New: Display settings for custom post types
1
  === Click to Chat ===
2
  Requires at least: 4.6
3
+ Tested up to: 5.8
4
  Requires PHP: 5.6
5
  Contributors: holithemes
6
+ Stable tag: 3.3.4
7
  Tags: whatsapp, whatsapp business, click to chat, whatsapp chat, whatsapp support, whatsapp group, whatsapp message, social chat, whatsapp wordpress, whatsapp floating button, whatsapp icon, holithemes
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
115
 
116
  [Google Ads Conversations](https://holithemes.com/plugins/click-to-chat/google-ads-conversion/?utm_source=wp&utm_medium=readme&utm_campaign=ht)
117
 
118
+ = Webhooks =
119
 
120
  Connect other applications using Integarate, Automation tools like Zapier, IFTTT, Pipedream
121
 
122
+ [Webhooks](https://holithemes.com/plugins/click-to-chat/webhooks)
123
+
124
  = 🔆 Localization =
125
 
126
  Click to Chat is Compatible with [WPML](https://wpml.org/), Polylang.
198
 
199
  1. 8 Styles, 1 Add own image / GIF Style
200
  1. Chat Settings - Enter WhatsApp Number, prefilled message, call to action, desktop: web view / desktop app view
201
+ 1. Style, position to place (at any position of the screen) - Desktop, Mobile
202
+ 1. Add WhatsApp Menu item (Custom Element)
203
  1. Change Values at page level: 'WhatsApp Number', 'Call to action', 'Group ID'
204
  1. Shortcodes - add style with inline the content
205
  1. Style - 5 - Image with content box
206
  1. Style - 8 - Materialize button
207
  1. Style - 99 - Add your own Image / GIF(Animated Image)
208
  1. Customize Styles
209
+ 1. Enable Group, Share Settings
210
  1. Group settings page
211
  1. Share settings page
212
+ 1. Display settings
213
+ 1. Webhooks
214
  1. prefilled, call to action for WooCommerce single product pages
215
  1. Animations
216
  1. Analytics - Google analytics, Facebook Pixel, Google Ads Conversations
425
 
426
  == Changelog ==
427
 
428
+ = 3.3.4 =
429
+ * Display Settings for WooCommerce Cart, Checkout, Account, Shop page
430
+ * Enchantment: WhatsApp Number field
431
+
432
  = 3.3.3 =
433
  * User Interface: Display settings
434
  * New: Display settings for custom post types