Click to Chat for WhatsApp Chat - Version 3.8.1

Version Description

  • Enchantment: Pre-filled message, Call to Action settings
Download this release

Release Info

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

Code changes from version 3.8 to 3.8.1

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.8
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.8' );
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.8.1
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.8.1' );
21
  }
22
 
23
  // define HT_CTC_PLUGIN_FILE
new/admin/admin_commons/class-ht-ctc-admin-hooks.php CHANGED
@@ -416,10 +416,13 @@ class HT_CTC_Admin_Others {
416
  Cache_Enabler::clear_total_cache();
417
  // ce_clear_cache();
418
  }
419
- // Pagely
420
- if ( class_exists('PagelyCachePurge') && method_exists('PagelyCachePurge','purgeAll') ) {
421
- PagelyCachePurge::purgeAll();
422
- }
 
 
 
423
  // Comet cache
424
  if( class_exists('comet_cache') && method_exists('comet_cache', 'clear') ) {
425
  comet_cache::clear();
416
  Cache_Enabler::clear_total_cache();
417
  // ce_clear_cache();
418
  }
419
+
420
+ // // Pagely
421
+ // if ( class_exists('PagelyCachePurge') && method_exists('PagelyCachePurge','purgeAll') ) {
422
+ // https://wordpress.org/support/topic/the-plugin-is-attempting-to-do-a-cache-purge/
423
+ // PagelyCachePurge::purgeAll();
424
+ // }
425
+
426
  // Comet cache
427
  if( class_exists('comet_cache') && method_exists('comet_cache', 'clear') ) {
428
  comet_cache::clear();
new/admin/class-ht-ctc-admin-main-page.php CHANGED
@@ -207,6 +207,14 @@ class HT_CTC_Admin_Main_Page {
207
  <input name="ht_ctc_chat_options[call_to_action]" value="<?= $value ?>" id="call_to_action" type="text" class="input-margin">
208
  <label for="call_to_action"><?php _e( 'Call to Action', 'click-to-chat-for-whatsapp' ); ?></label>
209
  <p class="description"><?php _e( 'Text that appears along with WhatsApp icon/button', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/call-to-action/">more info</a> </p>
 
 
 
 
 
 
 
 
210
  </div>
211
  </div>
212
  <?php
207
  <input name="ht_ctc_chat_options[call_to_action]" value="<?= $value ?>" id="call_to_action" type="text" class="input-margin">
208
  <label for="call_to_action"><?php _e( 'Call to Action', 'click-to-chat-for-whatsapp' ); ?></label>
209
  <p class="description"><?php _e( 'Text that appears along with WhatsApp icon/button', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/call-to-action/">more info</a> </p>
210
+ <?php
211
+ if ( class_exists( 'WooCommerce' ) ) {
212
+ $woo_link = admin_url( 'admin.php?page=click-to-chat-woocommerce' );
213
+ ?>
214
+ <p class= "description">To Change Pre-filled Message, Call to action for WooCommerce Single Product Pages <a target="_blank" href="<?= $woo_link ?>">( Click to Chat -> WooCommerce )</a></p>
215
+ <?php
216
+ }
217
+ ?>
218
  </div>
219
  </div>
220
  <?php
new/inc/assets/js/dev/woo.dev.js CHANGED
@@ -19,13 +19,21 @@ $(function () {
19
  if (document.querySelector('.single_add_to_cart_button') || document.querySelector('.add_to_cart_button')) {
20
  cart_layout();
21
  } else if (document.querySelector('.ctc_woo_place')) {
 
22
  // in shop page - cart button might not exists, dispay (might be added display none)
23
- $('.ctc_woo_place').show();
 
24
  }
25
  } catch (e) {
26
  console.log('error: cart_layout');
27
  }
28
 
 
 
 
 
 
 
29
  function cart_layout() {
30
 
31
  console.log('inside cart layout');
@@ -56,7 +64,7 @@ $(function () {
56
  });
57
  }
58
 
59
- $('.ctc_woo_place').show();
60
 
61
  }
62
 
@@ -87,7 +95,7 @@ $(function () {
87
  });
88
 
89
  }
90
- $('.ctc_woo_place').show();
91
  }
92
 
93
  // s8 - shop, archive products
@@ -113,7 +121,7 @@ $(function () {
113
  "border-radius": $(single_cart).css('border-radius'),
114
  "width": 'fit-content',
115
  });
116
- $('.ctc_woo_place').show();
117
 
118
  }
119
 
19
  if (document.querySelector('.single_add_to_cart_button') || document.querySelector('.add_to_cart_button')) {
20
  cart_layout();
21
  } else if (document.querySelector('.ctc_woo_place')) {
22
+ // && !document.querySelector('.ctc_woo_schedule')
23
  // in shop page - cart button might not exists, dispay (might be added display none)
24
+ console.log('woo ctc_woo_place show');
25
+ display_ctc_woo_place();
26
  }
27
  } catch (e) {
28
  console.log('error: cart_layout');
29
  }
