Click to Chat for WhatsApp Chat - Version 3.3.1

Version Description

  • New: Webhooks
  • Enchantment: position to place settings
Download this release

Release Info

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

Code changes from version 3.3 to 3.3.1

Files changed (40) hide show
  1. click-to-chat.php +2 -2
  2. new/admin/admin.php +10 -1
  3. new/admin/admin_assets/js/{329.admin.js → 331.admin.js} +23 -0
  4. new/admin/admin_assets/js/admin.js +23 -0
  5. new/admin/admin_commons/admin-after-settings-page.php +0 -111
  6. new/admin/class-ht-ctc-admin-customize-styles.php +2 -2
  7. new/admin/class-ht-ctc-admin-group-page.php +1 -0
  8. new/admin/class-ht-ctc-admin-main-page.php +7 -48
  9. new/admin/class-ht-ctc-admin-other-settings.php +96 -2
  10. new/admin/class-ht-ctc-admin-scripts.php +1 -1
  11. new/admin/class-ht-ctc-admin-share-page.php +1 -0
  12. new/inc/assets/js/331.app.js +1 -0
  13. new/inc/assets/js/app.js +1 -1
  14. new/inc/assets/js/dev/app.dev.js +107 -8
  15. new/inc/chat/class-ht-ctc-chat.php +41 -23
  16. new/inc/commons/class-ht-ctc-scripts.php +2 -2
  17. new/inc/commons/class-ht-ctc-values.php +4 -4
  18. new/inc/styles-shortcode/sc-style-1.php +1 -1
  19. new/inc/styles-shortcode/sc-style-2.php +1 -1
  20. new/inc/styles-shortcode/sc-style-3.php +1 -1
  21. new/inc/styles-shortcode/sc-style-4.php +1 -1
  22. new/inc/styles-shortcode/sc-style-5.php +1 -1
  23. new/inc/styles-shortcode/sc-style-6.php +1 -1
  24. new/inc/styles-shortcode/sc-style-7.php +1 -1
  25. new/inc/styles-shortcode/sc-style-7_1.php +1 -1
  26. new/inc/styles-shortcode/sc-style-8.php +1 -1
  27. new/inc/styles-shortcode/sc-style-99.php +1 -1
  28. new/inc/styles/style-1.php +1 -1
  29. new/inc/styles/style-2.php +1 -1
  30. new/inc/styles/style-3.php +1 -1
  31. new/inc/styles/style-3_1.php +1 -1
  32. new/inc/styles/style-4.php +1 -1
  33. new/inc/styles/style-5.php +1 -1
  34. new/inc/styles/style-6.php +1 -1
  35. new/inc/styles/style-7.php +1 -1
  36. new/inc/styles/style-7_1.php +1 -1
  37. new/inc/styles/style-8.php +1 -1
  38. new/inc/styles/style-99.php +1 -1
  39. prev/inc/class-ht-ccw.php +3 -3
  40. readme.txt +18 -8
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
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' );
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.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.3.1' );
21
  }
22
 
23
  // define HT_CTC_PLUGIN_FILE
new/admin/admin.php CHANGED
@@ -45,4 +45,13 @@ include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-customize-styles.p
45
  include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-other-settings.php';
46
 
47
  // meta boxes - change values at page level
48
- include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/class-ht-ctc-metabox.php';
 
 
 
 
 
 
 
 
 
45
  include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-other-settings.php';
46
 
47
  // meta boxes - change values at page level
48
+ include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/class-ht-ctc-metabox.php';
49
+
50
+
51
+ // add hook after init - to make other things load
52
+ if ( ! function_exists('ht_ctc_admin_includes')) {
53
+ function ht_ctc_admin_includes() {
54
+ do_action('ht_ctc_ah_admin_includes' );
55
+ }
56
+ add_action( 'init', 'ht_ctc_admin_includes' );
57
+ }
new/admin/admin_assets/js/{329.admin.js → 331.admin.js} RENAMED
@@ -159,6 +159,27 @@ function wn() {
159
  }
160
  wn();
161
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  // things based on screen size
163
  function ss() {
164
 
@@ -179,6 +200,8 @@ function other() {
179
  // hover text on save_changes button
180
  var text = $('#ctc_save_changes_hover_text').text();
181
  $("#submit").attr('title', text);
 
 
182
 
183
  }
184
  other();
159
  }
160
  wn();
161
 
162
+ // webhook
163
+ function hook() {
164
+
165
+ // webhook value - html
166
+ var hook_value_html = $('.add_hook_value').attr('data-html');
167
+
168
+ // add value
169
+ $(document).on('click', '.add_hook_value', function () {
170
+
171
+ $('.ctc_hook_value').append(hook_value_html);
172
+ });
173
+
174
+ // Remove value
175
+ $('.ctc_hook_value').on('click', '.hook_remove_value', function (e) {
176
+ e.preventDefault();
177
+ $(this).closest('.additional-value').remove();
178
+ });
179
+
180
+ }
181
+ hook();
182
+
183
  // things based on screen size
184
  function ss() {
185
 
200
  // hover text on save_changes button
201
  var text = $('#ctc_save_changes_hover_text').text();
202
  $("#submit").attr('title', text);
203
+
204
+
205
 
206
  }
207
  other();
new/admin/admin_assets/js/admin.js CHANGED
@@ -159,6 +159,27 @@ function wn() {
159
  }
160
  wn();
161
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  // things based on screen size
163
  function ss() {
164
 
@@ -179,6 +200,8 @@ function other() {
179
  // hover text on save_changes button
180
  var text = $('#ctc_save_changes_hover_text').text();
181
  $("#submit").attr('title', text);
 
 
182
 
183
  }
184
  other();
159
  }
160
  wn();
161
 
162
+ // webhook
163
+ function hook() {
164
+
165
+ // webhook value - html
166
+ var hook_value_html = $('.add_hook_value').attr('data-html');
167
+
168
+ // add value
169
+ $(document).on('click', '.add_hook_value', function () {
170
+
171
+ $('.ctc_hook_value').append(hook_value_html);
172
+ });
173
+
174
+ // Remove value
175
+ $('.ctc_hook_value').on('click', '.hook_remove_value', function (e) {
176
+ e.preventDefault();
177
+ $(this).closest('.additional-value').remove();
178
+ });
179
+
180
+ }
181
+ hook();
182
+
183
  // things based on screen size
184
  function ss() {
185
 
200
  // hover text on save_changes button
201
  var text = $('#ctc_save_changes_hover_text').text();
202
  $("#submit").attr('title', text);
203
+
204
+
205
 
206
  }
207
  other();