30
 
31
+ function display_ctc_woo_place() {
32
+ if (!document.querySelector('.ctc_woo_schedule')) {
33
+ $('.ctc_woo_place').show();
34
+ }
35
+ }
36
+
37
  function cart_layout() {
38
 
39
  console.log('inside cart layout');
64
  });
65
  }
66
 
67
+ display_ctc_woo_place();
68
 
69
  }
70
 
95
  });
96
 
97
  }
98
+ display_ctc_woo_place();
99
  }
100
 
101
  // s8 - shop, archive products
121
  "border-radius": $(single_cart).css('border-radius'),
122
  "width": 'fit-content',
123
  });
124
+ display_ctc_woo_place();
125
 
126
  }
127
 
new/inc/assets/js/woo.js CHANGED
@@ -1 +1 @@
1
- !function(s){s(function(){try{document.querySelector(".single_add_to_cart_button")||document.querySelector(".add_to_cart_button")?function(){var t,o,c,e=document.querySelector(".single_add_to_cart_button"),r=document.querySelector(".add_to_cart_button");if(document.querySelector(".ctc_woo_single_cart_layout .s1_btn")&&(t=document.querySelector(".ctc_woo_single_cart_layout .s1_btn"),o=s(t).css("color"),c=s(t).css("background-color"),e&&(_(e,t),s(t).css({display:"inline-flex",width:"fit-content","align-items":"center",color:o,"background-color":c})),s(".ctc_woo_place").show()),document.querySelector(".ctc_woo_shop_cart_layout .s1_btn")){let t=document.querySelectorAll(".ctc_woo_shop_cart_layout .s1_btn");r&&t.length&&(o=s(t).css("color"),c=s(t).css("background-color"),t.forEach(t=>{_(r,t)}),s(t).css({display:"inline-flex",width:"fit-content","align-items":"center",color:o,"background-color":c})),s(".ctc_woo_place").show()}function n(t){s(t).css({"min-height":s(e).css("min-height"),"font-size":s(e).css("font-size"),"font-weight":s(e).css("font-weight"),"letter-spacing":s(e).css("letter-spacing"),"border-radius":s(e).css("border-radius"),width:"fit-content"}),s(".ctc_woo_place").show()}function _(t,o){const c=window.getComputedStyle(t);Array.from(c).forEach(t=>o.style.setProperty(t,c.getPropertyValue(t),c.getPropertyPriority(t)))}document.querySelector(".ctc_woo_shop_cart_layout .s_8")&&n(document.querySelector(".ctc_woo_shop_cart_layout .s_8")),document.querySelector(".ctc_woo_single_cart_layout .s_8")&&n(document.querySelector(".ctc_woo_single_cart_layout .s_8"))}():document.querySelector(".ctc_woo_place")&&s(".ctc_woo_place").show()}catch(t){}})}(jQuery);
1
+ !function(l){l(function(){try{document.querySelector(".single_add_to_cart_button")||document.querySelector(".add_to_cart_button")?function(){var t,o,c,e=document.querySelector(".single_add_to_cart_button"),r=document.querySelector(".add_to_cart_button");if(document.querySelector(".ctc_woo_single_cart_layout .s1_btn")&&(t=document.querySelector(".ctc_woo_single_cart_layout .s1_btn"),o=l(t).css("color"),c=l(t).css("background-color"),e&&(_(e,t),l(t).css({display:"inline-flex",width:"fit-content","align-items":"center",color:o,"background-color":c})),s()),document.querySelector(".ctc_woo_shop_cart_layout .s1_btn")){let t=document.querySelectorAll(".ctc_woo_shop_cart_layout .s1_btn");r&&t.length&&(o=l(t).css("color"),c=l(t).css("background-color"),t.forEach(t=>{_(r,t)}),l(t).css({display:"inline-flex",width:"fit-content","align-items":"center",color:o,"background-color":c})),s()}function n(t){l(t).css({"min-height":l(e).css("min-height"),"font-size":l(e).css("font-size"),"font-weight":l(e).css("font-weight"),"letter-spacing":l(e).css("letter-spacing"),"border-radius":l(e).css("border-radius"),width:"fit-content"}),s()}function _(t,o){const c=window.getComputedStyle(t);Array.from(c).forEach(t=>o.style.setProperty(t,c.getPropertyValue(t),c.getPropertyPriority(t)))}document.querySelector(".ctc_woo_shop_cart_layout .s_8")&&n(document.querySelector(".ctc_woo_shop_cart_layout .s_8")),document.querySelector(".ctc_woo_single_cart_layout .s_8")&&n(document.querySelector(".ctc_woo_single_cart_layout .s_8"))}():document.querySelector(".ctc_woo_place")&&s()}catch(t){}function s(){document.querySelector(".ctc_woo_schedule")||l(".ctc_woo_place").show()}})}(jQuery);
new/tools/woo/class-ht-ctc-woo.php CHANGED
@@ -64,7 +64,9 @@ class HT_CTC_WOO_Pages {
64
  $type = 'chat';
65
  $calling_from = 'woo_page';
66
 
67
- $style = ( isset( $woo_options['woo_shop_style']) ) ? esc_attr( $woo_options['woo_shop_style'] ) : '8';
 
 
68
 
69
  /**
70
  * call to action
@@ -139,11 +141,25 @@ class HT_CTC_WOO_Pages {
139
  $css .= "display: none;";
140
  }
141
 
142
- $path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style. '.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
 
144
  if ( is_file( $path ) ) {
145
  ?>
146
- <div class="<?= $class_names ?>" style="<?= $css ?>" data-pre_filled="<?= $pre_filled ?>">
147
  <?php include $path; ?>
148
  </div>
149
  <?php
@@ -175,7 +191,10 @@ class HT_CTC_WOO_Pages {
175
 
176
  $type = 'chat';
177
  $calling_from = 'woo_page';
178
- $style = ( isset( $woo_options['woo_style']) ) ? esc_attr( $woo_options['woo_style'] ) : '8';
 
 
 
179
 
180
  // $side_2 = 'right';
181
 
@@ -199,8 +218,7 @@ class HT_CTC_WOO_Pages {
199
 
200
  $woo_single_block_type = ( isset( $woo_options['woo_single_block_type']) ) ? esc_attr( $woo_options['woo_single_block_type'] ) : 'inline-block';
201
 
202
- $css = '';
203
- $css .= "display: $woo_single_block_type;cursor:pointer;";
204
 
205
  if ( isset($woo_options['woo_single_position_center']) ) {
206
  $css .= "text-align: center;";
@@ -229,12 +247,24 @@ class HT_CTC_WOO_Pages {
229
  $css .= "display: none;";
230
  }
231
 
 
 
 
 
 
 
 
 
 
 
 
 
232
 
233
- $path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style. '.php';
234
 
235
  if ( is_file( $path ) ) {
236
  ?>
237
- <div class="<?= $class_names ?>" style="<?= $css ?>">
238
  <?php include $path; ?>
239
  </div>
240
  <?php
64
  $type = 'chat';
65
  $calling_from = 'woo_page';
66
 
67
+ $ht_ctc_woo_shop = array();
68
+
69
+ $ht_ctc_woo_shop['style'] = ( isset( $woo_options['woo_shop_style']) ) ? esc_attr( $woo_options['woo_shop_style'] ) : '8';
70
 
71
  /**
72
  * call to action
141
  $css .= "display: none;";
142
  }
143
 
144
+ $ht_ctc_woo_shop['shop_schedule'] = 'no';
145
+
146
+ $woo_shop_block_type = 'block';
147
+
148
+ // filter hook
149
+ $ht_ctc_woo_shop = apply_filters( 'ht_ctc_fh_woo_shop', $ht_ctc_woo_shop );
150
+
151
+ if ('yes' == $ht_ctc_woo_shop['shop_schedule']) {
152
+ $class_names .= " ctc_woo_schedule";
153
+ $css .= "display: none;";
154
+ } else {
155
+ $css .= "display: $woo_shop_block_type;";
156
+ }
157
+
158
+ $path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $ht_ctc_woo_shop['style']. '.php';
159
 
160
  if ( is_file( $path ) ) {
161
  ?>
162
+ <div class="<?= $class_names ?>" style="<?= $css ?>" data-pre_filled="<?= $pre_filled ?>" data-dt="<?= $woo_shop_block_type ?>">
163
  <?php include $path; ?>
164
  </div>
165
  <?php
191
 
192
  $type = 'chat';
193
  $calling_from = 'woo_page';
194
+
195
+ $ht_ctc_woo_single_product = array();
196
+
197
+ $ht_ctc_woo_single_product['style'] = ( isset( $woo_options['woo_style']) ) ? esc_attr( $woo_options['woo_style'] ) : '8';
198
 
199
  // $side_2 = 'right';
200
 
218
 
219
  $woo_single_block_type = ( isset( $woo_options['woo_single_block_type']) ) ? esc_attr( $woo_options['woo_single_block_type'] ) : 'inline-block';
220
 
221
+ $css = "cursor:pointer;";
 
222
 
223
  if ( isset($woo_options['woo_single_position_center']) ) {
224
  $css .= "text-align: center;";
247
  $css .= "display: none;";
248
  }
249
 
250
+ $ht_ctc_woo_single_product['single_schedule'] = 'no';
251
+
252
+ // filter hook
253
+ $ht_ctc_woo_single_product = apply_filters( 'ht_ctc_fh_woo_single_product', $ht_ctc_woo_single_product );
254
+
255
+ if ('yes' == $ht_ctc_woo_single_product['single_schedule']) {
256
+ $class_names .= " ctc_woo_schedule";
257
+ $css .= "display: none;";
258
+ } else {
259
+ $css .= "display: $woo_single_block_type;";
260
+ }
261
+
262
 
263
+ $path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $ht_ctc_woo_single_product['style']. '.php';
264
 
265
  if ( is_file( $path ) ) {
266
  ?>
267
+ <div class="<?= $class_names ?>" style="<?= $css ?>" data-dt="<?= $woo_single_block_type ?>">
268
  <?php include $path; ?>
269
  </div>
270
  <?php
new/tools/woo/woo-admin/class-ht-ctc-admin-woo-page.php CHANGED
@@ -441,6 +441,8 @@ class HT_CTC_Admin_Woo_Page {
441
  </li>
442
  </ul>
443
 
 
 
444
 
445
  <!-- Page Level settings - for WooCommerce pages -->
446
  <br><br>
441
  </li>
442
  </ul>
443
 
444
+ <?php do_action('ht_ctc_ah_admin_after_woo_settings'); ?>
445
+
446
 
447
  <!-- Page Level settings - for WooCommerce pages -->
448
  <br><br>
readme.txt CHANGED
@@ -3,7 +3,7 @@ Requires at least: 4.6
3
  Tested up to: 5.9.2
4
  Requires PHP: 5.6
5
  Contributors: holithemes
6
- Stable tag: 3.8
7
  Tags: whatsapp, whatsapp business, click to chat, whatsapp chat, whatsapp support, whatsapp group, whatsapp message, WhatsApp WooCommerce, 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
@@ -482,6 +482,9 @@ After Activate the plugin, add WhatsApp Number at plugin settings.
482
 
483
  == Changelog ==
484
 
 
 
 
485
  = 3.8 =
486
  * Enchantment: Style-1 button with icon.
487
  * Enchantment: WhatsApp at WooCommerce Shop, single product pages
3
  Tested up to: 5.9.2
4
  Requires PHP: 5.6
5
  Contributors: holithemes
6
+ Stable tag: 3.8.1
7
  Tags: whatsapp, whatsapp business, click to chat, whatsapp chat, whatsapp support, whatsapp group, whatsapp message, WhatsApp WooCommerce, 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
482
 
483
  == Changelog ==
484
 
485
+ = 3.8.1 =
486
+ * Enchantment: Pre-filled message, Call to Action settings
487
+
488
  = 3.8 =
489
  * Enchantment: Style-1 button with icon.
490
  * Enchantment: WhatsApp at WooCommerce Shop, single product pages