new/admin/admin_commons/admin-after-settings-page.php DELETED
@@ -1,111 +0,0 @@
1
- <?php
2
- /**
3
- * After Setting page / FAQ
4
- *
5
- * @since 2.6
6
- * @package ctc
7
- * @subpackage admin
8
- */
9
-
10
- if ( ! defined( 'ABSPATH' ) ) exit;
11
- ?>
12
-
13
- <div class="col s12 m6 l4">
14
- <div class="row">
15
-
16
- <ul class="collapsible popout">
17
- <p class="description" style="text-align: center"><?php _e( 'Frequently Asked Questions', 'click-to-chat-for-whatsapp' ); ?></p>
18
-
19
- <li>
20
- <div class="collapsible-header"><?php _e( 'Show/Hide on Selected pages, devices', 'click-to-chat-for-whatsapp' ); ?></div>
21
- <div class="collapsible-body">
22
- <p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/show-only-on-selected-pages/?utm_source=ctc&utm_medium=admin&utm_campaign=after-settings"><?php _e( 'Show only on selected pages' ) ?></a></p>
23
- <p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/hide-only-on-selected-pages/?utm_source=ctc&utm_medium=admin&utm_campaign=after-settings"><?php _e( 'Hide only on selected pages' ) ?></a></p>
24
- <p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/show-hide-on-mobile-desktop/?utm_source=ctc&utm_medium=admin&utm_campaign=after-settings"><?php _e( 'Show/Hide on Mobile/Desktop' ) ?></a></p>
25
- </div>
26
- </li>
27
-
28
- <li>
29
- <div class="collapsible-header"><?php _e( 'Change Values at page level', 'click-to-chat-for-whatsapp' ); ?> (number, ..)</div>
30
- <div class="collapsible-body">
31
- <p class="description">We can change the WhatsApp number, Call to Action, prefilled message while editing the post from the right side bar' )</p>
32
- <p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/change-values-at-page-level/"><?php _e( 'Change Settings at Page Level' ) ?></a></p>
33
- </div>
34
- </li>
35
-
36
- <li>
37
- <div class="collapsible-header"><?php _e( 'I Make Changes and Nothing Happens', 'click-to-chat-for-whatsapp' ); ?></div>
38
- <div class="collapsible-body">
39
- <p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/clear-cache/"><?php _e( 'Clear Cache' ) ?>:</a> <br>
40
- &emsp; - <?php _e( 'Cache plugins', 'click-to-chat-for-whatsapp' ); ?> <br>
41
- &emsp; - <?php _e( 'Server cache', 'click-to-chat-for-whatsapp' ); ?> <br>
42
- &emsp; - <?php _e( 'Browser Cache', 'click-to-chat-for-whatsapp' ); ?>
43
- </p>
44
- </div>
45
- </li>
46
-
47
- <li>
48
- <div class="collapsible-header"><?php _e( 'No WhatsApp Number Found!', 'click-to-chat-for-whatsapp' ); ?></div>
49
- <div class="collapsible-body">
50
- <p class="description"><?php _e( 'Add', 'click-to-chat-for-whatsapp' ); ?> <a href="#chat_settings"><?php _e( 'WhatsApp Number with Country Code', 'click-to-chat-for-whatsapp' ); ?></a></p>
51
- <p class="description"><?php _e( 'If already added it might be cached version', 'click-to-chat-for-whatsapp' ); ?>, <strong><?php _e( 'Clear the Cache and try', 'click-to-chat-for-whatsapp' ); ?></strong></p>
52
- <p class="description"><?php _e( 'If still an issue, please contact us', 'click-to-chat-for-whatsapp' ); ?></p>
53
- </div>
54
- </li>
55
-
56
- <!-- <li>
57
- <div class="collapsible-header"><?php _e( 'Phone number shared via url is invalid', 'click-to-chat-for-whatsapp' ); ?></div>
58
- <div class="collapsible-body">
59
- <p class="description"><?php _e( 'Add WhatsApp Number With country code', 'click-to-chat-for-whatsapp' ); ?></p>
60
- <p class="description"><?php _e( 'If already added, clear the cache and check', 'click-to-chat-for-whatsapp' ); ?></p>
61
- </div>
62
- </li> -->
63
-
64
-
65
- <!-- <div class="collapsible-header">Support Us</div>
66
- <div class="collapsible-body">
67
- <p class="description">If you like the plugin support us by giving 5 star rating</p>
68
- </div>
69
- </li> -->
70
-
71
- </ul>
72
-
73
- </div>
74
- </div>
75
-
76
-
77
- <div class="col s12 m6 l4">
78
- <div class="row">
79
- <ul class="collapsible popout">
80
-
81
- <p class="description" style="text-align: center"><?php _e( 'Click to Chat - HoliThemes', 'click-to-chat-for-whatsapp' ); ?></p>
82
-
83
- <li>
84
- <div class="collapsible-header"><?php _e( 'ShowCase', 'click-to-chat-for-whatsapp' ); ?></div>
85
- <div class="collapsible-body">
86
- <p class="description"><a target="_blank" href="https://docs.google.com/forms/d/e/1FAIpQLSdPgUgjaZLxfEk-jRQUd8efV-SNh5eOgc2Qe5Xl9uz0ti8tEw/viewform?usp=sf_link">Share your website address</a>, we will add your website link in 'Click to Chat' portfolio.</p>
87
- </div>
88
- </li>
89
-
90
- <li>
91
- <div class="collapsible-header"><?php _e( 'Contact Us', 'click-to-chat-for-whatsapp' ); ?></div>
92
- <div class="collapsible-body">
93
- <p class="description"><?php _e( 'Please let us know if you have any suggestions or feedback!!', 'click-to-chat-for-whatsapp' ); ?> <br><br> <a href="http://api.whatsapp.com/send?phone=919494429789&text=<?php echo get_bloginfo('url'); ?>%0AHi%20HoliThemes,%0AI%20have%20a%20Suggestion/Feedback:" target="_blank"><?php _e( 'WhatsApp', 'click-to-chat-for-whatsapp' ); ?></a></p>
94
- <p class="description"><?php _e( 'Mail', 'click-to-chat-for-whatsapp' ); ?>:<a href="mailto: ctc@holithemes.com"> ctc@holithemes.com</a></p>
95
- </div>
96
- </li>
97
-
98
- <li>
99
- <div class="collapsible-header"><?php _e( 'HoliThemes On', 'click-to-chat-for-whatsapp' ); ?></div>
100
- <div class="collapsible-body">
101
- <p class="description"><a href="https://www.facebook.com/holithemes/" target="_blank"><?php _e( 'Facebook', 'click-to-chat-for-whatsapp' ); ?></a></p>
102
- <p class="description"><a href="https://www.youtube.com/channel/UC2Tf_WB9PWffO2B3tswWCGw" target="_blank"><?php _e( 'YouTube', 'click-to-chat-for-whatsapp' ); ?></a></p>
103
- <p class="description"><a href="https://twitter.com/holithemes" target="_blank"><?php _e( 'Twitter', 'click-to-chat-for-whatsapp' ); ?></a></p>
104
- <p class="description"><a href="https://www.instagram.com/holithemes/" target="_blank"><?php _e( 'Instagram', 'click-to-chat-for-whatsapp' ); ?></a></p>
105
- <p class="description"><a href="https://www.linkedin.com/company/holithemes" target="_blank"><?php _e( 'LinkedIn', 'click-to-chat-for-whatsapp' ); ?></a></p>
106
- </div>
107
- </li>
108
-
109
- </ul>
110
- </div>
111
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
new/admin/class-ht-ctc-admin-customize-styles.php CHANGED
@@ -48,8 +48,8 @@ class HT_CTC_Admin_Customize_Styles {
48
 
49
  if ( !isset( $ht_ctc_cs['display_allstyles'] ) ) {
50
 
51
- $style_d = $ht_ctc_chat['style_desktop'];
52
- $style_m = $ht_ctc_chat['style_mobile'];
53
 
54
  $this->s1_class .= ( '1' == $style_d || '1' == $style_m ) ? '' : 'ht_ctc_display_none';
55
  $this->s2_class .= ( '2' == $style_d || '2' == $style_m ) ? '' : 'ht_ctc_display_none';
48
 
49
  if ( !isset( $ht_ctc_cs['display_allstyles'] ) ) {
50
 
51
+ $style_d = (isset($ht_ctc_chat['style_desktop'])) ? esc_attr($ht_ctc_chat['style_desktop']) : '';
52
+ $style_m = (isset($ht_ctc_chat['style_mobile'])) ? esc_attr($ht_ctc_chat['style_mobile']) : '';
53
 
54
  $this->s1_class .= ( '1' == $style_d || '1' == $style_m ) ? '' : 'ht_ctc_display_none';
55
  $this->s2_class .= ( '2' == $style_d || '2' == $style_m ) ? '' : 'ht_ctc_display_none';
new/admin/class-ht-ctc-admin-group-page.php CHANGED
@@ -172,6 +172,7 @@ class HT_CTC_Admin_Group_Page {
172
  foreach ($input as $key => $value) {
173
 
174
  if ( 'side_1_value' == $key || 'side_2_value' == $key || 'mobile_side_1_value' == $key || 'mobile_side_2_value' == $key ) {
 
175
  if ( is_numeric($input[$key]) ) {
176
  $input[$key] = $input[$key] . 'px';
177
  }
172
  foreach ($input as $key => $value) {
173
 
174
  if ( 'side_1_value' == $key || 'side_2_value' == $key || 'mobile_side_1_value' == $key || 'mobile_side_2_value' == $key ) {
175
+ $input[$key] = str_replace( ' ', '', $input[$key] );
176
  if ( is_numeric($input[$key]) ) {
177
  $input[$key] = $input[$key] . 'px';
178
  }
new/admin/class-ht-ctc-admin-main-page.php CHANGED
@@ -104,15 +104,6 @@ class HT_CTC_Admin_Main_Page {
104
  add_settings_field( 'ctc_notes', '', array( $this, 'ctc_notes_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
105
 
106
 
107
- // switch options
108
- $ccw_options = get_option('ccw_options');
109
- if ( isset( $ccw_options['number'] ) ) {
110
- // display this setting page only if user switched from previous interface.. ( for new users no switch option )
111
- register_setting( 'ht_ctc_main_page_settings_fields', 'ht_ctc_switch' , array( $this, 'options_sanitize' ) );
112
- add_settings_section( 'ht_ctc_main_page_settings_sections_add', '', '', 'ht_ctc_main_page_settings_sections_do' );
113
- add_settings_field( 'ht_ctc_switch', '', array( $this, 'ht_ctc_switch_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
114
- }
115
-
116
  }
117
 
118
 
@@ -180,8 +171,11 @@ class HT_CTC_Admin_Main_Page {
180
  <input name="ht_ctc_chat_options[number]" style="display: none;" hidden value="<?php echo $number ?>" id="ctc_whatsapp_number" type="text">
181
 
182
  </div>
183
- <p class="description"><?php _e( "WhatsApp or WhatsApp business number with country code", 'click-to-chat-for-whatsapp' ); ?> </p>
184
  <p class="description"><?php _e( '( E.g. 916123456789 - herein e.g. 91 is country code, 6123456789 is the mobile number )', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/whatsapp-number/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> ) </p>
 
 
 
185
  </div>
186
  <?php
187
  }
@@ -195,7 +189,6 @@ class HT_CTC_Admin_Main_Page {
195
  ?>
196
  <div class="row">
197
  <div class="input-field col s12">
198
- <!-- <input name="ht_ctc_chat_options[pre_filled]" value="<?php // echo esc_attr( $options['pre_filled'] ) ?>" id="pre_filled" type="text" class="input-margin"> -->
199
  <textarea style="min-height: 84px;" placeholder="<?php echo $placeholder ?>" name="ht_ctc_chat_options[pre_filled]" id="pre_filled" class="materialize-textarea input-margin"><?php echo $value ?></textarea>
200
  <label for="pre_filled"><?php _e( 'Pre-filled message', 'click-to-chat-for-whatsapp' ); ?></label>
201
  <p class="description"><?php _e( "Text that appears in the WhatsApp Chat window. Add variables {site}, {url}, {title} to replace with site name, current webpage URL, Post title", 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/pre-filled-message/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
@@ -321,43 +314,6 @@ class HT_CTC_Admin_Main_Page {
321
 
322
 
323
 
324
-
325
- // switch interface
326
- function ht_ctc_switch_cb() {
327
- $options = get_option('ht_ctc_switch');
328
- $interface_value = esc_attr( $options['interface'] );
329
- ?>
330
- <!-- <br><br><br><br><br><br><br><br> -->
331
- <ul class="collapsible">
332
- <li>
333
- <div class="collapsible-header"><?php _e( 'Switch Interface', 'click-to-chat-for-whatsapp' ); ?></div>
334
- <div class="collapsible-body">
335
-
336
- <p class="description"><?php _e( 'If you are convenient with the previous interface in comparison to the new one, please switch to previous interface', 'click-to-chat-for-whatsapp' ); ?></p>
337
- <br><br>
338
- <div class="row">
339
- <div class="input-field col s12" style="margin-bottom: 0px;">
340
- <select name="ht_ctc_switch[interface]" class="select-2">
341
- <option value="no" <?php echo $interface_value == 'no' ? 'SELECTED' : ''; ?> >Previous Interface</option>
342
- <option value="yes" <?php echo $interface_value == 'yes' ? 'SELECTED' : ''; ?> >New Interface</option>
343
- </select>
344
- <label><?php _e( 'Switch Interface', 'click-to-chat-for-whatsapp' ); ?></label>
345
- </div>
346
- <!-- <p class="description">If you are convenient with the previous interface in comparison to the new one, please switch to previous interface</p> -->
347
- </div>
348
-
349
- </div>
350
- </div>
351
- </li>
352
- <ul>
353
-
354
- <?php
355
- }
356
-
357
-
358
-
359
-
360
-
361
  /**
362
  * Sanitize each setting field as needed
363
  *
@@ -378,6 +334,7 @@ class HT_CTC_Admin_Main_Page {
378
  // $new_input[$key] = esc_textarea( $input[$key] );
379
  $new_input[$key] = sanitize_textarea_field( $input[$key] );
380
  } elseif ( 'side_1_value' == $key || 'side_2_value' == $key || 'mobile_side_1_value' == $key || 'mobile_side_2_value' == $key ) {
 
381
  if ( is_numeric($input[$key]) ) {
382
  $input[$key] = $input[$key] . 'px';
383
  }
@@ -385,6 +342,8 @@ class HT_CTC_Admin_Main_Page {
385
  $input[$key] = '0px';
386
  }
387
  $new_input[$key] = sanitize_text_field( $input[$key] );
 
 
388
  } else {
389
  $new_input[$key] = sanitize_text_field( $input[$key] );
390
  }
104
  add_settings_field( 'ctc_notes', '', array( $this, 'ctc_notes_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
105
 
106
 
 
 
 
 
 
 
 
 
 
107
  }
108
 
109
 
171
  <input name="ht_ctc_chat_options[number]" style="display: none;" hidden value="<?php echo $number ?>" id="ctc_whatsapp_number" type="text">
172
 
173
  </div>
174
+ <p class="description"><?php _e( "WhatsApp or WhatsApp business number with ", 'click-to-chat-for-whatsapp' ); ?> <a target="_blank" href="https://holithemes.com/blog/country-codes/"><?php _e( 'country code', 'click-to-chat-for-whatsapp' ); ?></a> </p>
175
  <p class="description"><?php _e( '( E.g. 916123456789 - herein e.g. 91 is country code, 6123456789 is the mobile number )', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/whatsapp-number/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> ) </p>
176
+
177
+ <?php do_action('ht_ctc_ah_admin_chat_number'); ?>
178
+
179
  </div>
180
  <?php
181
  }
189
  ?>
190
  <div class="row">
191
  <div class="input-field col s12">
 
192
  <textarea style="min-height: 84px;" placeholder="<?php echo $placeholder ?>" name="ht_ctc_chat_options[pre_filled]" id="pre_filled" class="materialize-textarea input-margin"><?php echo $value ?></textarea>
193
  <label for="pre_filled"><?php _e( 'Pre-filled message', 'click-to-chat-for-whatsapp' ); ?></label>
194
  <p class="description"><?php _e( "Text that appears in the WhatsApp Chat window. Add variables {site}, {url}, {title} to replace with site name, current webpage URL, Post title", 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/pre-filled-message/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
314
 
315
 
316
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
317
  /**
318
  * Sanitize each setting field as needed
319
  *
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] );
338
  if ( is_numeric($input[$key]) ) {
339
  $input[$key] = $input[$key] . 'px';
340
  }
342
  $input[$key] = '0px';
343
  }
344
  $new_input[$key] = sanitize_text_field( $input[$key] );
345
+ } elseif ( 'r_nums' == $key ) {
346
+ $new_input[$key] = array_map( 'sanitize_text_field', $input[$key] );
347
  } else {
348
  $new_input[$key] = sanitize_text_field( $input[$key] );
349
  }
new/admin/class-ht-ctc-admin-other-settings.php CHANGED
@@ -57,7 +57,9 @@ class HT_CTC_Admin_Other_Settings {
57
  <div class="row">
58
 
59
  <!-- after settings page -->
60
- <?php include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-after-settings-page.php'; ?>
 
 
61
 
62
  </div>
63
 
@@ -76,6 +78,7 @@ class HT_CTC_Admin_Other_Settings {
76
 
77
  add_settings_field( 'ht_ctc_animations', 'Animations', array( $this, 'ht_ctc_animations_cb' ), 'ht_ctc_os_page_settings_sections_do', 'ht_ctc_os_settings_sections_add' );
78
  add_settings_field( 'ht_ctc_analytics', 'Analytics', array( $this, 'ht_ctc_analytics_cb' ), 'ht_ctc_os_page_settings_sections_do', 'ht_ctc_os_settings_sections_add' );
 
79
  add_settings_field( 'ht_ctc_othersettings', 'Other Settings', array( $this, 'ht_ctc_othersettings_cb' ), 'ht_ctc_os_page_settings_sections_do', 'ht_ctc_os_settings_sections_add' );
80
 
81
  }
@@ -188,6 +191,92 @@ class HT_CTC_Admin_Other_Settings {
188
  <?php
189
  }
190
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
  function ht_ctc_animations_cb() {
192
  $options = get_option('ht_ctc_othersettings');
193
  $dbrow = 'ht_ctc_othersettings';
@@ -218,7 +307,7 @@ class HT_CTC_Admin_Other_Settings {
218
  <div class="collapsible-header"><?php _e( 'Animations', 'click-to-chat-for-whatsapp' ); ?></div>
219
  <div class="collapsible-body">
220
 
221
- <p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/animations/">Animations</a></p>
222
  <br><br><br>
223
 
224
 
@@ -304,6 +393,9 @@ class HT_CTC_Admin_Other_Settings {
304
  $options = get_option('ht_ctc_othersettings');
305
  $dbrow = 'ht_ctc_othersettings';
306
 
 
 
 
307
  $li_active_gr_sh = ( isset( $options['enable_group'] ) || isset( $options['enable_share'] ) ) ? "class='active'" : '';
308
  ?>
309
 
@@ -544,6 +636,8 @@ class HT_CTC_Admin_Other_Settings {
544
 
545
  if ( 'placeholder' == $key ) {
546
  $new_input[$key] = sanitize_textarea_field( $input[$key] );
 
 
547
  } elseif ( isset( $input[$key] ) ) {
548
  $new_input[$key] = sanitize_text_field( $input[$key] );
549
  }
57
  <div class="row">
58
 
59
  <!-- after settings page -->
60
+ <?php
61
+ // include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-after-settings-page.php';
62
+ ?>
63
 
64
  </div>
65
 
78
 
79
  add_settings_field( 'ht_ctc_animations', 'Animations', array( $this, 'ht_ctc_animations_cb' ), 'ht_ctc_os_page_settings_sections_do', 'ht_ctc_os_settings_sections_add' );
80
  add_settings_field( 'ht_ctc_analytics', 'Analytics', array( $this, 'ht_ctc_analytics_cb' ), 'ht_ctc_os_page_settings_sections_do', 'ht_ctc_os_settings_sections_add' );
81
+ add_settings_field( 'ht_ctc_webhooks', 'Webhooks', array( $this, 'ht_ctc_webhooks_cb' ), 'ht_ctc_os_page_settings_sections_do', 'ht_ctc_os_settings_sections_add' );
82
  add_settings_field( 'ht_ctc_othersettings', 'Other Settings', array( $this, 'ht_ctc_othersettings_cb' ), 'ht_ctc_os_page_settings_sections_do', 'ht_ctc_os_settings_sections_add' );
83
 
84
  }
191
  <?php
192
  }
193
 
194
+ // webhook
195
+ function ht_ctc_webhooks_cb() {
196
+
197
+ $options = get_option('ht_ctc_othersettings');
198
+ $dbrow = 'ht_ctc_othersettings';
199
+
200
+ $hook_url = isset($options['hook_url']) ? esc_attr( $options['hook_url'] ) : '';
201
+
202
+ ?>
203
+ <ul class="collapsible" data-collapsible="accordion" id="ht_ctc_analytics">
204
+ <li class="active">
205
+ <div class="collapsible-header"><?php _e( 'Webhooks', 'click-to-chat-for-whatsapp' ); ?></div>
206
+ <div class="collapsible-body">
207
+
208
+ <p class="description" style="margin-bottom: 20px;">Integarte, Automation using Webhooks.</p>
209
+ <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>
210
+ <br><br><br>
211
+
212
+ <!-- Webhook URL -->
213
+ <div class="row">
214
+ <div class="input-field col s12">
215
+ <input name="<?php echo $dbrow ?>[hook_url]" value="<?php echo $hook_url ?>" id="hook_url" type="text" class="input-margin">
216
+ <label for="hook_url"><?php _e( 'Webhook URL', 'click-to-chat-for-whatsapp' ); ?></label>
217
+ <p class="description"><?php _e( 'Calls this webhook url after user clicks on WhatsApp Icon/Image', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/webhooks/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
218
+ </div>
219
+ </div>
220
+
221
+ <div class="row">
222
+
223
+ <br>
224
+ <div class="ctc_hook_value">
225
+ <?php
226
+
227
+ // hook values
228
+ $hook_v = (isset($options['hook_v'])) ? $options['hook_v'] : '' ;
229
+ $count = 1;
230
+ $num = '';
231
+
232
+ if ( is_array($hook_v) ) {
233
+ $hook_v = array_filter($hook_v);
234
+ $hook_v = array_values($hook_v);
235
+ $count = count($hook_v);
236
+ }
237
+
238
+ // hook values
239
+ if ( isset( $hook_v[0] ) ) {
240
+ for ($i=0; $i < $count ; $i++) {
241
+ $dbrow = "ht_ctc_othersettings[hook_v][$i]";
242
+ $num = $hook_v[$i];
243
+ ?>
244
+ <div class="additional-value row" style="margin-bottom: 15px;">
245
+ <div class="col s3">
246
+ <p class="description">Value<?php echo $i+1; ?></p>
247
+ </div>
248
+ <div class="col s9 m6">
249
+ <p style="display: flex;">
250
+ <input name="<?php echo $dbrow; ?>" value="<?php echo $num; ?>" type="text"/>
251
+ <span style="color:lightgrey; cursor:pointer;" class="hook_remove_value dashicons dashicons-no-alt"></span>
252
+ </p>
253
+ </div>
254
+ </div>
255
+ <?php
256
+ }
257
+ }
258
+
259
+ ?>
260
+ </div>
261
+
262
+ <span style="color:#039be5; cursor:pointer; font-size:16px;"
263
+ class="add_hook_value dashicons dashicons-plus-alt2 col s12"
264
+ data-html='<div class="row"><div class="col s3"><p class="description"><?php _e( "Add Value", "click-to-chat-for-whatsapp" ); ?></p></div><div class="input-field col s9 m6"><input name="ht_ctc_othersettings[hook_v][]" value="" id="hook_v" type="text" class="input-margin"><label for="hook_v"><?php _e( "Value", "click-to-chat-for-whatsapp" ); ?></label></div></div>'
265
+ ><?php _e( "Add Value", "click-to-chat-for-whatsapp" ); ?></span>
266
+
267
+ </div>
268
+
269
+ <p class="description">New feature: since v3.3.1 ( please contact us for suggestions, improvements. )</p>
270
+ <br>
271
+
272
+
273
+ </div>
274
+ </li>
275
+ </ul>
276
+ <?php
277
+ }
278
+
279
+ // animations
280
  function ht_ctc_animations_cb() {
281
  $options = get_option('ht_ctc_othersettings');
282
  $dbrow = 'ht_ctc_othersettings';
307
  <div class="collapsible-header"><?php _e( 'Animations', 'click-to-chat-for-whatsapp' ); ?></div>
308
  <div class="collapsible-body">
309
 
310
+ <p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/animations/"><?php _e( 'Animations', 'click-to-chat-for-whatsapp' ); ?></a></p>
311
  <br><br><br>
312
 
313
 
393
  $options = get_option('ht_ctc_othersettings');
394
  $dbrow = 'ht_ctc_othersettings';
395
 
396
+ // start other settings
397
+ do_action('ht_ctc_ah_admin_start_os');
398
+
399
  $li_active_gr_sh = ( isset( $options['enable_group'] ) || isset( $options['enable_share'] ) ) ? "class='active'" : '';
400
  ?>
401
 
636
 
637
  if ( 'placeholder' == $key ) {
638
  $new_input[$key] = sanitize_textarea_field( $input[$key] );
639
+ } elseif ( 'hook_v' == $key ) {
640
+ $new_input[$key] = array_map( 'sanitize_text_field', $input[$key] );
641
  } elseif ( isset( $input[$key] ) ) {
642
  $new_input[$key] = sanitize_text_field( $input[$key] );
643
  }
new/admin/class-ht-ctc-admin-scripts.php CHANGED
@@ -21,7 +21,7 @@ class HT_CTC_Admin_Scripts {
21
  $load_js_bottom = apply_filters( 'ht_ctc_fh_load_admin_js_bottom', true );
22
 
23
  // $admin_js = 'admin.js';
24
- $admin_js = '329.admin.js';
25
 
26
  // hook ..
27
  if( 'toplevel_page_click-to-chat' == $hook || 'click-to-chat_page_click-to-chat-chat-feature' == $hook || 'click-to-chat_page_click-to-chat-group-feature' == $hook || 'click-to-chat_page_click-to-chat-share-feature' == $hook || 'click-to-chat_page_click-to-chat-customize-styles' == $hook || 'click-to-chat_page_click-to-chat-other-settings' == $hook ) {
21
  $load_js_bottom = apply_filters( 'ht_ctc_fh_load_admin_js_bottom', true );
22
 
23
  // $admin_js = 'admin.js';
24
+ $admin_js = '331.admin.js';
25
 
26
  // hook ..
27
  if( 'toplevel_page_click-to-chat' == $hook || 'click-to-chat_page_click-to-chat-chat-feature' == $hook || 'click-to-chat_page_click-to-chat-group-feature' == $hook || 'click-to-chat_page_click-to-chat-share-feature' == $hook || 'click-to-chat_page_click-to-chat-customize-styles' == $hook || 'click-to-chat_page_click-to-chat-other-settings' == $hook ) {
new/admin/class-ht-ctc-admin-share-page.php CHANGED
@@ -207,6 +207,7 @@ class HT_CTC_Admin_Share_Page {
207
  foreach ($input as $key => $value) {
208
 
209
  if ( 'side_1_value' == $key || 'side_2_value' == $key || 'mobile_side_1_value' == $key || 'mobile_side_2_value' == $key ) {
 
210
  if ( is_numeric($input[$key]) ) {
211
  $input[$key] = $input[$key] . 'px';
212
  }
207
  foreach ($input as $key => $value) {
208
 
209
  if ( 'side_1_value' == $key || 'side_2_value' == $key || 'mobile_side_1_value' == $key || 'mobile_side_2_value' == $key ) {
210
+ $input[$key] = str_replace( ' ', '', $input[$key] );
211
  if ( is_numeric($input[$key]) ) {
212
  $input[$key] = $input[$key] . 'px';
213
  }
new/inc/assets/js/331.app.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(l){l(function(){var t,o=window.location.href,a=void 0!==document.title?document.title:"",n=void 0!==screen.width&&1024<screen.width?"no":"yes",r="",i="";if("undefined"!=typeof ht_ctc_chat_var)i=ht_ctc_chat_var,e(),c();else{try{document.querySelector(".ht_ctc_chat_data")&&(t=l(".ht_ctc_chat_data").attr("data-settings"),i=JSON.parse(t))}catch(t){i={}}e(),c()}function e(){var t=document.querySelector(".ht_ctc_chat_data");t&&(r=l(".ht_ctc_chat_data").attr("data-no_number"),t.remove())}function c(){var t;l(document).trigger("ht_ctc_ce_settings",[i]),(t=document.querySelector(".ht-ctc-chat"))&&(l(document).trigger("ht_ctc_ce_chat"),function(t){"yes"==i.schedule?l(document).trigger("ht_ctc_ce_display",[i,h,t]):h(t)}(t),t.addEventListener("click",function(){_(t)})),l(document).on("click",".ht-ctc-sc-chat",function(){var t,e=this.getAttribute("data-number"),c=(c=this.getAttribute("data-pre_filled")).replace(/\[url]/gi,o);c=encodeURIComponent(c),"webapi"==this.getAttribute("data-webandapi")?(t="yes"==n?"https://api.whatsapp.com/send":"https://web.whatsapp.com/send",window.open(t+"?phone="+e+"&text="+c,"_blank","noopener")):(t="https://wa.me/",window.open(t+e+"?text="+c,"_blank","noopener")),d(this),u(e)}),l(document).on("click",".ctc_chat, #ctc_chat",function(){_(this)}),l(document).on("click",'[href="#ctc_chat"]',function(t){t.preventDefault(),_(this)})}function h(t){var e;"yes"==n?"show"==i.dis_m&&((e=document.querySelector(".ht_ctc_desktop_chat"))&&e.remove(),t.style.cssText=i.pos_m+i.css,s(t)):"show"==i.dis_d&&((e=document.querySelector(".ht_ctc_mobile_chat"))&&e.remove(),t.style.cssText=i.pos_d+i.css,s(t))}function s(e){try{l(e).show(parseInt(i.se))}catch(t){e.style.display="block"}var t;t=e,setTimeout(function(){t.classList.add("ht_ctc_animation",i.ani)},120),l(".ht-ctc-chat").hover(function(){l(".ht-ctc-chat .ht-ctc-cta-hover").show(120)},function(){l(".ht-ctc-chat .ht-ctc-cta-hover").hide(100)})}function d(t){l(document).trigger("ht_ctc_analytics");var e=i.number;t.classList.contains("ht-ctc-sc")&&(e=t.getAttribute("data-number"));var c="Click to Chat for WhatsApp",n="chat: "+e,t=a+", "+o;"yes"==i.ga&&("undefined"!=typeof gtag?gtag("event",n,{event_category:c,event_label:t}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",c,n,t):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",c,n,t)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",event_category:c,event_label:t,event_action:n}),"yes"==i.ads&&"undefined"!=typeof gtag_report_conversion&&gtag_report_conversion(),"yes"==i.fb&&"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:"chat",ID:e,Title:a,URL:o})}function _(t){l(document).trigger("ht_ctc_ce_number",[i]);var e=i.number,c=(c=i.pre_filled).replace(/\[url]/gi,o);c=encodeURIComponent(c),""!=e?("webapi"==i.webandapi&&"yes"!==n?window.open("https://web.whatsapp.com/send?phone="+e+"&text="+c,"_blank","noopener"):window.open("https://wa.me/"+e+"?text="+c,"_blank","noopener"),d(t),u(e)):l(".ht-ctc-chat").html(r)}function u(t){var e,c;i.hook_url&&(e=i.hook_url,c={},i.hook_v&&(c=i.hook_v),l(document).trigger("ht_ctc_ce_hook",[i,t]),e=i.hook_url,c=i.hook_v,data=JSON.stringify(c),l.ajax({url:e,type:"POST",mode:"no-cors",data:data,success:function(t){}}))}})}(jQuery);
new/inc/assets/js/app.js CHANGED
@@ -1 +1 @@
1
- !function(d){d(function(){var t,a=window.location.href,o=void 0!==document.title?document.title:"",n=void 0!==screen.width&&1024<screen.width?"no":"yes",i="";if("undefined"!=typeof ht_ctc_chat_var)i=ht_ctc_chat_var,e();else{try{document.querySelector(".ht-ctc-chat")&&(t=d(".ht-ctc-chat").attr("data-settings"),i=JSON.parse(t))}catch(t){i={}}e()}function e(){var t;d(document).trigger("ht_ctc_ce_settings",[i]),(t=document.querySelector(".ht-ctc-chat"))&&(d(t).trigger("ht_ctc_ce_chat"),function(t){"yes"==i.schedule?d(document).trigger("ht_ctc_display",[i,c,t]):c(t)}(t),t.addEventListener("click",function(){h(t)})),d(document).on("click",".ht-ctc-sc-chat",function(){var t,e=this.getAttribute("data-number"),c=(c=this.getAttribute("data-pre_filled")).replace(/\[url]/gi,a);c=encodeURIComponent(c),"webapi"==this.getAttribute("data-webandapi")?(t="yes"==n?"https://api.whatsapp.com/send":"https://web.whatsapp.com/send",window.open(t+"?phone="+e+"&text="+c,"_blank","noopener")):(t="https://wa.me/",window.open(t+e+"?text="+c,"_blank","noopener")),s(this)}),d(document).on("click",".ctc_chat, #ctc_chat",function(){h(this)}),d(document).on("click",'[href="#ctc_chat"]',function(t){t.preventDefault(),h(this)})}function c(t){var e;"yes"==n?"show"==i.dis_m&&((e=document.querySelector(".ht_ctc_desktop_chat"))&&e.remove(),t.style.cssText=i.pos_m+i.css,r(t)):"show"==i.dis_d&&((e=document.querySelector(".ht_ctc_mobile_chat"))&&e.remove(),t.style.cssText=i.pos_d+i.css,r(t))}function r(e){try{d(e).show(parseInt(i.se))}catch(t){e.style.display="block"}var t;t=e,setTimeout(function(){t.classList.add("ht_ctc_animation",i.ani)},120),d(".ht-ctc-chat").hover(function(){d(".ht-ctc-chat .ht-ctc-cta-hover").show(120)},function(){d(".ht-ctc-chat .ht-ctc-cta-hover").hide(100)})}function s(t){d(document).trigger("ht_ctc_analytics");var e=i.number;t.classList.contains("ht-ctc-sc")&&(e=t.getAttribute("data-number"));var c="Click to Chat for WhatsApp",n="chat: "+e,t=o+", "+a;"yes"==i.ga&&("undefined"!=typeof gtag?gtag("event",n,{event_category:c,event_label:t}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",c,n,t):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",c,n,t)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",event_category:c,event_label:t,event_action:n}),"yes"==i.ads&&"undefined"!=typeof gtag_report_conversion&&gtag_report_conversion(),"yes"==i.fb&&"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:"chat",ID:e,Title:o,URL:a})}function h(t){var e=i.number,c=(c=i.pre_filled).replace(/\[url]/gi,a);c=encodeURIComponent(c),""!=e?("webapi"==i.webandapi&&"yes"!==n?window.open("https://web.whatsapp.com/send?phone="+e+"&text="+c,"_blank","noopener"):window.open("https://wa.me/"+e+"?text="+c,"_blank","noopener"),s(t)):d(".ht-ctc-chat").html(d(".ht_ctc_no_number").attr("data-no_number"))}})}(jQuery);
1
+ !function(l){l(function(){var t,o=window.location.href,a=void 0!==document.title?document.title:"",n=void 0!==screen.width&&1024<screen.width?"no":"yes",r="",i="";if("undefined"!=typeof ht_ctc_chat_var)i=ht_ctc_chat_var,e(),c();else{try{document.querySelector(".ht_ctc_chat_data")&&(t=l(".ht_ctc_chat_data").attr("data-settings"),i=JSON.parse(t))}catch(t){i={}}e(),c()}function e(){var t=document.querySelector(".ht_ctc_chat_data");t&&(r=l(".ht_ctc_chat_data").attr("data-no_number"),t.remove())}function c(){var t;l(document).trigger("ht_ctc_ce_settings",[i]),(t=document.querySelector(".ht-ctc-chat"))&&(l(document).trigger("ht_ctc_ce_chat"),function(t){"yes"==i.schedule?l(document).trigger("ht_ctc_ce_display",[i,h,t]):h(t)}(t),t.addEventListener("click",function(){_(t)})),l(document).on("click",".ht-ctc-sc-chat",function(){var t,e=this.getAttribute("data-number"),c=(c=this.getAttribute("data-pre_filled")).replace(/\[url]/gi,o);c=encodeURIComponent(c),"webapi"==this.getAttribute("data-webandapi")?(t="yes"==n?"https://api.whatsapp.com/send":"https://web.whatsapp.com/send",window.open(t+"?phone="+e+"&text="+c,"_blank","noopener")):(t="https://wa.me/",window.open(t+e+"?text="+c,"_blank","noopener")),d(this),u(e)}),l(document).on("click",".ctc_chat, #ctc_chat",function(){_(this)}),l(document).on("click",'[href="#ctc_chat"]',function(t){t.preventDefault(),_(this)})}function h(t){var e;"yes"==n?"show"==i.dis_m&&((e=document.querySelector(".ht_ctc_desktop_chat"))&&e.remove(),t.style.cssText=i.pos_m+i.css,s(t)):"show"==i.dis_d&&((e=document.querySelector(".ht_ctc_mobile_chat"))&&e.remove(),t.style.cssText=i.pos_d+i.css,s(t))}function s(e){try{l(e).show(parseInt(i.se))}catch(t){e.style.display="block"}var t;t=e,setTimeout(function(){t.classList.add("ht_ctc_animation",i.ani)},120),l(".ht-ctc-chat").hover(function(){l(".ht-ctc-chat .ht-ctc-cta-hover").show(120)},function(){l(".ht-ctc-chat .ht-ctc-cta-hover").hide(100)})}function d(t){l(document).trigger("ht_ctc_analytics");var e=i.number;t.classList.contains("ht-ctc-sc")&&(e=t.getAttribute("data-number"));var c="Click to Chat for WhatsApp",n="chat: "+e,t=a+", "+o;"yes"==i.ga&&("undefined"!=typeof gtag?gtag("event",n,{event_category:c,event_label:t}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",c,n,t):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",c,n,t)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",event_category:c,event_label:t,event_action:n}),"yes"==i.ads&&"undefined"!=typeof gtag_report_conversion&&gtag_report_conversion(),"yes"==i.fb&&"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:"chat",ID:e,Title:a,URL:o})}function _(t){l(document).trigger("ht_ctc_ce_number",[i]);var e=i.number,c=(c=i.pre_filled).replace(/\[url]/gi,o);c=encodeURIComponent(c),""!=e?("webapi"==i.webandapi&&"yes"!==n?window.open("https://web.whatsapp.com/send?phone="+e+"&text="+c,"_blank","noopener"):window.open("https://wa.me/"+e+"?text="+c,"_blank","noopener"),d(t),u(e)):l(".ht-ctc-chat").html(r)}function u(t){var e,c;i.hook_url&&(e=i.hook_url,c={},i.hook_v&&(c=i.hook_v),l(document).trigger("ht_ctc_ce_hook",[i,t]),e=i.hook_url,c=i.hook_v,data=JSON.stringify(c),l.ajax({url:e,type:"POST",mode:"no-cors",data:data,success:function(t){}}))}})}(jQuery);
new/inc/assets/js/dev/app.dev.js CHANGED
@@ -9,22 +9,38 @@ $(function () {
9
  var post_title = (typeof document.title !== "undefined" ) ? document.title : '';
10
  // is_mobile yes/no, desktop > 1024
11
  var is_mobile = (typeof screen.width !== "undefined" && screen.width > 1024) ? "no" : "yes";
 
12
 
13
  var ctc = '';
14
  if ( typeof ht_ctc_chat_var !== "undefined" ) {
15
  ctc = ht_ctc_chat_var;
 
16
  start();
17
  } else {
18
  try {
19
- if ( document.querySelector('.ht-ctc-chat') ) {
20
- var settings = $('.ht-ctc-chat').attr('data-settings');
21
  ctc = JSON.parse(settings);
22
  }
23
  } catch (e) {
24
  ctc = {};
25
  }
 
26
  start();
27
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
  // start
30
  function start() {
@@ -44,6 +60,10 @@ $(function () {
44
  }
45
 
46
 
 
 
 
 
47
  // fixed position
48
  function ht_ctc() {
49
  console.log('ht_ctc');
@@ -69,7 +89,7 @@ $(function () {
69
 
70
  if ('yes' == ctc.schedule) {
71
  console.log('scheduled');
72
- $(document).trigger('ht_ctc_display', [ctc, display_chat, ht_ctc_chat ]);
73
  } else {
74
  console.log('display directly');
75
  display_chat(ht_ctc_chat);
@@ -165,7 +185,8 @@ $(function () {
165
  console.log('ga');
166
  var tracker = ga.getAll();
167
  tracker[0].send("event", ga_category, ga_action, ga_label);
168
- // ga('send', 'event', ga_category, ga_action, ga_label);
 
169
  } else if (typeof __gaTracker !== "undefined") {
170
  __gaTracker('send', 'event', ga_category, ga_action, ga_label);
171
  }
@@ -210,15 +231,18 @@ $(function () {
210
  // link - chat
211
  function ht_ctc_link(values) {
212
 
213
- console.log(values);
 
 
 
214
  var number = ctc.number;
215
  var pre_filled = ctc.pre_filled;
216
  pre_filled = pre_filled.replace(/\[url]/gi, url);
217
  pre_filled = encodeURIComponent(pre_filled);
218
 
219
- if ( '' == number ) {
220
- // values.innerHTML = values.getAttribute('data-no_number');
221
- $(".ht-ctc-chat").html($(".ht_ctc_no_number").attr('data-no_number'));
222
  return;
223
  }
224
 
@@ -233,6 +257,9 @@ $(function () {
233
 
234
  // analytics
235
  ht_ctc_chat_analytics(values);
 
 
 
236
 
237
  }
238
 
@@ -263,6 +290,9 @@ $(function () {
263
 
264
  // analytics
265
  ht_ctc_chat_analytics(this);
 
 
 
266
  });
267
  }
268
 
@@ -281,6 +311,75 @@ $(function () {
281
  });
282
  }
283
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
  });
285
 
286
  })(jQuery);
9
  var post_title = (typeof document.title !== "undefined" ) ? document.title : '';
10
  // is_mobile yes/no, desktop > 1024
11
  var is_mobile = (typeof screen.width !== "undefined" && screen.width > 1024) ? "no" : "yes";
12
+ var no_num = '';
13
 
14
  var ctc = '';
15
  if ( typeof ht_ctc_chat_var !== "undefined" ) {
16
  ctc = ht_ctc_chat_var;
17
+ chat_data();
18
  start();
19
  } else {
20
  try {
21
+ if ( document.querySelector('.ht_ctc_chat_data') ) {
22
+ var settings = $('.ht_ctc_chat_data').attr('data-settings');
23
  ctc = JSON.parse(settings);
24
  }
25
  } catch (e) {
26
  ctc = {};
27
  }
28
+ chat_data();
29
  start();
30
  }
31
+
32
+ function chat_data() {
33
+
34
+ // if no num
35
+ var chat_data = document.querySelector('.ht_ctc_chat_data');
36
+
37
+ if (chat_data) {
38
+ no_num = $(".ht_ctc_chat_data").attr('data-no_number');
39
+ // remove the element
40
+ chat_data.remove();
41
+ }
42
+
43
+ }
44
 
45
  // start
46
  function start() {
60
  }
61
 
62
 
63
+
64
+
65
+
66
+
67
  // fixed position
68
  function ht_ctc() {
69
  console.log('ht_ctc');
89
 
90
  if ('yes' == ctc.schedule) {
91
  console.log('scheduled');
92
+ $(document).trigger('ht_ctc_ce_display', [ctc, display_chat, ht_ctc_chat ]);
93
  } else {
94
  console.log('display directly');
95
  display_chat(ht_ctc_chat);
185
  console.log('ga');
186
  var tracker = ga.getAll();
187
  tracker[0].send("event", ga_category, ga_action, ga_label);
188
+ // ga('send', 'event', 'check ga_category', 'ga_action', 'ga_label');
189
+ // ga.getAll()[0].send("event", 'check ga_category', 'ga_action', 'ga_label');
190
  } else if (typeof __gaTracker !== "undefined") {
191
  __gaTracker('send', 'event', ga_category, ga_action, ga_label);
192
  }
231
  // link - chat
232
  function ht_ctc_link(values) {
233
 
234
+ console.log(ctc.number);
235
+ $(document).trigger('ht_ctc_ce_number', [ctc]);
236
+ console.log(ctc.number);
237
+
238
  var number = ctc.number;
239
  var pre_filled = ctc.pre_filled;
240
  pre_filled = pre_filled.replace(/\[url]/gi, url);
241
  pre_filled = encodeURIComponent(pre_filled);
242
 
243
+ if ('' == number) {
244
+ console.log('no number');
245
+ $(".ht-ctc-chat").html(no_num);
246
  return;
247
  }
248
 
257
 
258
  // analytics
259
  ht_ctc_chat_analytics(values);
260
+
261
+ // hook
262
+ hook(number);
263
 
264
  }
265
 
290
 
291
  // analytics
292
  ht_ctc_chat_analytics(this);
293
+
294
+ // hook
295
+ hook(number);
296
  });
297
  }
298
 
311
  });
312
  }
313
 
314
+
315
+ function hook(number) {
316
+
317
+ console.log('hook');
318
+
319
+ if (ctc.hook_url) {
320
+
321
+ var h_url = ctc.hook_url;
322
+
323
+ console.log(h_url);
324
+
325
+ var hook_values = {};
326
+
327
+ // hook values
328
+ if (ctc.hook_v) {
329
+
330
+ var hook_values = ctc.hook_v;
331
+
332
+ console.log(typeof hook_values);
333
+ console.log(hook_values);
334
+
335
+ }
336
+
337
+ console.log(h_url);
338
+ console.log(hook_values);
339
+
340
+ $(document).trigger('ht_ctc_ce_hook', [ctc, number]);
341
+
342
+ h_url = ctc.hook_url;
343
+ console.log(h_url);
344
+
345
+ hook_values = ctc.hook_v;
346
+ console.log(hook_values);
347
+
348
+ data = JSON.stringify(hook_values);
349
+
350
+ console.log(data);
351
+ console.log(typeof data);
352
+
353
+
354
+ $.ajax({
355
+ url: h_url,
356
+ type: "POST",
357
+ mode: 'no-cors',
358
+ data: data,
359
+ success: function (response) {
360
+ console.log(response);
361
+ }
362
+ });
363
+
364
+ // fetch(h_url, {
365
+ // method: 'POST',
366
+ // mode: 'no-cors',
367
+ // headers: {
368
+ // 'Content-Type': 'application/json'
369
+ // },
370
+ // body: JSON.stringify(data),
371
+ // }).then(response => {
372
+ // console.log(response);
373
+ // }).catch(e => {
374
+ // console.log(e.message);
375
+ // });
376
+
377
+ }
378
+
379
+
380
+ }
381
+
382
+
383
  });
384
 
385
  })(jQuery);
new/inc/chat/class-ht-ctc-chat.php CHANGED
@@ -56,10 +56,11 @@ class HT_CTC_Chat {
56
  // is mobile
57
  $is_mobile = ht_ctc()->device_type->is_mobile();
58
  // style
59
- $ht_ctc_chat['style_desktop'] = esc_attr( $options['style_desktop'] );
60
- $ht_ctc_chat['style_mobile'] = esc_attr( $options['style_mobile'] );
61
 
62
  // position
 
63
  $default_position = '';
64
  include HT_CTC_PLUGIN_DIR .'new/inc/commons/position-to-place.php';
65
  $ht_ctc_chat['position'] = $position;
@@ -192,6 +193,10 @@ class HT_CTC_Chat {
192
  }
193
  }
194
 
 
 
 
 
195
 
196
  /**
197
  * ctc
@@ -230,11 +235,36 @@ class HT_CTC_Chat {
230
  $ctc['page_display'] = 'hide';
231
  }
232
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
233
 
234
  $ctc = apply_filters( 'ht_ctc_fh_ctc', $ctc );
235
 
236
  // data-attribute - data-settings
237
  $ht_ctc_settings = htmlspecialchars(json_encode($ctc), ENT_QUOTES, 'UTF-8');
 
238
  // localize script - ht_ctc_chat_var
239
  wp_localize_script( 'ht_ctc_app_js', 'ht_ctc_chat_var', $ctc );
240
 
@@ -253,21 +283,6 @@ class HT_CTC_Chat {
253
  ?>
254
  <div class="<?php echo $ht_ctc_chat['class_names'] ?>" id="<?php echo $ht_ctc_chat['id'] ?>"
255
  style="<?php echo $display_css ?> <?php echo $default_position ?>"
256
- data-style="<?php echo $ht_ctc_chat['style'] ?>"
257
- data-number="<?php echo $ht_ctc_chat['number'] ?>"
258
- data-pre_filled="<?php echo $ht_ctc_chat['pre_filled'] ?>"
259
- data-is_ga_enable="<?php echo $ht_ctc_os['is_ga_enable'] ?>"
260
- data-is_fb_pixel="<?php echo $ht_ctc_os['is_fb_pixel'] ?>"
261
- data-ga_ads="<?php echo $ht_ctc_os['ga_ads'] ?>"
262
- data-webandapi="<?php echo $ht_ctc_chat['webandapi'] ?>"
263
- data-display_mobile="<?php echo $ht_ctc_chat['display_mobile'] ?>"
264
- data-display_desktop="<?php echo $ht_ctc_chat['display_desktop'] ?>"
265
- data-css="<?php echo $ht_ctc_chat['css'] ?>"
266
- data-position="<?php echo $ht_ctc_chat['position'] ?>"
267
- data-position_mobile="<?php echo $ht_ctc_chat['position_mobile'] ?>"
268
- data-show_effect="<?php echo $ht_ctc_os['show_effect'] ?>"
269
- data-settings="<?php echo $ht_ctc_settings ?>"
270
- <?php echo $ht_ctc_os['data-attributes'] ?>
271
  <?php echo $on ?>
272
  >
273
  <?php
@@ -284,12 +299,15 @@ class HT_CTC_Chat {
284
  <?php
285
  do_action('ht_ctc_ah_after_fixed_position');
286
 
287
- // if no_number
288
- if ('' == $ht_ctc_chat['number']) {
289
- ?>
290
- <span class="ht_ctc_no_number" data-no_number="<?php echo $no_number ?>"></span>
291
- <?php
292
- }
 
 
 
293
 
294
  }
295
 
56
  // is mobile
57
  $is_mobile = ht_ctc()->device_type->is_mobile();
58
  // style
59
+ $ht_ctc_chat['style_desktop'] = (isset($options['style_desktop'])) ? esc_attr($options['style_desktop']) : '2';
60
+ $ht_ctc_chat['style_mobile'] = (isset($options['style_mobile'])) ? esc_attr($options['style_mobile']) : '2';
61
 
62
  // position
63
+ // default position override at js, but useful in amp pages
64
  $default_position = '';
65
  include HT_CTC_PLUGIN_DIR .'new/inc/commons/position-to-place.php';
66
  $ht_ctc_chat['position'] = $position;
193
  }
194
  }
195
 
196
+
197
+ // webhook
198
+ $hook_url = isset($othersettings['hook_url']) ? esc_attr( $othersettings['hook_url'] ) : '';
199
+
200
 
201
  /**
202
  * ctc
235
  $ctc['page_display'] = 'hide';
236
  }
237
 
238
+ // webhook
239
+ if ( '' !== $hook_url ) {
240
+
241
+ // $ctc hook url
242
+ $ctc['hook_url'] = $hook_url;
243
+
244
+ $hook_v = isset($othersettings['hook_v']) ? $othersettings['hook_v'] : '';
245
+
246
+ if ( is_array($hook_v) ) {
247
+
248
+ $hook_v = array_filter($hook_v);
249
+ $hook_v = array_values($hook_v);
250
+ $hook_v = array_map('esc_attr', $hook_v );
251
+
252
+ if ( isset($hook_v[0]) ) {
253
+ // $ctc - hook values
254
+ $ctc['hook_v'] = $hook_v;
255
+ }
256
+
257
+ }
258
+
259
+
260
+ }
261
+
262
 
263
  $ctc = apply_filters( 'ht_ctc_fh_ctc', $ctc );
264
 
265
  // data-attribute - data-settings
266
  $ht_ctc_settings = htmlspecialchars(json_encode($ctc), ENT_QUOTES, 'UTF-8');
267
+
268
  // localize script - ht_ctc_chat_var
269
  wp_localize_script( 'ht_ctc_app_js', 'ht_ctc_chat_var', $ctc );
270
 
283
  ?>
284
  <div class="<?php echo $ht_ctc_chat['class_names'] ?>" id="<?php echo $ht_ctc_chat['id'] ?>"
285
  style="<?php echo $display_css ?> <?php echo $default_position ?>"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
  <?php echo $on ?>
287
  >
288
  <?php
299
  <?php
300
  do_action('ht_ctc_ah_after_fixed_position');
301
 
302
+
303
+ // if js var not available, dont depend on this element ht_ctc_chat_data
304
+ // no_number may be needed.
305
+ ?>
306
+ <span class="ht_ctc_chat_data"
307
+ data-no_number="<?php echo $no_number ?>"
308
+ data-settings="<?php echo $ht_ctc_settings ?>"
309
+ ></span>
310
+ <?php
311
 
312
  }
313
 
new/inc/commons/class-ht-ctc-scripts.php CHANGED
@@ -26,8 +26,8 @@ class HT_CTC_Scripts {
26
  $load_app_js_bottom = apply_filters( 'ht_ctc_fh_load_app_js_bottom', true );
27
 
28
  // js
29
- $js = 'app.js';
30
- // $js = '325.app.js';
31
  $group_js = 'group.js';
32
  $share_js = 'share.js';
33
 
26
  $load_app_js_bottom = apply_filters( 'ht_ctc_fh_load_app_js_bottom', true );
27
 
28
  // js
29
+ // $js = 'app.js';
30
+ $js = '331.app.js';
31
  $group_js = 'group.js';
32
  $share_js = 'share.js';
33
 
new/inc/commons/class-ht-ctc-values.php CHANGED
@@ -23,15 +23,15 @@ class HT_CTC_Values {
23
  *
24
  * @var array get_options ht_ctc_main_options
25
  */
26
- public $ctc_main_options;
27
 
28
  public function __construct() {
29
- $this->ctc_main_options_fn();
30
  }
31
 
32
  // main options
33
- public function ctc_main_options_fn() {
34
- $this->ctc_main_options = get_option('ht_ctc_main_options');
35
  }
36
 
37
 
23
  *
24
  * @var array get_options ht_ctc_main_options
25
  */
26
+ public $ctc_chat;
27
 
28
  public function __construct() {
29
+ $this->ctc_chat_fn();
30
  }
31
 
32
  // main options
33
+ public function ctc_chat_fn() {
34
+ $this->ctc_chat = get_option('ht_ctc_chat_options');
35
  }
36
 
37
 
new/inc/styles-shortcode/sc-style-1.php CHANGED
@@ -28,5 +28,5 @@ if ( '' == $call_to_action ) {
28
 
29
 
30
  $o .= '
31
- <button '.$s1_style.' class="ctc-analytics">'.$call_to_action.'</button>
32
  ';
28
 
29
 
30
  $o .= '
31
+ <button '.$s1_style.' class="ctc-analytics ctc_cta">'.$call_to_action.'</button>
32
  ';
new/inc/styles-shortcode/sc-style-2.php CHANGED
@@ -14,5 +14,5 @@ $s2_img_link = plugins_url( './new/inc/assets/img/whatsapp-icon-square.svg', HT_
14
 
15
 
16
  $o .= '
17
- <img class="img-icon ctc-analytics" title="'.$call_to_action.'" style="height: '.$s2_img_size.';" src="'.$s2_img_link.'" alt="'.$call_to_action.'">
18
  ';
14
 
15
 
16
  $o .= '
17
+ <img class="img-icon ctc-analytics ctc_cta" title="'.$call_to_action.'" style="height: '.$s2_img_size.';" src="'.$s2_img_link.'" alt="'.$call_to_action.'">
18
  ';
new/inc/styles-shortcode/sc-style-3.php CHANGED
@@ -21,7 +21,7 @@ include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/ht-ctc-svg-images.php';
21
 
22
  $s3_simple = '';
23
  $s3_simple .= '
24
- <img class="img-icon ctc-analytics" title="'.$call_to_action.'" style="display: inline-block; height: '.$img_size.';" src="'.$s3_img_link.'" alt="'.$call_to_action.'">
25
  ';
26
 
27
  $o .= $s3_simple;
21
 
22
  $s3_simple = '';
23
  $s3_simple .= '
24
+ <img class="img-icon ctc-analytics ctc_cta" title="'.$call_to_action.'" style="display: inline-block; height: '.$img_size.';" src="'.$s3_img_link.'" alt="'.$call_to_action.'">
25
  ';
26
 
27
  $o .= $s3_simple;
new/inc/styles-shortcode/sc-style-4.php CHANGED
@@ -54,7 +54,7 @@ if ( '' == $s4_img_url ) {
54
  }
55
 
56
  $o .= '
57
- <div class="chip ctc-analytics" style="'.$s4_chip_css.'">
58
  '.$s4_img.'
59
  <span>'.$call_to_action.'</span>
60
  </div>
54
  }
55
 
56
  $o .= '
57
+ <div class="chip ctc-analytics ctc_cta" style="'.$s4_chip_css.'">
58
  '.$s4_img.'
59
  <span>'.$call_to_action.'</span>
60
  </div>
new/inc/styles-shortcode/sc-style-5.php CHANGED
@@ -77,7 +77,7 @@ $o .= '
77
  <div class="s5_cta ctc-analytics" style="'.$s5_cta_style.'" >
78
  <img class="s5_img ctc-analytics" src="'.$s5_img.'" style="'.$s5_img_style.'" alt="'.$call_to_action.'">
79
  <div class="s5_content '.$s5_img_position.'" style="'.$s5_content_style.'" >
80
- <span class="heading ctc-analytics" style="color: '.$s5_line_1_color.'">'.$s5_line_1.'</span>
81
  <span class="description ctc-analytics" style="color: '.$s5_line_2_color.'">'.$s5_line_2.'</span>
82
  </div>
83
  </div>
77
  <div class="s5_cta ctc-analytics" style="'.$s5_cta_style.'" >
78
  <img class="s5_img ctc-analytics" src="'.$s5_img.'" style="'.$s5_img_style.'" alt="'.$call_to_action.'">
79
  <div class="s5_content '.$s5_img_position.'" style="'.$s5_content_style.'" >
80
+ <span class="heading ctc-analytics ctc_cta" style="color: '.$s5_line_1_color.'">'.$s5_line_1.'</span>
81
  <span class="description ctc-analytics" style="color: '.$s5_line_2_color.'">'.$s5_line_2.'</span>
82
  </div>
83
  </div>
new/inc/styles-shortcode/sc-style-6.php CHANGED
@@ -17,7 +17,7 @@ $input_onhover_out = "this.style.color='$s6_txt_color', this.style.textDecoratio
17
 
18
 
19
  $o .= '
20
- <a class="ctc-analytics" style="color: '.$s6_txt_color.'; text-decoration: '.$s6_txt_decoration.';"
21
  onmouseover = "'.$input_onhover.'"
22
  onmouseout = "'.$input_onhover_out.'"
23
  >
17
 
18
 
19
  $o .= '
20
+ <a class="ctc-analytics ctc_cta" style="color: '.$s6_txt_color.'; text-decoration: '.$s6_txt_decoration.';"
21
  onmouseover = "'.$input_onhover.'"
22
  onmouseout = "'.$input_onhover_out.'"
23
  >
new/inc/styles-shortcode/sc-style-7.php CHANGED
@@ -64,7 +64,7 @@ $o .= '</style>';
64
 
65
  $o .= '
66
  <div '.$title.' class="ctc_s_7 ctc-analytics" style="'.$s7_n1_styles.'">
67
- <p class="ctc_s_7_cta ctc-analytics '.$s7_cta_class.'" style="'.$s7_cta_css.'">'.$call_to_action.'</p>
68
  <div class="ctc_s_7_icon_padding ctc-analytics " style="'.$s7_icon_css.'">
69
  '.$style_7_svg.'
70
  </div>
64
 
65
  $o .= '
66
  <div '.$title.' class="ctc_s_7 ctc-analytics" style="'.$s7_n1_styles.'">
67
+ <p class="ctc_s_7_cta ctc-analytics ctc_cta '.$s7_cta_class.'" style="'.$s7_cta_css.'">'.$call_to_action.'</p>
68
  <div class="ctc_s_7_icon_padding ctc-analytics " style="'.$s7_icon_css.'">
69
  '.$style_7_svg.'
70
  </div>
new/inc/styles-shortcode/sc-style-7_1.php CHANGED
@@ -54,7 +54,7 @@ $o .= '</style>';
54
 
55
  $o .= '
56
  <div class="ctc_s_7_1 ctc-analytics" style="'.$s7_n1_styles.'">
57
- <p class="ctc_s_7_1_cta ctc-analytics '.$s7_cta_class.'" style="'.$s7_cta_css.'">'.$call_to_action.'</p>
58
  <div class="ctc_s_7_icon_padding ctc-analytics " style="'.$s7_icon_padding_css.'">
59
  '.$style_7_1_svg.'
60
  </div>
54
 
55
  $o .= '
56
  <div class="ctc_s_7_1 ctc-analytics" style="'.$s7_n1_styles.'">
57
+ <p class="ctc_s_7_1_cta ctc-analytics ctc_cta '.$s7_cta_class.'" style="'.$s7_cta_css.'">'.$call_to_action.'</p>
58
  <div class="ctc_s_7_icon_padding ctc-analytics " style="'.$s7_icon_padding_css.'">
59
  '.$style_7_1_svg.'
60
  </div>
new/inc/styles-shortcode/sc-style-8.php CHANGED
@@ -70,7 +70,7 @@ $o .= '
70
  <div class="ht-ctc-style-8 ctc-analytics" style="display: inline-block; '.$s8_width_css.' " >
71
  <span class="s_8 waves-effect waves-light ctc-analytics" style="'.$s8_main_span_css.' ">
72
  '.$style_8_svg.'
73
- <span class="ht-ctc-s8-text s8_span ctc-analytics" style="'.$s8_text_css.'">
74
  '.$call_to_action.'
75
  </span>
76
  </span>
70
  <div class="ht-ctc-style-8 ctc-analytics" style="display: inline-block; '.$s8_width_css.' " >
71
  <span class="s_8 waves-effect waves-light ctc-analytics" style="'.$s8_main_span_css.' ">
72
  '.$style_8_svg.'
73
+ <span class="ht-ctc-s8-text s8_span ctc-analytics ctc_cta" style="'.$s8_text_css.'">
74
  '.$call_to_action.'
75
  </span>
76
  </span>
new/inc/styles-shortcode/sc-style-99.php CHANGED
@@ -51,5 +51,5 @@ if ( '' == $s99_own_image ) {
51
 
52
 
53
  $o .= '
54
- <img class="own-img ctc-analytics" title="'.$call_to_action.'" id="style-99" src="'.$s99_own_image.'" style="'.$s99_img_css.'" alt="'.$call_to_action.'">
55
  ';
51
 
52
 
53
  $o .= '
54
+ <img class="own-img ctc-analytics ctc_cta" title="'.$call_to_action.'" id="style-99" src="'.$s99_own_image.'" style="'.$s99_img_css.'" alt="'.$call_to_action.'">
55
  ';
new/inc/styles/style-1.php CHANGED
@@ -34,4 +34,4 @@ if ( isset( $s1_options['s1_m_fullwidth'] ) ) {
34
  }
35
 
36
  ?>
37
- <button <?php echo $s1_style; ?> class="ctc-analytics s1_btn"><?php echo $call_to_action ?></button>
34
  }
35
 
36
  ?>
37
+ <button <?php echo $s1_style; ?> class="ctc-analytics s1_btn ctc_cta"><?php echo $call_to_action ?></button>
new/inc/styles/style-2.php CHANGED
@@ -58,6 +58,6 @@ $ht_ctc_svg_css = "pointer-events:none; display:block; height:$img_size; width:$
58
  include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/ht-ctc-svg-images.php';
59
  ?>
60
  <div <?php echo $title ?> style="<?php echo $s2_css; ?>" class="ctc-analytics">
61
- <p class="ctc-analytics <?php echo $s2_cta_class ?>" style="<?php echo $s2_cta_css ?>"><?php echo $call_to_action; ?></p>
62
  <?php echo ht_ctc_style_2_svg( $img_size, $type, $ht_ctc_svg_css ); ?>
63
  </div>
58
  include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/ht-ctc-svg-images.php';
59
  ?>
60
  <div <?php echo $title ?> style="<?php echo $s2_css; ?>" class="ctc-analytics">
61
+ <p class="ctc-analytics ctc_cta <?php echo $s2_cta_class ?>" style="<?php echo $s2_cta_css ?>"><?php echo $call_to_action; ?></p>
62
  <?php echo ht_ctc_style_2_svg( $img_size, $type, $ht_ctc_svg_css ); ?>
63
  </div>
new/inc/styles/style-3.php CHANGED
@@ -60,6 +60,6 @@ include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/ht-ctc-svg-images.php';
60
 
61
  ?>
62
  <div <?php echo $title ?> style="<?php echo $s3_css ?>">
63
- <p class="ctc-analytics <?php echo $s3_cta_class ?>" style="<?php echo $s3_cta_css ?>"><?php echo $call_to_action; ?></p>
64
  <?php echo ht_ctc_style_3_svg( $img_size, $type, $ht_ctc_svg_css ); ?>
65
  </div>
60
 
61
  ?>
62
  <div <?php echo $title ?> style="<?php echo $s3_css ?>">
63
+ <p class="ctc-analytics ctc_cta <?php echo $s3_cta_class ?>" style="<?php echo $s3_cta_css ?>"><?php echo $call_to_action; ?></p>
64
  <?php echo ht_ctc_style_3_svg( $img_size, $type, $ht_ctc_svg_css ); ?>
65
  </div>
new/inc/styles/style-3_1.php CHANGED
@@ -84,7 +84,7 @@ $others = array(
84
  </style>
85
 
86
  <div <?php echo $title ?> style="<?php echo $s3_1_css ?>">
87
- <p class="ctc-analytics <?php echo $s3_1_cta_class ?>" style="<?php echo $s3_1_cta_css ?>"><?php echo $call_to_action ?></p>
88
  <div class="ctc-analytics ht_ctc_padding" style="<?php echo $s3_1_extend_css ?>">
89
  <?php echo ht_ctc_style_3_1_svg( $img_size, $type, $ht_ctc_svg_css, $others ); ?>
90
  </div>
84
  </style>
85
 
86
  <div <?php echo $title ?> style="<?php echo $s3_1_css ?>">
87
+ <p class="ctc-analytics ctc_cta <?php echo $s3_1_cta_class ?>" style="<?php echo $s3_1_cta_css ?>"><?php echo $call_to_action ?></p>
88
  <div class="ctc-analytics ht_ctc_padding" style="<?php echo $s3_1_extend_css ?>">
89
  <?php echo ht_ctc_style_3_1_svg( $img_size, $type, $ht_ctc_svg_css, $others ); ?>
90
  </div>
new/inc/styles/style-4.php CHANGED
@@ -60,5 +60,5 @@ $ht_ctc_svg_css = "pointer-events:none; display: block; height:$s4_img_size; wid
60
  <?php
61
  }
62
  ?>
63
- <span><?php echo $call_to_action ?></span>
64
  </div>
60
  <?php
61
  }
62
  ?>
63
+ <span class="ctc_cta"><?php echo $call_to_action ?></span>
64
  </div>
new/inc/styles/style-5.php CHANGED
@@ -74,7 +74,7 @@ echo $o;
74
  <div class="s5_cta" style="<?php echo $s5_cta_style ?>" >
75
  <img class="s5_img ctc-analytics" src="<?php echo $s5_img ?>" style="<?php echo $s5_img_style ?>" alt="<?php echo $call_to_action ?>">
76
  <div class="s5_content ctc-analytics <?php echo $s5_img_position ?>" style="<?php echo $s5_content_style ?>" >
77
- <span class="heading ctc-analytics" style="color: <?php echo $s5_line_1_color ?>"><?php echo $s5_line_1 ?></span>
78
  <span class="description ctc-analytics" style="color: <?php echo $s5_line_2_color ?>"><?php echo $s5_line_2 ?></span>
79
  </div>
80
  </div>
74
  <div class="s5_cta" style="<?php echo $s5_cta_style ?>" >
75
  <img class="s5_img ctc-analytics" src="<?php echo $s5_img ?>" style="<?php echo $s5_img_style ?>" alt="<?php echo $call_to_action ?>">
76
  <div class="s5_content ctc-analytics <?php echo $s5_img_position ?>" style="<?php echo $s5_content_style ?>" >
77
+ <span class="heading ctc-analytics ctc_cta" style="color: <?php echo $s5_line_1_color ?>"><?php echo $s5_line_1 ?></span>
78
  <span class="description ctc-analytics" style="color: <?php echo $s5_line_2_color ?>"><?php echo $s5_line_2 ?></span>
79
  </div>
80
  </div>
new/inc/styles/style-6.php CHANGED
@@ -17,7 +17,7 @@ $s6_txt_decoration = esc_attr( $s6_options['s6_txt_decoration'] );
17
  $s6_txt_decoration_on_hover = esc_attr( $s6_options['s6_txt_decoration_on_hover'] );
18
  ?>
19
 
20
- <a class="ctc-analytics" style="color: <?php echo $s6_txt_color ?>; text-decoration: <?php echo $s6_txt_decoration ?>;"
21
  onmouseover = "this.style.color = '<?php echo $s6_txt_color_on_hover ?>', this.style.textDecoration = '<?php echo $s6_txt_decoration_on_hover ?>' "
22
  onmouseout = "this.style.color = '<?php echo $s6_txt_color ?>', this.style.textDecoration = '<?php echo $s6_txt_decoration ?>' "
23
  >
17
  $s6_txt_decoration_on_hover = esc_attr( $s6_options['s6_txt_decoration_on_hover'] );
18
  ?>
19
 
20
+ <a class="ctc-analytics ctc_cta" style="color: <?php echo $s6_txt_color ?>; text-decoration: <?php echo $s6_txt_decoration ?>;"
21
  onmouseover = "this.style.color = '<?php echo $s6_txt_color_on_hover ?>', this.style.textDecoration = '<?php echo $s6_txt_decoration_on_hover ?>' "
22
  onmouseout = "this.style.color = '<?php echo $s6_txt_color ?>', this.style.textDecoration = '<?php echo $s6_txt_decoration ?>' "
23
  >
new/inc/styles/style-7.php CHANGED
@@ -75,7 +75,7 @@ include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/ht-ctc-svg-images.php';
75
  <?php echo $s7_hover_icon_styles ?>
76
  </style>
77
 
78
- <div <?php echo $title ?> class="ctc_s_7 ctc-analytics" style="<?php echo $s7_n1_styles; ?>">
79
  <p class="ctc_s_7_cta ctc-analytics <?php echo $s7_cta_class ?>" style="<?php echo $s7_cta_css ?>"><?php echo $call_to_action; ?></p>
80
  <div class="ctc_s_7_icon_padding ctc-analytics " style="<?php echo $s7_icon_css ?>">
81
  <?php echo ht_ctc_singlecolor( $s7_svg_attrs ); ?>
75
  <?php echo $s7_hover_icon_styles ?>
76
  </style>
77
 
78
+ <div <?php echo $title ?> class="ctc_s_7 ctc-analytics ctc_cta" style="<?php echo $s7_n1_styles; ?>">
79
  <p class="ctc_s_7_cta ctc-analytics <?php echo $s7_cta_class ?>" style="<?php echo $s7_cta_css ?>"><?php echo $call_to_action; ?></p>
80
  <div class="ctc_s_7_icon_padding ctc-analytics " style="<?php echo $s7_icon_css ?>">
81
  <?php echo ht_ctc_singlecolor( $s7_svg_attrs ); ?>
new/inc/styles/style-7_1.php CHANGED
@@ -95,7 +95,7 @@ include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/ht-ctc-svg-images.php';
95
  </style>
96
 
97
  <div class="ctc_s_7_1 ctc-analytics" style="<?php echo $s7_n1_styles; ?>">
98
- <p class="ctc_s_7_1_cta ctc-analytics <?php echo $s7_cta_class ?>" style="<?php echo $s7_cta_css ?>"><?php echo $call_to_action; ?></p>
99
  <div class="ctc_s_7_icon_padding ctc-analytics " style="<?php echo $s7_icon_padding_css ?>">
100
  <?php echo ht_ctc_singlecolor( $s7_svg_attrs ); ?>
101
  </div>
95
  </style>
96
 
97
  <div class="ctc_s_7_1 ctc-analytics" style="<?php echo $s7_n1_styles; ?>">
98
+ <p class="ctc_s_7_1_cta ctc-analytics ctc_cta <?php echo $s7_cta_class ?>" style="<?php echo $s7_cta_css ?>"><?php echo $call_to_action; ?></p>
99
  <div class="ctc_s_7_icon_padding ctc-analytics " style="<?php echo $s7_icon_padding_css ?>">
100
  <?php echo ht_ctc_singlecolor( $s7_svg_attrs ); ?>
101
  </div>
new/inc/styles/style-8.php CHANGED
@@ -66,7 +66,7 @@ $s8_main_span_css = "display: flex; $rtl_css padding: 0 2rem;letter-spacing: .5p
66
  echo ht_ctc_singlecolor( $s8_svg_attrs );
67
  }
68
  ?>
69
- <span class="ht-ctc-s8-text s8_span ctc-analytics" style="<?php echo $s8_text_css; ?>">
70
  <?php echo $call_to_action ?>
71
  </span>
72
  </span>
66
  echo ht_ctc_singlecolor( $s8_svg_attrs );
67
  }
68
  ?>
69
+ <span class="ht-ctc-s8-text s8_span ctc-analytics ctc_cta" style="<?php echo $s8_text_css; ?>">
70
  <?php echo $call_to_action ?>
71
  </span>
72
  </span>
new/inc/styles/style-99.php CHANGED
@@ -39,4 +39,4 @@ if ( '' == $s99_own_image ) {
39
 
40
  ?>
41
 
42
- <img class="own-img ctc-analytics" title="<?php echo $call_to_action ?>" id="style-99" src="<?php echo $s99_own_image ?>" style="<?php echo $s99_img_css ?>" alt="<?php echo $call_to_action ?>">
39
 
40
  ?>
41
 
42
+ <img class="own-img ctc-analytics ctc_cta" title="<?php echo $call_to_action ?>" id="style-99" src="<?php echo $s99_own_image ?>" style="<?php echo $s99_img_css ?>" alt="<?php echo $call_to_action ?>">
prev/inc/class-ht-ccw.php CHANGED
@@ -124,9 +124,9 @@ class HT_CCW {
124
  */
125
  private function hooks() {
126
 
127
- register_activation_hook( __FILE__, array( 'HT_CCW_Register', 'activate' ) );
128
- register_deactivation_hook( __FILE__, array( 'HT_CCW_Register', 'deactivate' ) );
129
- register_uninstall_hook(__FILE__, array( 'HT_CCW_Register', 'uninstall' ) );
130
 
131
  // initilaze classes
132
  if ( ! is_admin() ) {
124
  */
125
  private function hooks() {
126
 
127
+ register_activation_hook( HT_CTC_PLUGIN_FILE, array( 'HT_CCW_Register', 'activate' ) );
128
+ register_deactivation_hook( HT_CTC_PLUGIN_FILE, array( 'HT_CCW_Register', 'deactivate' ) );
129
+ register_uninstall_hook(HT_CTC_PLUGIN_FILE, array( 'HT_CCW_Register', 'uninstall' ) );
130
 
131
  // initilaze classes
132
  if ( ! is_admin() ) {
readme.txt CHANGED
@@ -3,19 +3,19 @@ Requires at least: 4.6
3
  Tested up to: 5.7
4
  Requires PHP: 5.6
5
  Contributors: holithemes
6
- Stable tag: 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
10
 
11
- WhatsApp connectivity for WordPress websites! Engage customers and generate leads!
12
 
13
  == Description ==
14
 
15
- WhatsApp connectivity for WordPress websites! Engage customers and generate leads!
16
-
17
  Let's make your Web page visitors Contact you through "WhatsApp", "WhatsApp Business" with a single Click (WhatsApp Chat, Group, Share)
18
 
 
 
19
  [Demo](https://holithemes.com/plugins/click-to-chat/list-of-styles/) | [Documentation](https://holithemes.com/plugins/click-to-chat/)
20
 
21
  == WhatsApp Chat ==
@@ -33,7 +33,7 @@ Select a Style that matches your Website design.
33
 
34
  * 8 pre-defined style/designs
35
  * Add your own Image/GIF
36
- * Custom Element
37
  * Shortcodes
38
  * Select different Styles for Mobile, Desktop
39
  * All pre-defined styles are customizable
@@ -51,9 +51,10 @@ Instead of selecting a pre-defined style, add any Image/Animated-image/GIF.
51
  = 🌈 Custom Element =
52
 
53
  Create your own Element/Desing and just add
54
- * Class name: 'ctc_chat' (or)
55
- * Id name: 'ctc_chat' (or)
56
- * Href/link: '#ctc_chat'
 
57
  The custom design will navigate to WhatsApp based on plugin settings (WhatsApp Number, pre-filled message, .... ).
58
 
59
  [Custom Element](https://holithemes.com/plugins/click-to-chat/custom-element/?utm_source=wp&utm_medium=readme&utm_campaign=ht)
@@ -114,6 +115,11 @@ Creates an Event when the user clicks on the WhatsApp Icon/button.
114
 
115
  [Google Ads Conversations](https://holithemes.com/plugins/click-to-chat/google-ads-conversion/?utm_source=wp&utm_medium=readme&utm_campaign=ht)
116
 
 
 
 
 
 
117
 
118
  = 🔆 Localization =
119
 
@@ -419,6 +425,10 @@ After Activate the plugin, add WhatsApp Number at plugin settings.
419
 
420
  == Changelog ==
421
 
 
 
 
 
422
  = 3.3 =
423
  * New: Custom Element/Design, Create an element/design and add
424
  * Class name: ctc_chat (or)
3
  Tested up to: 5.7
4
  Requires PHP: 5.6
5
  Contributors: holithemes
6
+ Stable tag: 3.3.1
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
10
 
11
+ Let's make your Web page visitors Contact you through "WhatsApp", "WhatsApp Business"
12
 
13
  == Description ==
14
 
 
 
15
  Let's make your Web page visitors Contact you through "WhatsApp", "WhatsApp Business" with a single Click (WhatsApp Chat, Group, Share)
16
 
17
+ WhatsApp connectivity for WordPress websites! Engage customers and generate leads!
18
+
19
  [Demo](https://holithemes.com/plugins/click-to-chat/list-of-styles/) | [Documentation](https://holithemes.com/plugins/click-to-chat/)
20
 
21
  == WhatsApp Chat ==
33
 
34
  * 8 pre-defined style/designs
35
  * Add your own Image/GIF
36
+ * Custom Element/Design
37
  * Shortcodes
38
  * Select different Styles for Mobile, Desktop
39
  * All pre-defined styles are customizable
51
  = 🌈 Custom Element =
52
 
53
  Create your own Element/Desing and just add
54
+ * Class name: 'ctc_chat' (or)
55
+ * Id name: 'ctc_chat' (or)
56
+ * Href/link: '#ctc_chat'
57
+
58
  The custom design will navigate to WhatsApp based on plugin settings (WhatsApp Number, pre-filled message, .... ).
59
 
60
  [Custom Element](https://holithemes.com/plugins/click-to-chat/custom-element/?utm_source=wp&utm_medium=readme&utm_campaign=ht)
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
121
+
122
+ [Webhooks](https://holithemes.com/plugins/click-to-chat/webhooks)
123
 
124
  = 🔆 Localization =
125
 
425
 
426
  == Changelog ==
427
 
428
+ = 3.3.1 =
429
+ * New: Webhooks
430
+ * Enchantment: position to place settings
431
+
432
  = 3.3 =
433
  * New: Custom Element/Design, Create an element/design and add
434
  * Class name: ctc_chat (or)