Click to Chat for WhatsApp Chat - Version 3.9.5

Version Description

  • Fix: display settings for custom post types
Download this release

Release Info

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

Code changes from version 3.9.2 to 3.9.5

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.9.2
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.9.2' );
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.9.5
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.9.5' );
21
  }
22
 
23
  // define HT_CTC_PLUGIN_FILE
common/class-ht-ctc-switch.php CHANGED
@@ -55,12 +55,13 @@ class HT_CTC_Swift {
55
  $user = '';
56
 
57
 
58
- // if first time user - new interface .. $is_new = 'yes';
59
- // if user swifted to new interface .. $is_new = 'yes';
60
-
61
- // if user swifted to prev interface .. $is_new = 'no';
62
- // if prev user / update .. $is_new = 'no';
63
-
 
64
  $ccw_options = get_option('ccw_options');
65
 
66
  if ( isset( $ccw_options['number'] ) ) {
55
  $user = '';
56
 
57
 
58
+ /**
59
+ * if first time user - new interface .. $is_new = 'yes';
60
+ * if user swifted to new interface .. $is_new = 'yes';
61
+ *
62
+ * if user swifted to prev interface .. $is_new = 'no';
63
+ * if prev user / update .. $is_new = 'no';
64
+ */
65
  $ccw_options = get_option('ccw_options');
66
 
67
  if ( isset( $ccw_options['number'] ) ) {
new/admin/admin.php CHANGED
@@ -28,6 +28,9 @@ include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-scripts.php';
28
  // Main, Chat admin page
29
  include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-main-page.php';
30
 
 
 
 
31
  do_action('ht_ctc_ah_admin_includes_after_main_page' );
32
 
33
  // group admin page
@@ -43,9 +46,6 @@ if ( isset ( $ht_ctc_othersettings['enable_share'] ) ) {
43
  // customize
44
  include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-customize-styles.php';
45
 
46
- // greetings
47
- include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-greetings-page.php';
48
-
49
  // other settings - enable options ..
50
  include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-other-settings.php';
51
 
28
  // Main, Chat admin page
29
  include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-main-page.php';
30
 
31
+ // greetings
32
+ include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-greetings-page.php';
33
+
34
  do_action('ht_ctc_ah_admin_includes_after_main_page' );
35
 
36
  // group admin page
46
  // customize
47
  include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-customize-styles.php';
48
 
 
 
 
49
  // other settings - enable options ..
50
  include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-other-settings.php';
51
 
new/admin/admin_assets/css/admin.css CHANGED
@@ -85,7 +85,7 @@
85
  }
86
 
87
  .sticky-sidebar .sidebar-content {
88
- margin-top: 70px;
89
  margin-left: 80px;
90
  }
91
  }
85
  }
86
 
87
  .sticky-sidebar .sidebar-content {
88
+ margin-top: 12px;
89
  margin-left: 80px;
90
  }
91
  }
new/admin/admin_assets/js/admin.js CHANGED
@@ -64,6 +64,12 @@ document.addEventListener('DOMContentLoaded', function () {
64
  collapsible();
65
  } catch (e) { }
66
 
 
 
 
 
 
 
67
 
68
  // show/hide settings
69
  function show_hide_options() {
64
  collapsible();
65
  } catch (e) { }
66
 
67
+ try {
68
+ $(".ctc_sortable").sortable({
69
+ cursor: "move"
70
+ });
71
+ } catch (e) { }
72
+
73
 
74
  // show/hide settings
75
  function show_hide_options() {
new/admin/admin_commons/admin-sidebar-content.php CHANGED
@@ -52,9 +52,9 @@ $othersettings = get_option('ht_ctc_othersettings');
52
  <p class="description">&emsp;selected time range in a day</p>
53
  <p class="description">&emsp;website visitor login status</p>
54
  <p class="description">Fixed/Absolute Position types</p>
55
- <p class="description">Page level settings: style, time, scroll dealy</p>
56
  <p class="description">Add WhatsApp in WooCommerce Product pages</p>
57
- <p class="description">Greetings time, scroll actions</p>
 
58
  <p class="description">More features</p>
59
 
60
  <p class="description" style="text-align: center; position:sticky; bottom:2px; margin-top:20px;"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/pricing/" class="waves-effect waves-light btn" style="width: 100%;">PRO Version</a></p>
52
  <p class="description">&emsp;selected time range in a day</p>
53
  <p class="description">&emsp;website visitor login status</p>
54
  <p class="description">Fixed/Absolute Position types</p>
 
55
  <p class="description">Add WhatsApp in WooCommerce Product pages</p>
56
+ <p class="description">Greetings Actions: Time, scroll, click, Viewport</p>
57
+ <p class="description">Page level settings: style, time, scroll, Greetings</p>
58
  <p class="description">More features</p>
59
 
60
  <p class="description" style="text-align: center; position:sticky; bottom:2px; margin-top:20px;"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/pricing/" class="waves-effect waves-light btn" style="width: 100%;">PRO Version</a></p>
new/admin/admin_commons/class-ht-ctc-admin-hooks.php CHANGED
@@ -170,7 +170,7 @@ class HT_CTC_Admin_Others {
170
 
171
  }
172
 
173
- // // todo -remove this.. - added here for testing..
174
  // add_action('admin_notices', array( $this, 'pro_notice') );
175
  // add_action('admin_footer', array( $this, 'admin_pro_notice_scripts') );
176
 
@@ -206,10 +206,10 @@ class HT_CTC_Admin_Others {
206
 
207
  function pro_notice() {
208
  ?>
209
- <div class="notice notice-info is-dismissible ht-ctc-notice-pro-banner" data-db="pro_banner" style="display:flex; flex-direction:column; padding:14px; background-color:#253142; border-color:#253142; color:#f7d070; border-radius:5px;">
210
- <p style="margin:0; font-size:1.4rem; color:#1d2327; font-weight:600; color:#f7d070;">Click to Chat - PRO</p>
211
- <p style="margin:0 0 2px; color:#f7d070; font-size:1.1rem;">
212
- Upgrade to Click to Chat PRO. Includes features like Random Number, Form filling, Webhooks, Business hours, Display based on time range, days in a week, time dealy, scroll delay, login status
213
  </p>
214
  <p>
215
  <a class="button button-primary" style="padding:2px 15px;" href="https://holithemes.com/plugins/click-to-chat/pricing/" target="_blank">Buy Now</a>
170
 
171
  }
172
 
173
+ // // todo -comment this.. - added here for testing..
174
  // add_action('admin_notices', array( $this, 'pro_notice') );
175
  // add_action('admin_footer', array( $this, 'admin_pro_notice_scripts') );
176
 
206
 
207
  function pro_notice() {
208
  ?>
209
+ <div class="notice notice-info is-dismissible ht-ctc-notice-pro-banner" data-db="pro_banner" style="display:flex; flex-direction:column; padding:14px; border-radius:5px;">
210
+ <p style="margin:0; font-size:1.4rem; color:#1d2327; font-weight:600;">Click to Chat - PRO</p>
211
+ <p style="margin:0 0 2px;">
212
+ Random Number, <strong>Form filling</strong>, Webhooks, Business hours, Display based on time range, days in a week, time dealy, scroll delay, login status and much more.
213
  </p>
214
  <p>
215
  <a class="button button-primary" style="padding:2px 15px;" href="https://holithemes.com/plugins/click-to-chat/pricing/" target="_blank">Buy Now</a>
new/admin/admin_commons/class-ht-ctc-metabox.php CHANGED
@@ -160,6 +160,11 @@ class HT_CTC_MetaBox {
160
  return $post_id;
161
  }
162
 
 
 
 
 
 
163
  if ( isset( $_POST['ht_ctc_pagelevel'] ) ) {
164
 
165
  $ht_ctc_pagelevel = array_filter( $_POST['ht_ctc_pagelevel'] );
@@ -171,8 +176,12 @@ class HT_CTC_MetaBox {
171
  if( isset( $ht_ctc_pagelevel[$key] ) ) {
172
  if ( 'pre_filled' == $key ) {
173
  $new[$key] = sanitize_textarea_field( $ht_ctc_pagelevel[$key] );
174
- } elseif ( 'call_to_action' == $key ) {
175
  $new[$key] = sanitize_text_field( $ht_ctc_pagelevel[$key] );
 
 
 
 
176
  } else {
177
  $new[$key] = sanitize_text_field( $ht_ctc_pagelevel[$key] );
178
  }
160
  return $post_id;
161
  }
162
 
163
+ include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/ht-ctc-admin-formatting.php';
164
+
165
+ $editor = [];
166
+ $editor = apply_filters( 'ht_ctc_fh_greetings_setting_meta_editor', $editor );
167
+
168
  if ( isset( $_POST['ht_ctc_pagelevel'] ) ) {
169
 
170
  $ht_ctc_pagelevel = array_filter( $_POST['ht_ctc_pagelevel'] );
176
  if( isset( $ht_ctc_pagelevel[$key] ) ) {
177
  if ( 'pre_filled' == $key ) {
178
  $new[$key] = sanitize_textarea_field( $ht_ctc_pagelevel[$key] );
179
+ } else if ( 'call_to_action' == $key ) {
180
  $new[$key] = sanitize_text_field( $ht_ctc_pagelevel[$key] );
181
+ } else if ( in_array( $key, $editor ) ) {
182
+ if ( !empty( $ht_ctc_pagelevel[$key]) && '' !== $ht_ctc_pagelevel[$key] && function_exists('ht_ctc_wp_sanitize_text_editor') ) {
183
+ $new[$key] = ht_ctc_wp_sanitize_text_editor( $ht_ctc_pagelevel[$key] );
184
+ }
185
  } else {
186
  $new[$key] = sanitize_text_field( $ht_ctc_pagelevel[$key] );
187
  }
new/admin/admin_commons/ht-ctc-admin-formatting.php CHANGED
@@ -12,6 +12,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
12
  *
13
  * To check the charset and run
14
  * @uses wp_encode_emoji
 
15
  *
16
  * @since 3.3.5
17
  * @param string $value input value to convert emojis to html entity
@@ -28,4 +29,51 @@ if ( ! function_exists('ht_ctc_wp_encode_emoji') ) {
28
 
29
  return $value;
30
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  }
12
  *
13
  * To check the charset and run
14
  * @uses wp_encode_emoji
15
+ * on this page other functions. (so keep this function at the top)
16
  *
17
  * @since 3.3.5
18
  * @param string $value input value to convert emojis to html entity
29
 
30
  return $value;
31
  }
32
+ }
33
+
34
+
35
+
36
+ /**
37
+ * sanitize text editor
38
+ *
39
+ * @uses
40
+ * @since 3.9.3
41
+ * @param
42
+ */
43
+ if ( ! function_exists('ht_ctc_wp_sanitize_text_editor') ) {
44
+ function ht_ctc_wp_sanitize_text_editor($value = '') {
45
+
46
+ if ( !empty( $value) && '' !== $value ) {
47
+
48
+ if ( function_exists('ht_ctc_wp_encode_emoji') ) {
49
+ $value = ht_ctc_wp_encode_emoji( $value );
50
+ }
51
+
52
+ $allowed_html = wp_kses_allowed_html( 'post' );
53
+
54
+ // $allowed_html['iframe'] = array(
55
+ // 'src' => true,
56
+ // 'height' => true,
57
+ // 'width' => true,
58
+ // 'frameborder' => true,
59
+ // 'allowfullscreen' => true,
60
+ // 'title' => true,
61
+ // 'allow' => true,
62
+ // 'autoplay' => true,
63
+ // 'clipboard-write' => true,
64
+ // 'encrypted-media' => true,
65
+ // 'gyroscope' => true,
66
+ // 'picture-in-picture' => true,
67
+ // );
68
+
69
+ $new_value = wp_kses($value, $allowed_html);
70
+ // htmlentities this $new_value (double security ..)
71
+ $new_value = htmlentities( $new_value );
72
+
73
+ // (may not needed - but extra security)
74
+ $new_value = sanitize_textarea_field( $new_value );
75
+ }
76
+
77
+ return $new_value;
78
+ }
79
  }
new/admin/class-ht-ctc-admin-greetings-page.php CHANGED
@@ -131,7 +131,7 @@ class HT_CTC_Admin_Greetings {
131
  'parent_class' => 'pr_header_content ctc_greetings_settings ctc_g_1',
132
  ],
133
  'main_content' => [
134
- 'title' => 'Main Content',
135
  'db' => 'main_content',
136
  'template' => 'editor',
137
  'label' => 'Main Content',
@@ -139,7 +139,7 @@ class HT_CTC_Admin_Greetings {
139
  'parent_class' => 'pr_main_content ctc_greetings_settings ctc_g_1 ctc_g_2',
140
  ],
141
  'bottom_content' => [
142
- 'title' => 'Bottom Content',
143
  'db' => 'bottom_content',
144
  'template' => 'editor',
145
  'label' => 'Bottom Content',
@@ -148,32 +148,32 @@ class HT_CTC_Admin_Greetings {
148
  'parent_class' => 'pr_bottom_content ctc_greetings_settings ctc_g_1 ctc_g_2',
149
  ],
150
  [
151
- 'title' => 'Call to Action',
152
  'db' => 'call_to_action',
153
  'template' => 'text',
154
  'label' => 'Call to Action',
155
- 'description' => 'Call to Action (Button/Link Text)',
156
  'parent_class' => 'pr_call_to_action ctc_greetings_settings ctc_g_1 ctc_g_2',
157
  ],
158
  ]
159
  ],
160
  'greetings_1' => [
161
  'id' => 'ht_ctc_greetings_1',
162
- 'title' => 'Greetings Dialog - 1',
163
  'dbrow' => 'ht_ctc_greetings_1',
164
  'fallback_values' => $g1_fallback_values,
165
  'class' => 'pr_ht_ctc_greetings_1 ctc_greetings_settings',
166
  'inputs' => [
167
  [
168
  'template' => 'collapsible_start',
169
- 'title' => 'Greetings Dialog - 1 - Customizable',
170
  ],
171
  [
172
  'db' => 'empty',
173
  'template' => 'empty',
174
  ],
175
  [
176
- 'title' => 'Header - Background Color',
177
  'db' => 'header_bg_color',
178
  'template' => 'color',
179
  'default_color' => '#075e54',
@@ -181,7 +181,7 @@ class HT_CTC_Admin_Greetings {
181
  'parent_class' => 'pr_g1_header_bg_color',
182
  ],
183
  [
184
- 'title' => 'Main Content - Background Color',
185
  'db' => 'main_bg_color',
186
  'template' => 'color',
187
  'default_color' => '#ece5dd',
@@ -189,7 +189,7 @@ class HT_CTC_Admin_Greetings {
189
  'parent_class' => 'pr_g1_main_bg_color',
190
  ],
191
  [
192
- 'title' => 'Message Box - Background Color',
193
  'db' => 'message_box_bg_color',
194
  'template' => 'color',
195
  'default_color' => '#dcf8c6',
@@ -200,10 +200,10 @@ class HT_CTC_Admin_Greetings {
200
  'title' => __( 'Call to Action - button type', 'click-to-chat-for-whatsapp'),
201
  'db' => 'cta_style',
202
  'template' => 'select',
203
- 'description' => "Call to Action - button type (Color settings at Click to Chat -> Customize)",
204
  'list' => [
205
- '1' => 'Themes Button (style-1)',
206
- '7_1' => 'Button with WhatsApp Icon (style-7 Extend)',
207
  ],
208
  'parent_class' => 'pr_g1_cta_style',
209
  ],
@@ -215,14 +215,14 @@ class HT_CTC_Admin_Greetings {
215
  ],
216
  'greetings_2' => [
217
  'id' => 'ht_ctc_greetings_2',
218
- 'title' => 'Greetings Dialog - 2',
219
  'dbrow' => 'ht_ctc_greetings_2',
220
  'fallback_values' => $g2_fallback_values,
221
  'class' => 'pr_ht_ctc_greetings_2 ctc_greetings_settings',
222
  'inputs' => [
223
  [
224
  'template' => 'collapsible_start',
225
- 'title' => 'Greetings Dialog - 2 - Content Specific',
226
  ],
227
  [
228
  'db' => 'empty',
@@ -256,11 +256,11 @@ class HT_CTC_Admin_Greetings {
256
  'title' => __( 'Display', 'click-to-chat-for-whatsapp'),
257
  'db' => 'g_device',
258
  'template' => 'select',
259
- 'description' => "Display Greetings Dialog based on device",
260
  'list' => [
261
- 'all' => 'Desktop and Mobile',
262
- 'desktop' => 'Desktop Only',
263
- 'mobile' => 'Mobile Only'
264
  ],
265
  'parent_class' => 'pr_g_device',
266
  ],
@@ -380,7 +380,8 @@ class HT_CTC_Admin_Greetings {
380
  <div class="collapsible-header"><?php _e( 'PRO', 'click-to-chat-for-whatsapp' ); ?></div>
381
  <div class="collapsible-body">
382
  <p class="description">Greetings - Form filling</p>
383
- <p class="description">Time, Scroll Actions</p>
 
384
  <p class="description" style="text-align: center; position:sticky; bottom:2px; margin-top:20px;"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/pricing/" class="waves-effect waves-light btn" style="width: 100%;">PRO Version</a></p>
385
  </div>
386
  </li>
@@ -464,16 +465,33 @@ class HT_CTC_Admin_Greetings {
464
  }
465
 
466
  public function ctc_g_content_cb() {
467
-
468
- if ( ! defined( 'HT_CTC_PRO_VERSION' ) ) {
469
- ?>
470
- <div class="ctc_greetings_settings ctc_greetings_notes">
471
- <p class="description"><a href="https://holithemes.com/plugins/click-to-chat/pricing/">PRO Features</a></p>
472
- <p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/greetings-form/">Greetings Form</a>: Form filling before initiating the chat</p>
473
- <p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/greetings-actions/">Actions</a>: Display/reappear Greetings Dialog based on time, scroll Actions</p>
474
- </div>
 
 
 
475
  <?php
476
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
477
 
478
  }
479
 
@@ -514,24 +532,10 @@ class HT_CTC_Admin_Greetings {
514
  if ( is_array( $input[$key] ) ) {
515
  $new_input[$key] = map_deep( $input[$key], 'sanitize_text_field' );
516
  } else {
517
-
518
  if ( in_array( $key, $editor ) ) {
519
  // editor
520
- if ( !empty( $input[$key]) && '' !== $input[$key] ) {
521
-
522
- if ( function_exists('ht_ctc_wp_encode_emoji') ) {
523
- $input[$key] = ht_ctc_wp_encode_emoji( $input[$key] );
524
- }
525
-
526
- $allowed_html = wp_kses_allowed_html( 'post' );
527
-
528
- $new_input[$key] = wp_kses($input[$key], $allowed_html);
529
- // htmlentities this $new_input[$key] (double security ..)
530
- $new_input[$key] = htmlentities( $new_input[$key] );
531
-
532
- // (may not needed - but extra security)
533
- $new_input[$key] = sanitize_textarea_field( $new_input[$key] );
534
-
535
  } else {
536
  // save field even if the value is empty..
537
  $new_input[$key] = sanitize_text_field( $input[$key] );
@@ -561,9 +565,11 @@ class HT_CTC_Admin_Greetings {
561
  $local = apply_filters( 'ht_ctc_fh_greetings_setting_local_values', $local );
562
 
563
  // l10n
564
- foreach ($input as $key => $value) {
 
 
565
  if ( in_array( $key, $local ) ) {
566
- do_action( 'wpml_register_single_string', 'Click to Chat for WhatsApp', "greetings_$key", $input[$key] );
567
  }
568
  }
569
 
131
  'parent_class' => 'pr_header_content ctc_greetings_settings ctc_g_1',
132
  ],
133
  'main_content' => [
134
+ 'title' => __( 'Main Content', 'click-to-chat-for-whatsapp'),
135
  'db' => 'main_content',
136
  'template' => 'editor',
137
  'label' => 'Main Content',
139
  'parent_class' => 'pr_main_content ctc_greetings_settings ctc_g_1 ctc_g_2',
140
  ],
141
  'bottom_content' => [
142
+ 'title' => __( 'Bottom Content', 'click-to-chat-for-whatsapp'),
143
  'db' => 'bottom_content',
144
  'template' => 'editor',
145
  'label' => 'Bottom Content',
148
  'parent_class' => 'pr_bottom_content ctc_greetings_settings ctc_g_1 ctc_g_2',
149
  ],
150
  [
151
+ 'title' => __( 'Call to Action', 'click-to-chat-for-whatsapp'),
152
  'db' => 'call_to_action',
153
  'template' => 'text',
154
  'label' => 'Call to Action',
155
+ 'description' => __( 'Call to Action (Button/Link Text)', 'click-to-chat-for-whatsapp'),
156
  'parent_class' => 'pr_call_to_action ctc_greetings_settings ctc_g_1 ctc_g_2',
157
  ],
158
  ]
159
  ],
160
  'greetings_1' => [
161
  'id' => 'ht_ctc_greetings_1',
162
+ 'title' => __( 'Greetings Dialog - 1', 'click-to-chat-for-whatsapp'),
163
  'dbrow' => 'ht_ctc_greetings_1',
164
  'fallback_values' => $g1_fallback_values,
165
  'class' => 'pr_ht_ctc_greetings_1 ctc_greetings_settings',
166
  'inputs' => [
167
  [
168
  'template' => 'collapsible_start',
169
+ 'title' => __( 'Greetings-1 - Customizable Design', 'click-to-chat-for-whatsapp'),
170
  ],
171
  [
172
  'db' => 'empty',
173
  'template' => 'empty',
174
  ],
175
  [
176
+ 'title' => __( 'Header - Background Color', 'click-to-chat-for-whatsapp'),
177
  'db' => 'header_bg_color',
178
  'template' => 'color',
179
  'default_color' => '#075e54',
181
  'parent_class' => 'pr_g1_header_bg_color',
182
  ],
183
  [
184
+ 'title' => __( 'Main Content - Background Color', 'click-to-chat-for-whatsapp'),
185
  'db' => 'main_bg_color',
186
  'template' => 'color',
187
  'default_color' => '#ece5dd',
189
  'parent_class' => 'pr_g1_main_bg_color',
190
  ],
191
  [
192
+ 'title' => __( 'Message Box - Background Color', 'click-to-chat-for-whatsapp'),
193
  'db' => 'message_box_bg_color',
194
  'template' => 'color',
195
  'default_color' => '#dcf8c6',
200
  'title' => __( 'Call to Action - button type', 'click-to-chat-for-whatsapp'),
201
  'db' => 'cta_style',
202
  'template' => 'select',
203
+ 'description' => "Call to Action - button type ('Click to Chat' -> Customize)",
204
  'list' => [
205
+ '1' => __( 'Themes Button (style-1)', 'click-to-chat-for-whatsapp'),
206
+ '7_1' => __( 'Button with WhatsApp Icon (style-7 Extend)', 'click-to-chat-for-whatsapp'),
207
  ],
208
  'parent_class' => 'pr_g1_cta_style',
209
  ],
215
  ],
216
  'greetings_2' => [
217
  'id' => 'ht_ctc_greetings_2',
218
+ 'title' => __( 'Greetings Dialog - 2', 'click-to-chat-for-whatsapp'),
219
  'dbrow' => 'ht_ctc_greetings_2',
220
  'fallback_values' => $g2_fallback_values,
221
  'class' => 'pr_ht_ctc_greetings_2 ctc_greetings_settings',
222
  'inputs' => [
223
  [
224
  'template' => 'collapsible_start',
225
+ 'title' => __( 'Greetings-2 - Content Specific', 'click-to-chat-for-whatsapp'),
226
  ],
227
  [
228
  'db' => 'empty',
256
  'title' => __( 'Display', 'click-to-chat-for-whatsapp'),
257
  'db' => 'g_device',
258
  'template' => 'select',
259
+ 'description' => __( 'Display Greetings Dialog based on device', 'click-to-chat-for-whatsapp'),
260
  'list' => [
261
+ 'all' => __( 'Desktop and Mobile', 'click-to-chat-for-whatsapp'),
262
+ 'desktop' => __( 'Desktop Only', 'click-to-chat-for-whatsapp'),
263
+ 'mobile' => __( 'Mobile Only', 'click-to-chat-for-whatsapp')
264
  ],
265
  'parent_class' => 'pr_g_device',
266
  ],
380
  <div class="collapsible-header"><?php _e( 'PRO', 'click-to-chat-for-whatsapp' ); ?></div>
381
  <div class="collapsible-body">
382
  <p class="description">Greetings - Form filling</p>
383
+ <p class="description">Actions: Time, Scroll, Viewport</p>
384
+ <p class="description">Greetings page level settings</p>
385
  <p class="description" style="text-align: center; position:sticky; bottom:2px; margin-top:20px;"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/pricing/" class="waves-effect waves-light btn" style="width: 100%;">PRO Version</a></p>
386
  </div>
387
  </li>
465
  }
466
 
467
  public function ctc_g_content_cb() {
468
+
469
+ ?>
470
+ <div class="ctc_greetings_settings ctc_greetings_notes">
471
+ <p class="description">
472
+ <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/greetings-actions/">Actions</a>: Displays Greetings when
473
+ </p>
474
+ <p class="description">
475
+ <strong>Click</strong>: Clicked on any element with Class name: 'ctc_greetings' <br>
476
+ <strong>Viewport</strong>: an element is in viewport(25% margin) with Class name: 'ctc_greetings_now' [PRO]
477
+ </p>
478
+
479
  <?php
480
+ if ( ! defined( 'HT_CTC_PRO_VERSION' ) ) {
481
+ ?>
482
+ <br>
483
+ <p class="description"><strong>PRO</strong>:</p>
484
+ <p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/greetings-form/">Actions</a>: Time, Scroll, Click, Viewport</p>
485
+ <p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/greetings-form/">Greetings Form</a>: Form filling before initiating the chat</p>
486
+ <p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/change-values-at-page-level/#greetings">Greetings Page level settings</a>: Change Greetings content for any post</p>
487
+ <br>
488
+ <p class="description"><a href="https://holithemes.com/plugins/click-to-chat/pricing/">PRO Version</a></p>
489
+ <?php
490
+ }
491
+ ?>
492
+
493
+ </div>
494
+ <?php
495
 
496
  }
497
 
532
  if ( is_array( $input[$key] ) ) {
533
  $new_input[$key] = map_deep( $input[$key], 'sanitize_text_field' );
534
  } else {
 
535
  if ( in_array( $key, $editor ) ) {
536
  // editor
537
+ if ( !empty( $input[$key]) && '' !== $input[$key] && function_exists('ht_ctc_wp_sanitize_text_editor') ) {
538
+ $new_input[$key] = ht_ctc_wp_sanitize_text_editor( $input[$key] );
 
 
 
 
 
 
 
 
 
 
 
 
 
539
  } else {
540
  // save field even if the value is empty..
541
  $new_input[$key] = sanitize_text_field( $input[$key] );
565
  $local = apply_filters( 'ht_ctc_fh_greetings_setting_local_values', $local );
566
 
567
  // l10n
568
+ do_action('ht_ctc_ah_admin_localization_greetings_page', $new_input );
569
+
570
+ foreach ($new_input as $key => $value) {
571
  if ( in_array( $key, $local ) ) {
572
+ do_action( 'wpml_register_single_string', 'Click to Chat for WhatsApp', "greetings_$key", $new_input[$key] );
573
  }
574
  }
575
 
new/admin/class-ht-ctc-admin-main-page.php CHANGED
@@ -302,8 +302,8 @@ class HT_CTC_Admin_Main_Page {
302
 
303
 
304
  ?>
 
305
  <p class="description"><a target="_blank" href="<?= admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">Customize Styles</a></p>
306
- <p class="description"><a target="_blank" href="<?= admin_url( 'admin.php?page=click-to-chat-greetings' ); ?>">Greetings Dialog</a></p>
307
  <p class="description"><a target="_blank" href="<?= admin_url( 'admin.php?page=click-to-chat-other-settings' ); ?>">Other Settings</a></p>
308
  <p class="description"><a target="_blank" href="<?= $woo_link ?>">WooCommerce</a> <?= $woo_text ?></p>
309
  <br>
302
 
303
 
304
  ?>
305
+ <p class="description"><a target="_blank" href="<?= admin_url( 'admin.php?page=click-to-chat-greetings' ); ?>">Greetings</a></p>
306
  <p class="description"><a target="_blank" href="<?= admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">Customize Styles</a></p>
 
307
  <p class="description"><a target="_blank" href="<?= admin_url( 'admin.php?page=click-to-chat-other-settings' ); ?>">Other Settings</a></p>
308
  <p class="description"><a target="_blank" href="<?= $woo_link ?>">WooCommerce</a> <?= $woo_text ?></p>
309
  <br>
new/admin/class-ht-ctc-admin-other-settings.php CHANGED
@@ -254,7 +254,7 @@ class HT_CTC_Admin_Other_Settings {
254
  <div class="row">
255
 
256
  <br>
257
- <div class="ctc_hook_value">
258
  <?php
259
 
260
  // hook values
254
  <div class="row">
255
 
256
  <br>
257
+ <div class="ctc_hook_value ctc_sortable">
258
  <?php
259
 
260
  // hook values
new/admin/class-ht-ctc-admin-scripts.php CHANGED
@@ -35,7 +35,7 @@ class HT_CTC_Admin_Scripts {
35
  wp_enqueue_style('ctc_admin_css', plugins_url( 'new/admin/admin_assets/css/admin.css', HT_CTC_PLUGIN_FILE ) , '', HT_CTC_VERSION );
36
 
37
  wp_enqueue_script( 'ctc_admin_md_js', plugins_url( 'new/admin/admin_assets/js/materialize.min.js', HT_CTC_PLUGIN_FILE ), array( 'jquery' ), HT_CTC_VERSION, $load_js_bottom );
38
- wp_enqueue_script( 'ctc_admin_js', plugins_url( "new/admin/admin_assets/js/$admin_js", HT_CTC_PLUGIN_FILE ), array( 'jquery', 'wp-color-picker', 'ctc_admin_md_js' ), HT_CTC_VERSION, $load_js_bottom );
39
 
40
  if ('click-to-chat_page_click-to-chat-greetings' == $hook) {
41
  wp_enqueue_script( 'ctc_admin_greetings_js', plugins_url( "new/admin/admin_assets/js/$greetings_js", HT_CTC_PLUGIN_FILE ), array( 'jquery', 'ctc_admin_js' ), HT_CTC_VERSION, $load_js_bottom );
35
  wp_enqueue_style('ctc_admin_css', plugins_url( 'new/admin/admin_assets/css/admin.css', HT_CTC_PLUGIN_FILE ) , '', HT_CTC_VERSION );
36
 
37
  wp_enqueue_script( 'ctc_admin_md_js', plugins_url( 'new/admin/admin_assets/js/materialize.min.js', HT_CTC_PLUGIN_FILE ), array( 'jquery' ), HT_CTC_VERSION, $load_js_bottom );
38
+ wp_enqueue_script( 'ctc_admin_js', plugins_url( "new/admin/admin_assets/js/$admin_js", HT_CTC_PLUGIN_FILE ), array( 'jquery', 'jquery-ui-core', 'jquery-ui-sortable', 'wp-color-picker', 'ctc_admin_md_js' ), HT_CTC_VERSION, $load_js_bottom );
39
 
40
  if ('click-to-chat_page_click-to-chat-greetings' == $hook) {
41
  wp_enqueue_script( 'ctc_admin_greetings_js', plugins_url( "new/admin/admin_assets/js/$greetings_js", HT_CTC_PLUGIN_FILE ), array( 'jquery', 'ctc_admin_js' ), HT_CTC_VERSION, $load_js_bottom );
new/admin/components/checkbox.php CHANGED
@@ -7,6 +7,9 @@ if ( ! defined( 'ABSPATH' ) ) exit;
7
 
8
  $title = (isset($input['title'])) ? esc_attr($input['title']) : '';
9
  $parent_class = (isset($input['parent_class'])) ? $input['parent_class'] : '';
 
 
 
10
 
11
 
12
  ?>
@@ -16,6 +19,7 @@ $parent_class = (isset($input['parent_class'])) ? $input['parent_class'] : '';
16
  <input name="<?= $dbrow ?>[<?= $db_key ?>]" type="checkbox" value="1" <?php checked( $db_value, 1 ); ?> />
17
  <span><?= $title ?></span>
18
  </label>
 
19
  </p>
20
  </div>
21
  <?php
7
 
8
  $title = (isset($input['title'])) ? esc_attr($input['title']) : '';
9
  $parent_class = (isset($input['parent_class'])) ? $input['parent_class'] : '';
10
+ $label = (isset($input['label'])) ? $input['label'] : '';
11
+ $description = (isset($input['description'])) ? $input['description'] : '';
12
+
13
 
14
 
15
  ?>
19
  <input name="<?= $dbrow ?>[<?= $db_key ?>]" type="checkbox" value="1" <?php checked( $db_value, 1 ); ?> />
20
  <span><?= $title ?></span>
21
  </label>
22
+ <p class="description"><?= $description ?></p>
23
  </p>
24
  </div>
25
  <?php
new/admin/components/list/ht-ctc-admin-list-page.php CHANGED
@@ -25,9 +25,9 @@ class HT_CTC_Admin_List_Page {
25
  * Note: dont inclued 'pro' keyword in this list.
26
  */
27
  $values = array(
28
- 'no' => '-- No Greetings Dialog --',
29
- 'greetings-1' => 'Greetings-1 - Customizable Design',
30
- 'greetings-2' => 'Greetings-2 - Content Specific'
31
  );
32
 
33
  $values = apply_filters( 'ht_ctc_fh_greetings_templates', $values );
@@ -37,9 +37,6 @@ class HT_CTC_Admin_List_Page {
37
 
38
 
39
 
40
-
41
-
42
-
43
  }
44
 
45
  endif; // END class_exists check
25
  * Note: dont inclued 'pro' keyword in this list.
26
  */
27
  $values = array(
28
+ 'no' => __( '-- No Greetings Dialog --', 'click-to-chat-for-whatsapp'),
29
+ 'greetings-1' => __( 'Greetings-1 - Customizable Design', 'click-to-chat-for-whatsapp'),
30
+ 'greetings-2' => __( 'Greetings-2 - Content Specific', 'click-to-chat-for-whatsapp')
31
  );
32
 
33
  $values = apply_filters( 'ht_ctc_fh_greetings_templates', $values );
37
 
38
 
39
 
 
 
 
40
  }
41
 
42
  endif; // END class_exists check
new/inc/assets/js/app.js CHANGED
@@ -1 +1 @@
1
- !function(f){f(function(){var o=window.location.href,a=void 0!==document.title?document.title:"",n=void 0!==screen.width&&1024<screen.width?"no":"yes",_="",c={};function e(t,e){c[t]=e;e=JSON.stringify(c);localStorage.setItem("ht_ctc_storage",e)}localStorage.getItem("ht_ctc_storage")&&(c=localStorage.getItem("ht_ctc_storage"),c=JSON.parse(c));var t,i="";if("undefined"!=typeof ht_ctc_chat_var)i=ht_ctc_chat_var,s(),r();else{try{document.querySelector(".ht_ctc_chat_data")&&(t=f(".ht_ctc_chat_data").attr("data-settings"),i=JSON.parse(t))}catch(t){i={}}s(),r()}function s(){var t=document.querySelector(".ht_ctc_chat_data");t&&(_=f(".ht_ctc_chat_data").attr("data-no_number"),t.remove())}function r(){var e;document.dispatchEvent(new CustomEvent("ht_ctc_event_settings",{detail:{ctc:i}})),(e=document.querySelector(".ht-ctc-chat"))&&(document.dispatchEvent(new CustomEvent("ht_ctc_event_chat")),function(t){"yes"==i.schedule?document.dispatchEvent(new CustomEvent("ht_ctc_event_display",{detail:{ctc:i,display_chat:l,ht_ctc_chat:t}})):l(t)}(e),e.addEventListener("click",function(){f(".ht_ctc_chat_greetings_box").length||v(e)}),f(".ht_ctc_chat_greetings_box").length&&f(document).on("click",".ht_ctc_chat_style",function(t){f(".ht_ctc_chat_greetings_box").hasClass("ctc_greetings_opened")?u("user_closed"):d("user_opened")}),f(document).on("click",".ctc_greetings_close_btn",function(t){u("user_closed")}),f(document).on("click",".ht_ctc_chat_greetings_box_link",function(t){t.preventDefault(),v(e),document.dispatchEvent(new CustomEvent("ht_ctc_event_greetings"))})),f(document).on("click",".ht-ctc-sc-chat",function(){var t=this.getAttribute("data-number"),e=(e=this.getAttribute("data-pre_filled")).replace(/\[url]/gi,o);e=encodeURIComponent(e),i.web&&"yes"!==n?window.open("https://web.whatsapp.com/send?phone="+t+"&text="+e,"_blank","noopener"):window.open("https://wa.me/"+t+"?text="+e,"_blank","noopener"),p(this),m(t)}),f(document).on("click",".ctc_chat, #ctc_chat",function(t){v(this),f(this).hasClass("ctc_woo_place")&&t.preventDefault()}),f(document).on("click",'[href="#ctc_chat"]',function(t){t.preventDefault(),v(this)})}function h(){if(f(".ht_ctc_chat_greetings_box").length){if(i.g_device){if("yes"!==n&&"mobile"==i.g_device)return void f(".ht_ctc_chat_greetings_box").remove();if("yes"==n&&"desktop"==i.g_device)return void f(".ht_ctc_chat_greetings_box").remove()}document.dispatchEvent(new CustomEvent("ht_ctc_event_after_chat_displayed",{detail:{ctc:i,greetings_open:d,greetings_close:u}})),i.g_init&&"open"==i.g_init&&"user_closed"!==(c["g_user_action"]||!1)&&d("init"),f(document).on("click",".ctc_open_greetings, #ctc_open_greetings",function(t){u("element"),d("element")})}}function d(t){f(".ctc_cta_stick").remove(),f(".ht_ctc_chat_greetings_box").show(70),f(".ht_ctc_chat_greetings_box").addClass("ctc_greetings_opened").removeClass("ctc_greetings_closed"),e("g_action",t),"user_opened"==t&&e("g_user_action",t)}function u(t){f(".ht_ctc_chat_greetings_box").hide(70),f(".ht_ctc_chat_greetings_box").addClass("ctc_greetings_closed").removeClass("ctc_greetings_opened"),e("g_action",t),"user_closed"==t&&e("g_user_action",t)}function l(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,g(t)):"show"==i.dis_d&&((e=document.querySelector(".ht_ctc_mobile_chat"))&&e.remove(),t.style.cssText=i.pos_d+i.css,g(t))}function g(e){try{f(e).show(parseInt(i.se))}catch(t){e.style.display="block"}var t,c;h(),c=f(t=e).hasClass("ht_ctc_entry_animation")?1200:120,setTimeout(function(){t.classList.add("ht_ctc_animation",i.ani)},c),f(".ht-ctc-chat").hover(function(){f(".ht-ctc-chat .ht-ctc-cta-hover").show(120)},function(){f(".ht-ctc-chat .ht-ctc-cta-hover").hide(100)})}function p(t){document.dispatchEvent(new CustomEvent("ht_ctc_event_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;(i.ga||i.ga4)&&("undefined"!=typeof gtag?i.ga4?gtag("event","click to chat",{number:e,title:a,url:o}):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",type:"chat",number:e,title:a,url:o,event_category:c,event_label:t,event_action:n}),i.ads&&"undefined"!=typeof gtag_report_conversion&&gtag_report_conversion(),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 v(t){document.dispatchEvent(new CustomEvent("ht_ctc_event_number",{detail:{ctc:i}}));var e=i.number,c=i.pre_filled;t.hasAttribute("data-number")&&(e=t.getAttribute("data-number")),t.hasAttribute("data-pre_filled")&&(c=t.getAttribute("data-pre_filled")),c=c.replace(/\[url]/gi,o),c=encodeURIComponent(c),""!=e?(i.web&&"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"),p(t),m(e)):f(".ht-ctc-chat").html(_)}function m(t){var e,c;i.hook_url&&(e=i.hook_url,c={},i.hook_v&&(c=i.hook_v),document.dispatchEvent(new CustomEvent("ht_ctc_event_hook",{detail:{ctc:i,number:t}})),e=i.hook_url,c=i.hook_v,data=JSON.stringify(c),f.ajax({url:e,type:"POST",mode:"no-cors",data:data,success:function(t){}}))}})}(jQuery);
1
+ !function(f){f(function(){var o=window.location.href,a=void 0!==document.title?document.title:"",n=void 0!==screen.width&&1024<screen.width?"no":"yes",_="",c={};function e(t,e){c[t]=e;e=JSON.stringify(c);localStorage.setItem("ht_ctc_storage",e)}localStorage.getItem("ht_ctc_storage")&&(c=localStorage.getItem("ht_ctc_storage"),c=JSON.parse(c));var t,i="";if("undefined"!=typeof ht_ctc_chat_var)i=ht_ctc_chat_var,s(),r();else{try{document.querySelector(".ht_ctc_chat_data")&&(t=f(".ht_ctc_chat_data").attr("data-settings"),i=JSON.parse(t))}catch(t){i={}}s(),r()}function s(){var t=document.querySelector(".ht_ctc_chat_data");t&&(_=f(".ht_ctc_chat_data").attr("data-no_number"),t.remove())}function r(){var e;document.dispatchEvent(new CustomEvent("ht_ctc_event_settings",{detail:{ctc:i}})),(e=document.querySelector(".ht-ctc-chat"))&&(document.dispatchEvent(new CustomEvent("ht_ctc_event_chat")),function(t){"yes"==i.schedule?document.dispatchEvent(new CustomEvent("ht_ctc_event_display",{detail:{ctc:i,display_chat:l,ht_ctc_chat:t}})):l(t)}(e),e.addEventListener("click",function(){f(".ht_ctc_chat_greetings_box").length||p(e)}),f(".ht_ctc_chat_greetings_box").length&&f(document).on("click",".ht_ctc_chat_style",function(t){f(".ht_ctc_chat_greetings_box").hasClass("ctc_greetings_opened")?u("user_closed"):d("user_opened")}),f(document).on("click",".ctc_greetings_close_btn",function(t){u("user_closed")}),f(document).on("click",".ht_ctc_chat_greetings_box_link",function(t){t.preventDefault(),p(e),document.dispatchEvent(new CustomEvent("ht_ctc_event_greetings"))})),f(document).on("click",".ht-ctc-sc-chat",function(){var t=this.getAttribute("data-number"),e=(e=this.getAttribute("data-pre_filled")).replace(/\[url]/gi,o);e=encodeURIComponent(e),i.web&&"yes"!==n?window.open("https://web.whatsapp.com/send?phone="+t+"&text="+e,"_blank","noopener"):window.open("https://wa.me/"+t+"?text="+e,"_blank","noopener"),v(this),m(t)}),f(document).on("click",".ctc_chat, #ctc_chat",function(t){p(this),f(this).hasClass("ctc_woo_place")&&t.preventDefault()}),f(document).on("click",'[href="#ctc_chat"]',function(t){t.preventDefault(),p(this)})}function h(){if(f(".ht_ctc_chat_greetings_box").length){if(i.g_device){if("yes"!==n&&"mobile"==i.g_device)return void f(".ht_ctc_chat_greetings_box").remove();if("yes"==n&&"desktop"==i.g_device)return void f(".ht_ctc_chat_greetings_box").remove()}document.dispatchEvent(new CustomEvent("ht_ctc_event_after_chat_displayed",{detail:{ctc:i,greetings_open:d,greetings_close:u}})),i.g_init&&"open"==i.g_init&&"user_closed"!==(c["g_user_action"]||!1)&&d("init"),f(document).on("click",".ctc_greetings, #ctc_greetings",function(t){u("element"),d("element")})}}function d(t){f(".ctc_cta_stick").remove(),f(".ht_ctc_chat_greetings_box").show(70),f(".ht_ctc_chat_greetings_box").addClass("ctc_greetings_opened").removeClass("ctc_greetings_closed"),e("g_action",t),"user_opened"==t&&e("g_user_action",t)}function u(t){f(".ht_ctc_chat_greetings_box").hide(70),f(".ht_ctc_chat_greetings_box").addClass("ctc_greetings_closed").removeClass("ctc_greetings_opened"),e("g_action",t),"user_closed"==t&&e("g_user_action",t)}function l(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,g(t)):"show"==i.dis_d&&((e=document.querySelector(".ht_ctc_mobile_chat"))&&e.remove(),t.style.cssText=i.pos_d+i.css,g(t))}function g(e){try{f(e).show(parseInt(i.se))}catch(t){e.style.display="block"}var t,c;h(),c=f(t=e).hasClass("ht_ctc_entry_animation")?1200:120,setTimeout(function(){t.classList.add("ht_ctc_animation",i.ani)},c),f(".ht-ctc-chat").hover(function(){f(".ht-ctc-chat .ht-ctc-cta-hover").show(120)},function(){f(".ht-ctc-chat .ht-ctc-cta-hover").hide(100)})}function v(t){document.dispatchEvent(new CustomEvent("ht_ctc_event_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;(i.ga||i.ga4)&&("undefined"!=typeof gtag?i.ga4?gtag("event","click to chat",{number:e,title:a,url:o}):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",type:"chat",number:e,title:a,url:o,event_category:c,event_label:t,event_action:n}),i.ads&&"undefined"!=typeof gtag_report_conversion&&gtag_report_conversion(),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 p(t){document.dispatchEvent(new CustomEvent("ht_ctc_event_number",{detail:{ctc:i}}));var e=i.number,c=i.pre_filled;t.hasAttribute("data-number")&&(e=t.getAttribute("data-number")),t.hasAttribute("data-pre_filled")&&(c=t.getAttribute("data-pre_filled")),c=c.replace(/\[url]/gi,o),c=encodeURIComponent(c),""!=e?(i.web&&"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"),v(t),m(e)):f(".ht-ctc-chat").html(_)}function m(t){var e,c;i.hook_url&&(e=i.hook_url,c={},i.hook_v&&(c=i.hook_v),document.dispatchEvent(new CustomEvent("ht_ctc_event_hook",{detail:{ctc:i,number:t}})),e=i.hook_url,c=i.hook_v,data=JSON.stringify(c),f.ajax({url:e,type:"POST",mode:"no-cors",data:data,success:function(t){}}))}})}(jQuery);
new/inc/assets/js/dev/app.dev.js CHANGED
@@ -1,450 +1,420 @@
1
  // Click to Chat
2
  (function ($) {
3
 
4
- // ready
5
- $(function () {
6
-
7
- // variables
8
- var url = window.location.href;
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 ht_ctc_storage = {};
15
-
16
- if (localStorage.getItem('ht_ctc_storage')) {
17
- ht_ctc_storage = localStorage.getItem('ht_ctc_storage');
18
- ht_ctc_storage = JSON.parse(ht_ctc_storage);
19
- }
20
-
21
- // get items from ht_ctc_storage
22
- function ctc_getItem(item) {
23
- if (ht_ctc_storage[item]) {
24
- return ht_ctc_storage[item];
25
- } else {
26
- return false;
27
- }
28
- }
29
-
30
- // set items to ht_ctc_storage storage
31
- function ctc_setItem(name, value) {
32
- ht_ctc_storage[name] = value;
33
- var newValues = JSON.stringify(ht_ctc_storage);
34
- localStorage.setItem('ht_ctc_storage', newValues);
35
- }
36
-
37
- var ctc = '';
38
- if ( typeof ht_ctc_chat_var !== "undefined" ) {
39
- ctc = ht_ctc_chat_var;
40
- chat_data();
41
- start();
42
- } else {
43
- try {
44
- if ( document.querySelector('.ht_ctc_chat_data') ) {
45
- var settings = $('.ht_ctc_chat_data').attr('data-settings');
46
- ctc = JSON.parse(settings);
47
- }
48
- } catch (e) {
49
- ctc = {};
50
- }
51
- chat_data();
52
- start();
53
- }
54
 
55
- function chat_data() {
 
 
 
 
 
56
 
57
- // if no num
58
- var chat_data = document.querySelector('.ht_ctc_chat_data');
59
 
60
- if (chat_data) {
61
- no_num = $(".ht_ctc_chat_data").attr('data-no_number');
62
- // remove the element
63
- chat_data.remove();
64
  }
65
 
66
- }
67
-
68
- // start
69
- function start() {
70
-
71
- console.log(ctc);
72
- document.dispatchEvent(
73
- new CustomEvent("ht_ctc_event_settings", { detail: { ctc } })
74
- );
75
-
76
- // fixed position
77
- ht_ctc();
78
 
79
- // shortcode
80
- shortcode();
 
 
 
 
81
 
82
- // custom element
83
- custom_link();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
 
85
- }
86
 
 
 
87
 
88
-
 
 
 
 
89
 
 
90
 
 
 
91
 
92
- // fixed position
93
- function ht_ctc() {
94
- console.log('ht_ctc');
95
- var ht_ctc_chat = document.querySelector('.ht-ctc-chat');
96
- if (ht_ctc_chat) {
97
-
98
  document.dispatchEvent(
99
- new CustomEvent("ht_ctc_event_chat")
100
  );
101
 
102
- // display
103
- display_settings(ht_ctc_chat);
104
 
105
- // click
106
- ht_ctc_chat.addEventListener('click', function () {
107
- // ht_ctc_chat_greetings_box (ht_ctc_chat_greetings_box_link) is not exists..
108
 
109
- if (!$('.ht_ctc_chat_greetings_box').length) {
110
- console.log('no greetings dialog');
111
- // link
112
- ht_ctc_link(ht_ctc_chat);
113
- }
114
- });
115
 
116
- // greetings dialog settings..
117
- greetings();
118
 
119
- // greetings link click..
120
- $(document).on('click', '.ht_ctc_chat_greetings_box_link', function (e) {
121
- console.log('ht_ctc_chat_greetings_box_link');
122
- e.preventDefault();
123
- ht_ctc_link(ht_ctc_chat);
 
 
 
 
 
124
 
125
  document.dispatchEvent(
126
- new CustomEvent("ht_ctc_event_greetings")
127
  );
128
- });
129
 
130
- }
 
131
 
132
- }
 
 
133
 
 
 
 
 
 
 
134
 
135
- /**
136
- * greetings dialog
137
- */
138
- function greetings() {
139
 
140
- if ($('.ht_ctc_chat_greetings_box').length) {
 
 
 
 
141
 
142
- $(document).on('click', '.ht_ctc_chat_style', function (e) {
143
- // ctc_greetings_opened / ctc_greetings_closed
144
- if ($('.ht_ctc_chat_greetings_box').hasClass('ctc_greetings_opened')) {
145
- greetings_close('user_closed');
146
- } else {
147
- greetings_open('user_opened');
148
- }
149
- });
150
 
151
  }
152
 
153
- // close btn - greetings dialog
154
- $(document).on('click', '.ctc_greetings_close_btn', function (e) {
155
- greetings_close('user_closed');
156
- });
157
-
158
- }
159
-
160
- function greetings_display() {
161
-
162
- if ($('.ht_ctc_chat_greetings_box').length) {
163
-
164
- // Display greetings - device based
165
- if (ctc.g_device) {
166
- if (is_mobile !== 'yes' && 'mobile' == ctc.g_device) {
167
- // in desktop, mobile only
168
- $('.ht_ctc_chat_greetings_box').remove();
169
- return;
170
- } else if(is_mobile == 'yes' && 'desktop' == ctc.g_device) {
171
- // in mobile, desktop only
172
- $('.ht_ctc_chat_greetings_box').remove();
173
- return;
174
- }
175
- }
176
 
177
- document.dispatchEvent(
178
- new CustomEvent("ht_ctc_event_after_chat_displayed", { detail: { ctc, greetings_open, greetings_close } })
179
- );
 
180
 
181
- if (ctc.g_init && 'open' == ctc.g_init && 'user_closed' !== ctc_getItem('g_user_action')) {
182
- greetings_open('init');
183
- }
184
 
 
 
 
 
 
 
 
 
185
 
186
- $(document).on('click', '.ctc_open_greetings, #ctc_open_greetings', function (e) {
187
- console.log('greetings open triggered');
188
- greetings_close('element');
189
- greetings_open('element');
190
- });
191
 
 
 
 
 
192
 
193
  }
194
 
195
- }
196
-
197
- /**
198
- * ht_ctc_chat_greetings_box_user_action - this is needed for initial close or open.. if user closed.. then no auto open initially
199
- *
200
- */
201
- function greetings_open(message = 'open') {
202
- console.log('open');
203
- $('.ctc_cta_stick').remove();
204
- $('.ht_ctc_chat_greetings_box').show(70);
205
- $('.ht_ctc_chat_greetings_box').addClass('ctc_greetings_opened').removeClass('ctc_greetings_closed');
206
- ctc_setItem( 'g_action', message);
207
- if ('user_opened' == message) {
208
- ctc_setItem('g_user_action', message);
209
- }
210
- }
211
-
212
- function greetings_close(message = 'close') {
213
- console.log('close');
214
- $('.ht_ctc_chat_greetings_box').hide(70);
215
- $('.ht_ctc_chat_greetings_box').addClass('ctc_greetings_closed').removeClass('ctc_greetings_opened');
216
- ctc_setItem('g_action', message);
217
- if ('user_closed' == message) {
218
- ctc_setItem('g_user_action', message);
219
- }
220
- }
221
 
222
- // display settings - Fixed position style
223
- function display_settings(ht_ctc_chat) {
 
224
 
225
- if ('yes' == ctc.schedule) {
226
- console.log('scheduled');
227
- document.dispatchEvent(
228
- new CustomEvent("ht_ctc_event_display", { detail: { ctc, display_chat, ht_ctc_chat } })
229
- );
230
- } else {
231
- console.log('display directly');
232
- display_chat(ht_ctc_chat);
233
- }
234
 
235
- }
236
-
237
- // display based on device
238
- function display_chat(p) {
239
-
240
- if (is_mobile == 'yes') {
241
- if ( 'show' == ctc.dis_m ) {
242
 
243
- // remove desktop style
244
- var rm = document.querySelector('.ht_ctc_desktop_chat');
245
- (rm) ? rm.remove() : '';
 
 
 
246
 
247
- p.style.cssText = ctc.pos_m + ctc.css;
248
- display(p)
249
  }
250
- } else {
251
- if ( 'show' == ctc.dis_d ) {
252
 
253
- // remove mobile style
254
- var rm = document.querySelector('.ht_ctc_mobile_chat');
255
- (rm) ? rm.remove() : '';
256
 
257
- p.style.cssText = ctc.pos_d + ctc.css;
258
- display(p)
 
 
 
 
 
 
 
 
 
 
259
  }
260
  }
261
 
 
 
 
 
 
 
 
 
 
262
 
263
- }
 
264
 
265
- function display(p) {
266
- try {
267
- $(p).show(parseInt(ctc.se));
268
- } catch (e) {
269
- p.style.display = "block";
270
- }
 
 
 
271
 
272
- greetings_display();
273
 
274
- ht_ctc_things(p);
275
- }
276
 
277
- // animiation, cta hover effect
278
- function ht_ctc_things(p) {
279
- console.log('animations '+ ctc.ani);
280
- // animations
281
- var an_time = ($(p).hasClass('ht_ctc_entry_animation')) ? 1200 : 120;
282
- setTimeout(function () {
283
- p.classList.add('ht_ctc_animation', ctc.ani);
284
- }, an_time);
285
 
286
- // cta hover effects
287
- $(".ht-ctc-chat").hover(function () {
288
- $('.ht-ctc-chat .ht-ctc-cta-hover').show(120);
289
- }, function () {
290
- $('.ht-ctc-chat .ht-ctc-cta-hover').hide(100);
291
- });
292
- }
293
 
294
- // analytics
295
- function ht_ctc_chat_analytics(values) {
 
 
 
296
 
297
- console.log('analytics');
 
 
298
 
299
- document.dispatchEvent(
300
- new CustomEvent("ht_ctc_event_analytics")
301
- );
 
302
 
303
- // global number (fixed, user created elememt)
304
- var id = ctc.number;
305
 
306
- // if its shortcode
307
- if (values.classList.contains('ht-ctc-sc')) {
308
- // shortcode number
309
- id = values.getAttribute('data-number');
310
  }
311
 
312
- // Google Analytics
313
- var ga_category = 'Click to Chat for WhatsApp';
314
- var ga_action = 'chat: ' + id;
315
- var ga_label = post_title + ', ' + url;
316
-
317
- // if ga_enabled
318
- if (ctc.ga || ctc.ga4) {
319
- console.log('google analytics');
320
-
321
- if (typeof gtag !== "undefined") {
322
- console.log('gtag');
323
- if (ctc.ga4) {
324
- // ga4
325
- // gtag may not work if ga4 installed using gtm
326
- console.log('ga4');
327
- gtag('event', 'click to chat', {
328
- 'number': id,
329
- 'title': post_title,
330
- 'url': url,
331
- });
332
- } else {
333
- gtag('event', ga_action, {
334
- 'event_category': ga_category,
335
- 'event_label': ga_label,
336
- });
337
- }
338
- } else if (typeof ga !== "undefined" && typeof ga.getAll !== "undefined") {
339
- console.log('ga');
340
- var tracker = ga.getAll();
341
- tracker[0].send("event", ga_category, ga_action, ga_label);
342
- // ga('send', 'event', 'check ga_category', 'ga_action', 'ga_label');
343
- // ga.getAll()[0].send("event", 'check ga_category', 'ga_action', 'ga_label');
344
- } else if (typeof __gaTracker !== "undefined") {
345
- __gaTracker('send', 'event', ga_category, ga_action, ga_label);
346
  }
 
 
 
 
347
  }
348
 
349
- // dataLayer
350
- if (typeof dataLayer !== "undefined") {
351
- console.log('dataLayer');
352
- dataLayer.push({
353
- 'event': 'Click to Chat',
354
- 'type': 'chat',
355
- 'number': id,
356
- 'title': post_title,
357
- 'url': url,
358
- 'event_category': ga_category,
359
- 'event_label': ga_label,
360
- 'event_action': ga_action
 
 
361
  });
362
  }
363
 
364
- // google ads - call conversation code
365
- if (ctc.ads) {
366
- console.log('google ads enabled');
367
- if (typeof gtag_report_conversion !== "undefined") {
368
- console.log('calling gtag_report_conversion');
369
- gtag_report_conversion();
370
- }
371
- }
372
 
373
- // FB Pixel
374
- if (ctc.fb) {
375
- console.log('fb pixel');
376
- if (typeof fbq !== "undefined") {
377
- fbq('trackCustom', 'Click to Chat by HoliThemes', {
378
- 'Category': 'Click to Chat for WhatsApp',
379
- 'return_type': 'chat',
380
- 'ID': id,
381
- 'Title': post_title,
382
- 'URL': url
383
- });
 
 
384
  }
385
- }
386
 
387
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
388
 
389
- // link - chat
390
- function ht_ctc_link(values) {
 
 
 
 
 
 
 
 
 
 
 
 
391
 
392
- console.log(ctc.number);
393
- document.dispatchEvent(
394
- new CustomEvent("ht_ctc_event_number", { detail: { ctc } })
395
- );
396
-
397
- console.log(ctc.number);
 
 
398
 
399
- var number = ctc.number;
400
- var pre_filled = ctc.pre_filled;
 
 
 
 
 
 
 
 
 
 
 
401
 
402
- if (values.hasAttribute('data-number')) {
403
- console.log('has number attribute');
404
- number = values.getAttribute('data-number');
405
- }
406
-
407
- if (values.hasAttribute('data-pre_filled')) {
408
- console.log('has pre_filled attribute');
409
- pre_filled = values.getAttribute('data-pre_filled');
410
  }
411
 
412
- pre_filled = pre_filled.replace(/\[url]/gi, url);
413
- pre_filled = encodeURIComponent(pre_filled);
414
 
415
- if ('' == number) {
416
- console.log('no number');
417
- $(".ht-ctc-chat").html(no_num);
418
- return;
419
- }
420
 
421
- // web/api.whatsapp or wa.me
422
- if (ctc.web && is_mobile !== 'yes') {
423
- // web.whatsapp - if web api is enabled and is not mobile
424
- window.open('https://web.whatsapp.com/send' + '?phone=' + number + '&text=' + pre_filled, '_blank', 'noopener');
425
- } else {
426
- // wa.me
427
- window.open('https://wa.me/' + number + '?text=' + pre_filled, '_blank', 'noopener');
428
- }
429
 
430
- // analytics
431
- ht_ctc_chat_analytics(values);
432
-
433
- // hook
434
- hook(number);
435
 
436
- }
 
 
 
437
 
438
- // shortcode
439
- function shortcode() {
440
- // shortcode - click
441
- $(document).on('click', '.ht-ctc-sc-chat', function () {
442
 
443
- var number = this.getAttribute('data-number');
444
- var pre_filled = this.getAttribute('data-pre_filled');
445
  pre_filled = pre_filled.replace(/\[url]/gi, url);
446
  pre_filled = encodeURIComponent(pre_filled);
447
 
 
 
 
 
 
 
 
448
  if (ctc.web && is_mobile !== 'yes') {
449
  // web.whatsapp - if web api is enabled and is not mobile
450
  window.open('https://web.whatsapp.com/send' + '?phone=' + number + '&text=' + pre_filled, '_blank', 'noopener');
@@ -454,105 +424,131 @@ $(function () {
454
  }
455
 
456
  // analytics
457
- ht_ctc_chat_analytics(this);
458
 
459
  // hook
460
  hook(number);
461
- });
462
- }
463
-
464
- // custom element
465
- function custom_link() {
466
-
467
- $(document).on('click', '.ctc_chat, #ctc_chat', function (e) {
468
- console.log('class/Id: ctc_chat');
469
- ht_ctc_link(this);
470
-
471
- if ($(this).hasClass('ctc_woo_place')) {
472
- // its woo link..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
473
  e.preventDefault();
474
- }
475
- });
 
 
476
 
477
- $(document).on('click', '[href="#ctc_chat"]', function (e) {
478
- console.log('#ctc_chat');
479
- e.preventDefault();
480
- ht_ctc_link(this);
481
- });
482
- }
483
 
 
484
 
485
- // webhooks
486
- function hook(number) {
487
 
488
- console.log('hook');
489
 
490
- if (ctc.hook_url) {
491
 
492
- var h_url = ctc.hook_url;
493
 
494
- console.log(h_url);
 
495
 
496
- var hook_values = {};
497
 
498
- // hook values
499
- if (ctc.hook_v) {
500
-
501
- var hook_values = ctc.hook_v;
502
-
503
- console.log(typeof hook_values);
504
  console.log(hook_values);
505
 
506
- }
 
 
 
 
507
 
508
- console.log(h_url);
509
- console.log(hook_values);
510
 
511
- document.dispatchEvent(
512
- new CustomEvent("ht_ctc_event_hook", { detail: { ctc, number } })
513
- );
514
- h_url = ctc.hook_url;
515
- console.log(h_url);
516
-
517
- hook_values = ctc.hook_v;
518
- console.log(hook_values);
519
 
520
- data = JSON.stringify(hook_values);
 
521
 
522
- console.log(data);
523
- console.log(typeof data);
524
 
 
 
 
 
 
 
 
 
 
525
 
526
- $.ajax({
527
- url: h_url,
528
- type: "POST",
529
- mode: 'no-cors',
530
- data: data,
531
- success: function (response) {
532
- console.log(response);
533
- }
534
- });
 
 
 
 
 
535
 
536
- // fetch(h_url, {
537
- // method: 'POST',
538
- // mode: 'no-cors',
539
- // headers: {
540
- // 'Content-Type': 'application/json'
541
- // },
542
- // body: JSON.stringify(data),
543
- // }).then(response => {
544
- // console.log(response);
545
- // }).catch(e => {
546
- // console.log(e.message);
547
- // });
548
 
549
  }
550
 
551
-
552
- }
553
-
554
 
555
 
556
- });
557
 
558
  })(jQuery);
1
  // Click to Chat
2
  (function ($) {
3
 
4
+ // ready
5
+ $(function () {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
+ // variables
8
+ var url = window.location.href;
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 ht_ctc_storage = {};
 
15
 
16
+ if (localStorage.getItem('ht_ctc_storage')) {
17
+ ht_ctc_storage = localStorage.getItem('ht_ctc_storage');
18
+ ht_ctc_storage = JSON.parse(ht_ctc_storage);
 
19
  }
20
 
21
+ // get items from ht_ctc_storage
22
+ function ctc_getItem(item) {
23
+ return (ht_ctc_storage[item]) ? ht_ctc_storage[item] : false;
24
+ }
 
 
 
 
 
 
 
 
25
 
26
+ // set items to ht_ctc_storage storage
27
+ function ctc_setItem(name, value) {
28
+ ht_ctc_storage[name] = value;
29
+ var newValues = JSON.stringify(ht_ctc_storage);
30
+ localStorage.setItem('ht_ctc_storage', newValues);
31
+ }
32
 
33
+ var ctc = '';
34
+ if (typeof ht_ctc_chat_var !== "undefined") {
35
+ ctc = ht_ctc_chat_var;
36
+ chat_data();
37
+ start();
38
+ } else {
39
+ try {
40
+ if (document.querySelector('.ht_ctc_chat_data')) {
41
+ var settings = $('.ht_ctc_chat_data').attr('data-settings');
42
+ ctc = JSON.parse(settings);
43
+ }
44
+ } catch (e) {
45
+ ctc = {};
46
+ }
47
+ chat_data();
48
+ start();
49
+ }
50
 
51
+ function chat_data() {
52
 
53
+ // if no num
54
+ var chat_data = document.querySelector('.ht_ctc_chat_data');
55
 
56
+ if (chat_data) {
57
+ no_num = $(".ht_ctc_chat_data").attr('data-no_number');
58
+ // remove the element
59
+ chat_data.remove();
60
+ }
61
 
62
+ }
63
 
64
+ // start
65
+ function start() {
66
 
67
+ console.log(ctc);
 
 
 
 
 
68
  document.dispatchEvent(
69
+ new CustomEvent("ht_ctc_event_settings", { detail: { ctc } })
70
  );
71
 
72
+ // fixed position
73
+ ht_ctc();
74
 
75
+ // shortcode
76
+ shortcode();
 
77
 
78
+ // custom element
79
+ custom_link();
 
 
 
 
80
 
81
+ }
 
82
 
83
+
84
+
85
+
86
+
87
+
88
+ // fixed position
89
+ function ht_ctc() {
90
+ console.log('ht_ctc');
91
+ var ht_ctc_chat = document.querySelector('.ht-ctc-chat');
92
+ if (ht_ctc_chat) {
93
 
94
  document.dispatchEvent(
95
+ new CustomEvent("ht_ctc_event_chat")
96
  );
 
97
 
98
+ // display
99
+ display_settings(ht_ctc_chat);
100
 
101
+ // click
102
+ ht_ctc_chat.addEventListener('click', function () {
103
+ // ht_ctc_chat_greetings_box (ht_ctc_chat_greetings_box_link) is not exists..
104
 
105
+ if (!$('.ht_ctc_chat_greetings_box').length) {
106
+ console.log('no greetings dialog');
107
+ // link
108
+ ht_ctc_link(ht_ctc_chat);
109
+ }
110
+ });
111
 
112
+ // greetings dialog settings..
113
+ greetings();
 
 
114
 
115
+ // greetings link click..
116
+ $(document).on('click', '.ht_ctc_chat_greetings_box_link', function (e) {
117
+ console.log('ht_ctc_chat_greetings_box_link');
118
+ e.preventDefault();
119
+ ht_ctc_link(ht_ctc_chat);
120
 
121
+ document.dispatchEvent(
122
+ new CustomEvent("ht_ctc_event_greetings")
123
+ );
124
+ });
125
+
126
+ }
 
 
127
 
128
  }
129
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
 
131
+ /**
132
+ * greetings dialog
133
+ */
134
+ function greetings() {
135
 
136
+ if ($('.ht_ctc_chat_greetings_box').length) {
 
 
137
 
138
+ $(document).on('click', '.ht_ctc_chat_style', function (e) {
139
+ // ctc_greetings_opened / ctc_greetings_closed
140
+ if ($('.ht_ctc_chat_greetings_box').hasClass('ctc_greetings_opened')) {
141
+ greetings_close('user_closed');
142
+ } else {
143
+ greetings_open('user_opened');
144
+ }
145
+ });
146
 
147
+ }
 
 
 
 
148
 
149
+ // close btn - greetings dialog
150
+ $(document).on('click', '.ctc_greetings_close_btn', function (e) {
151
+ greetings_close('user_closed');
152
+ });
153
 
154
  }
155
 
156
+ function greetings_display() {
157
+
158
+ if ($('.ht_ctc_chat_greetings_box').length) {
159
+
160
+ // Display greetings - device based
161
+ if (ctc.g_device) {
162
+ if (is_mobile !== 'yes' && 'mobile' == ctc.g_device) {
163
+ // in desktop, mobile only
164
+ $('.ht_ctc_chat_greetings_box').remove();
165
+ return;
166
+ } else if (is_mobile == 'yes' && 'desktop' == ctc.g_device) {
167
+ // in mobile, desktop only
168
+ $('.ht_ctc_chat_greetings_box').remove();
169
+ return;
170
+ }
171
+ }
 
 
 
 
 
 
 
 
 
 
172
 
173
+ document.dispatchEvent(
174
+ new CustomEvent("ht_ctc_event_after_chat_displayed", { detail: { ctc, greetings_open, greetings_close } })
175
+ );
176
 
177
+ if (ctc.g_init && 'open' == ctc.g_init && 'user_closed' !== ctc_getItem('g_user_action')) {
178
+ greetings_open('init');
179
+ }
 
 
 
 
 
 
180
 
 
 
 
 
 
 
 
181
 
182
+ $(document).on('click', '.ctc_greetings, #ctc_greetings', function (e) {
183
+ console.log('greetings open triggered');
184
+ greetings_close('element');
185
+ greetings_open('element');
186
+ });
187
+
188
 
 
 
189
  }
 
 
190
 
191
+ }
 
 
192
 
193
+ /**
194
+ * ht_ctc_chat_greetings_box_user_action - this is needed for initial close or open.. if user closed.. then no auto open initially
195
+ *
196
+ */
197
+ function greetings_open(message = 'open') {
198
+ console.log('open');
199
+ $('.ctc_cta_stick').remove();
200
+ $('.ht_ctc_chat_greetings_box').show(70);
201
+ $('.ht_ctc_chat_greetings_box').addClass('ctc_greetings_opened').removeClass('ctc_greetings_closed');
202
+ ctc_setItem('g_action', message);
203
+ if ('user_opened' == message) {
204
+ ctc_setItem('g_user_action', message);
205
  }
206
  }
207
 
208
+ function greetings_close(message = 'close') {
209
+ console.log('close');
210
+ $('.ht_ctc_chat_greetings_box').hide(70);
211
+ $('.ht_ctc_chat_greetings_box').addClass('ctc_greetings_closed').removeClass('ctc_greetings_opened');
212
+ ctc_setItem('g_action', message);
213
+ if ('user_closed' == message) {
214
+ ctc_setItem('g_user_action', message);
215
+ }
216
+ }
217
 
218
+ // display settings - Fixed position style
219
+ function display_settings(ht_ctc_chat) {
220
 
221
+ if ('yes' == ctc.schedule) {
222
+ console.log('scheduled');
223
+ document.dispatchEvent(
224
+ new CustomEvent("ht_ctc_event_display", { detail: { ctc, display_chat, ht_ctc_chat } })
225
+ );
226
+ } else {
227
+ console.log('display directly');
228
+ display_chat(ht_ctc_chat);
229
+ }
230
 
231
+ }
232
 
233
+ // display based on device
234
+ function display_chat(p) {
235
 
236
+ if (is_mobile == 'yes') {
237
+ if ('show' == ctc.dis_m) {
 
 
 
 
 
 
238
 
239
+ // remove desktop style
240
+ var rm = document.querySelector('.ht_ctc_desktop_chat');
241
+ (rm) ? rm.remove() : '';
 
 
 
 
242
 
243
+ p.style.cssText = ctc.pos_m + ctc.css;
244
+ display(p)
245
+ }
246
+ } else {
247
+ if ('show' == ctc.dis_d) {
248
 
249
+ // remove mobile style
250
+ var rm = document.querySelector('.ht_ctc_mobile_chat');
251
+ (rm) ? rm.remove() : '';
252
 
253
+ p.style.cssText = ctc.pos_d + ctc.css;
254
+ display(p)
255
+ }
256
+ }
257
 
 
 
258
 
 
 
 
 
259
  }
260
 
261
+ function display(p) {
262
+ try {
263
+ $(p).show(parseInt(ctc.se));
264
+ } catch (e) {
265
+ p.style.display = "block";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
266
  }
267
+
268
+ greetings_display();
269
+
270
+ ht_ctc_things(p);
271
  }
272
 
273
+ // animiation, cta hover effect
274
+ function ht_ctc_things(p) {
275
+ console.log('animations ' + ctc.ani);
276
+ // animations
277
+ var an_time = ($(p).hasClass('ht_ctc_entry_animation')) ? 1200 : 120;
278
+ setTimeout(function () {
279
+ p.classList.add('ht_ctc_animation', ctc.ani);
280
+ }, an_time);
281
+
282
+ // cta hover effects
283
+ $(".ht-ctc-chat").hover(function () {
284
+ $('.ht-ctc-chat .ht-ctc-cta-hover').show(120);
285
+ }, function () {
286
+ $('.ht-ctc-chat .ht-ctc-cta-hover').hide(100);
287
  });
288
  }
289
 
290
+ // analytics
291
+ function ht_ctc_chat_analytics(values) {
 
 
 
 
 
 
292
 
293
+ console.log('analytics');
294
+
295
+ document.dispatchEvent(
296
+ new CustomEvent("ht_ctc_event_analytics")
297
+ );
298
+
299
+ // global number (fixed, user created elememt)
300
+ var id = ctc.number;
301
+
302
+ // if its shortcode
303
+ if (values.classList.contains('ht-ctc-sc')) {
304
+ // shortcode number
305
+ id = values.getAttribute('data-number');
306
  }
 
307
 
308
+ // Google Analytics
309
+ var ga_category = 'Click to Chat for WhatsApp';
310
+ var ga_action = 'chat: ' + id;
311
+ var ga_label = post_title + ', ' + url;
312
+
313
+ // if ga_enabled
314
+ if (ctc.ga || ctc.ga4) {
315
+ console.log('google analytics');
316
+
317
+ if (typeof gtag !== "undefined") {
318
+ console.log('gtag');
319
+ if (ctc.ga4) {
320
+ // ga4
321
+ // gtag may not work if ga4 installed using gtm
322
+ console.log('ga4');
323
+ gtag('event', 'click to chat', {
324
+ 'number': id,
325
+ 'title': post_title,
326
+ 'url': url,
327
+ });
328
+ } else {
329
+ gtag('event', ga_action, {
330
+ 'event_category': ga_category,
331
+ 'event_label': ga_label,
332
+ });
333
+ }
334
+ } else if (typeof ga !== "undefined" && typeof ga.getAll !== "undefined") {
335
+ console.log('ga');
336
+ var tracker = ga.getAll();
337
+ tracker[0].send("event", ga_category, ga_action, ga_label);
338
+ // ga('send', 'event', 'check ga_category', 'ga_action', 'ga_label');
339
+ // ga.getAll()[0].send("event", 'check ga_category', 'ga_action', 'ga_label');
340
+ } else if (typeof __gaTracker !== "undefined") {
341
+ __gaTracker('send', 'event', ga_category, ga_action, ga_label);
342
+ }
343
+ }
344
 
345
+ // dataLayer
346
+ if (typeof dataLayer !== "undefined") {
347
+ console.log('dataLayer');
348
+ dataLayer.push({
349
+ 'event': 'Click to Chat',
350
+ 'type': 'chat',
351
+ 'number': id,
352
+ 'title': post_title,
353
+ 'url': url,
354
+ 'event_category': ga_category,
355
+ 'event_label': ga_label,
356
+ 'event_action': ga_action
357
+ });
358
+ }
359
 
360
+ // google ads - call conversation code
361
+ if (ctc.ads) {
362
+ console.log('google ads enabled');
363
+ if (typeof gtag_report_conversion !== "undefined") {
364
+ console.log('calling gtag_report_conversion');
365
+ gtag_report_conversion();
366
+ }
367
+ }
368
 
369
+ // FB Pixel
370
+ if (ctc.fb) {
371
+ console.log('fb pixel');
372
+ if (typeof fbq !== "undefined") {
373
+ fbq('trackCustom', 'Click to Chat by HoliThemes', {
374
+ 'Category': 'Click to Chat for WhatsApp',
375
+ 'return_type': 'chat',
376
+ 'ID': id,
377
+ 'Title': post_title,
378
+ 'URL': url
379
+ });
380
+ }
381
+ }
382
 
 
 
 
 
 
 
 
 
383
  }
384
 
385
+ // link - chat
386
+ function ht_ctc_link(values) {
387
 
388
+ console.log(ctc.number);
389
+ document.dispatchEvent(
390
+ new CustomEvent("ht_ctc_event_number", { detail: { ctc } })
391
+ );
 
392
 
393
+ console.log(ctc.number);
 
 
 
 
 
 
 
394
 
395
+ var number = ctc.number;
396
+ var pre_filled = ctc.pre_filled;
 
 
 
397
 
398
+ if (values.hasAttribute('data-number')) {
399
+ console.log('has number attribute');
400
+ number = values.getAttribute('data-number');
401
+ }
402
 
403
+ if (values.hasAttribute('data-pre_filled')) {
404
+ console.log('has pre_filled attribute');
405
+ pre_filled = values.getAttribute('data-pre_filled');
406
+ }
407
 
 
 
408
  pre_filled = pre_filled.replace(/\[url]/gi, url);
409
  pre_filled = encodeURIComponent(pre_filled);
410
 
411
+ if ('' == number) {
412
+ console.log('no number');
413
+ $(".ht-ctc-chat").html(no_num);
414
+ return;
415
+ }
416
+
417
+ // web/api.whatsapp or wa.me
418
  if (ctc.web && is_mobile !== 'yes') {
419
  // web.whatsapp - if web api is enabled and is not mobile
420
  window.open('https://web.whatsapp.com/send' + '?phone=' + number + '&text=' + pre_filled, '_blank', 'noopener');
424
  }
425
 
426
  // analytics
427
+ ht_ctc_chat_analytics(values);
428
 
429
  // hook
430
  hook(number);
431
+
432
+ }
433
+
434
+ // shortcode
435
+ function shortcode() {
436
+ // shortcode - click
437
+ $(document).on('click', '.ht-ctc-sc-chat', function () {
438
+
439
+ var number = this.getAttribute('data-number');
440
+ var pre_filled = this.getAttribute('data-pre_filled');
441
+ pre_filled = pre_filled.replace(/\[url]/gi, url);
442
+ pre_filled = encodeURIComponent(pre_filled);
443
+
444
+ if (ctc.web && is_mobile !== 'yes') {
445
+ // web.whatsapp - if web api is enabled and is not mobile
446
+ window.open('https://web.whatsapp.com/send' + '?phone=' + number + '&text=' + pre_filled, '_blank', 'noopener');
447
+ } else {
448
+ // wa.me
449
+ window.open('https://wa.me/' + number + '?text=' + pre_filled, '_blank', 'noopener');
450
+ }
451
+
452
+ // analytics
453
+ ht_ctc_chat_analytics(this);
454
+
455
+ // hook
456
+ hook(number);
457
+ });
458
+ }
459
+
460
+ // custom element
461
+ function custom_link() {
462
+
463
+ $(document).on('click', '.ctc_chat, #ctc_chat', function (e) {
464
+ console.log('class/Id: ctc_chat');
465
+ ht_ctc_link(this);
466
+
467
+ if ($(this).hasClass('ctc_woo_place')) {
468
+ // its woo link..
469
+ e.preventDefault();
470
+ }
471
+ });
472
+
473
+ $(document).on('click', '[href="#ctc_chat"]', function (e) {
474
+ console.log('#ctc_chat');
475
  e.preventDefault();
476
+ ht_ctc_link(this);
477
+ });
478
+ }
479
+
480
 
481
+ // webhooks
482
+ function hook(number) {
 
 
 
 
483
 
484
+ console.log('hook');
485
 
486
+ if (ctc.hook_url) {
 
487
 
488
+ var h_url = ctc.hook_url;
489
 
490
+ console.log(h_url);
491
 
492
+ var hook_values = {};
493
 
494
+ // hook values
495
+ if (ctc.hook_v) {
496
 
497
+ var hook_values = ctc.hook_v;
498
 
499
+ console.log(typeof hook_values);
500
+ console.log(hook_values);
501
+
502
+ }
503
+
504
+ console.log(h_url);
505
  console.log(hook_values);
506
 
507
+ document.dispatchEvent(
508
+ new CustomEvent("ht_ctc_event_hook", { detail: { ctc, number } })
509
+ );
510
+ h_url = ctc.hook_url;
511
+ console.log(h_url);
512
 
513
+ hook_values = ctc.hook_v;
514
+ console.log(hook_values);
515
 
516
+ data = JSON.stringify(hook_values);
 
 
 
 
 
 
 
517
 
518
+ console.log(data);
519
+ console.log(typeof data);
520
 
 
 
521
 
522
+ $.ajax({
523
+ url: h_url,
524
+ type: "POST",
525
+ mode: 'no-cors',
526
+ data: data,
527
+ success: function (response) {
528
+ console.log(response);
529
+ }
530
+ });
531
 
532
+ // fetch(h_url, {
533
+ // method: 'POST',
534
+ // mode: 'no-cors',
535
+ // headers: {
536
+ // 'Content-Type': 'application/json'
537
+ // },
538
+ // body: JSON.stringify(data),
539
+ // }).then(response => {
540
+ // console.log(response);
541
+ // }).catch(e => {
542
+ // console.log(e.message);
543
+ // });
544
+
545
+ }
546
 
 
 
 
 
 
 
 
 
 
 
 
 
547
 
548
  }
549
 
 
 
 
550
 
551
 
552
+ });
553
 
554
  })(jQuery);
new/inc/commons/show-hide.php CHANGED
@@ -238,7 +238,7 @@ if ( 'hide' == $show_or_hide ) {
238
  if ( !empty($custom_post_types ) ) {
239
  if ( in_array( $post_type, $custom_post_types ) ) {
240
  if ( isset( $display_settings[$post_type] ) && 'hide' == $display_settings[$post_type] ) {
241
- $display = 'yes';
242
  return;
243
  }
244
  }
238
  if ( !empty($custom_post_types ) ) {
239
  if ( in_array( $post_type, $custom_post_types ) ) {
240
  if ( isset( $display_settings[$post_type] ) && 'hide' == $display_settings[$post_type] ) {
241
+ $display = 'no';
242
  return;
243
  }
244
  }
new/inc/greetings/class-ht-ctc-chat-greetings.php CHANGED
@@ -88,39 +88,29 @@ class HT_CTC_Chat_Greetings {
88
  $post_title = esc_html( get_the_title( $page_id ) );
89
  }
90
 
91
-
92
- // page level
93
- $ht_ctc_pagelevel = get_post_meta( $page_id, 'ht_ctc_pagelevel', true );
94
 
95
-
96
- $ht_ctc_greetings['greetings_template'] = ( isset( $ht_ctc_pagelevel['greetings_template']) ) ? esc_attr( $ht_ctc_pagelevel['greetings_template'] ) : '';
97
- if ( '' == $ht_ctc_greetings['greetings_template'] ) {
98
- $ht_ctc_greetings['greetings_template'] = ( isset( $greetings['greetings_template']) ) ? esc_attr( $greetings['greetings_template'] ) : '';
 
 
 
 
99
  }
100
 
 
 
101
  // return if template not set..
102
- if ( '' == $ht_ctc_greetings['greetings_template'] ) {
103
  return;
104
  }
105
 
106
-
107
- $ht_ctc_greetings['header_content'] = (isset($ht_ctc_pagelevel['header_content'])) ? esc_attr($ht_ctc_pagelevel['header_content']) : '';
108
- if ( '' == $ht_ctc_greetings['header_content'] ) {
109
- $ht_ctc_greetings['header_content'] = ( isset( $greetings['header_content']) ) ? esc_attr($greetings['header_content']) : '';
110
- }
111
  $ht_ctc_greetings['header_content'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_greetings['header_content'], 'Click to Chat for WhatsApp', 'greetings_header_content' );
112
-
113
- $ht_ctc_greetings['main_content'] = (isset($ht_ctc_pagelevel['main_content'])) ? esc_attr($ht_ctc_pagelevel['main_content']) : '';
114
- if ( '' == $ht_ctc_greetings['main_content'] ) {
115
- $ht_ctc_greetings['main_content'] = ( isset( $greetings['main_content']) ) ? esc_attr($greetings['main_content']) : '';
116
- }
117
  $ht_ctc_greetings['main_content'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_greetings['main_content'], 'Click to Chat for WhatsApp', 'greetings_main_content' );
118
-
119
- $ht_ctc_greetings['bottom_content'] = (isset($ht_ctc_pagelevel['bottom_content'])) ? esc_attr($ht_ctc_pagelevel['bottom_content']) : '';
120
- if ( '' == $ht_ctc_greetings['bottom_content'] ) {
121
- $ht_ctc_greetings['bottom_content'] = ( isset( $greetings['bottom_content']) ) ? esc_attr($greetings['bottom_content']) : '';
122
- }
123
  $ht_ctc_greetings['bottom_content'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_greetings['bottom_content'], 'Click to Chat for WhatsApp', 'greetings_bottom_content' );
 
 
124
 
125
  $allowed_html = wp_kses_allowed_html( 'post' );
126
 
@@ -155,11 +145,6 @@ class HT_CTC_Chat_Greetings {
155
  // greetings dialog position based on chat icon/button position
156
  $g_position_r_l = ( isset( $chat['side_2']) ) ? esc_attr( $chat['side_2'] ) : 'right';
157
 
158
- $ht_ctc_greetings['call_to_action'] = ( isset( $greetings['call_to_action']) ) ? esc_attr( $greetings['call_to_action'] ) : '';
159
- if ('' == $ht_ctc_greetings['call_to_action']) {
160
- $ht_ctc_greetings['call_to_action'] = 'WhatsApp';
161
- }
162
-
163
  $ht_ctc_greetings['path'] = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/greetings/' . $ht_ctc_greetings['greetings_template']. '.php';
164
 
165
  // filter hook to update values...
88
  $post_title = esc_html( get_the_title( $page_id ) );
89
  }
90
 
 
 
 
91
 
92
+ $ht_ctc_greetings['greetings_template'] = ( isset( $greetings['greetings_template']) ) ? esc_attr( $greetings['greetings_template'] ) : '';
93
+ $ht_ctc_greetings['header_content'] = ( isset( $greetings['header_content']) ) ? esc_attr($greetings['header_content']) : '';
94
+ $ht_ctc_greetings['main_content'] = ( isset( $greetings['main_content']) ) ? esc_attr($greetings['main_content']) : '';
95
+ $ht_ctc_greetings['bottom_content'] = ( isset( $greetings['bottom_content']) ) ? esc_attr($greetings['bottom_content']) : '';
96
+ $ht_ctc_greetings['call_to_action'] = ( isset( $greetings['call_to_action']) ) ? esc_attr( $greetings['call_to_action'] ) : '';
97
+
98
+ if ('' == $ht_ctc_greetings['call_to_action']) {
99
+ $ht_ctc_greetings['call_to_action'] = 'WhatsApp';
100
  }
101
 
102
+ $ht_ctc_greetings = apply_filters( 'ht_ctc_fh_greetings_start', $ht_ctc_greetings );
103
+
104
  // return if template not set..
105
+ if ( '' == $ht_ctc_greetings['greetings_template'] || 'no' == $ht_ctc_greetings['greetings_template'] ) {
106
  return;
107
  }
108
 
 
 
 
 
 
109
  $ht_ctc_greetings['header_content'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_greetings['header_content'], 'Click to Chat for WhatsApp', 'greetings_header_content' );
 
 
 
 
 
110
  $ht_ctc_greetings['main_content'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_greetings['main_content'], 'Click to Chat for WhatsApp', 'greetings_main_content' );
 
 
 
 
 
111
  $ht_ctc_greetings['bottom_content'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_greetings['bottom_content'], 'Click to Chat for WhatsApp', 'greetings_bottom_content' );
112
+ $ht_ctc_greetings['call_to_action'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_greetings['call_to_action'], 'Click to Chat for WhatsApp', 'greetings_call_to_action' );
113
+
114
 
115
  $allowed_html = wp_kses_allowed_html( 'post' );
116
 
145
  // greetings dialog position based on chat icon/button position
146
  $g_position_r_l = ( isset( $chat['side_2']) ) ? esc_attr( $chat['side_2'] ) : 'right';
147
 
 
 
 
 
 
148
  $ht_ctc_greetings['path'] = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/greetings/' . $ht_ctc_greetings['greetings_template']. '.php';
149
 
150
  // filter hook to update values...
new/inc/greetings/greetings_styles/g-cta-7_1.php CHANGED
@@ -10,12 +10,12 @@ if ( ! defined( 'ABSPATH' ) ) exit;
10
  $s7_1_options = get_option( 'ht_ctc_s7_1' );
11
  $s7_1_options = apply_filters( 'ht_ctc_fh_s7_1_options', $s7_1_options );
12
 
13
- $s7_icon_size = esc_attr( $s7_1_options['s7_icon_size'] );
14
- $s7_icon_color = esc_attr( $s7_1_options['s7_icon_color'] );
15
- $s7_icon_color_hover = esc_attr( $s7_1_options['s7_icon_color_hover'] );
16
- $s7_bgcolor = esc_attr( $s7_1_options['s7_bgcolor'] );
17
- $s7_bgcolor_hover = esc_attr( $s7_1_options['s7_bgcolor_hover'] );
18
- $s7_border_size = esc_attr( $s7_1_options['s7_border_size'] );
19
 
20
  // Call to action
21
  $s7_1_cta_font_size = (isset( $s7_1_options['cta_font_size'])) ? esc_attr( $s7_1_options['cta_font_size'] ) : '';
10
  $s7_1_options = get_option( 'ht_ctc_s7_1' );
11
  $s7_1_options = apply_filters( 'ht_ctc_fh_s7_1_options', $s7_1_options );
12
 
13
+ $s7_icon_size = (isset( $s7_1_options['s7_icon_size'])) ? esc_attr( $s7_1_options['s7_icon_size'] ) : '';
14
+ $s7_icon_color = (isset( $s7_1_options['s7_icon_color'])) ? esc_attr( $s7_1_options['s7_icon_color'] ) : '';
15
+ $s7_icon_color_hover = (isset( $s7_1_options['s7_icon_color_hover'])) ? esc_attr( $s7_1_options['s7_icon_color_hover'] ) : '';
16
+ $s7_bgcolor = (isset( $s7_1_options['s7_bgcolor'])) ? esc_attr( $s7_1_options['s7_bgcolor'] ) : '';
17
+ $s7_bgcolor_hover = (isset( $s7_1_options['s7_bgcolor_hover'])) ? esc_attr( $s7_1_options['s7_bgcolor_hover'] ) : '';
18
+ $s7_border_size = (isset( $s7_1_options['s7_border_size'])) ? esc_attr( $s7_1_options['s7_border_size'] ) : '';
19
 
20
  // Call to action
21
  $s7_1_cta_font_size = (isset( $s7_1_options['cta_font_size'])) ? esc_attr( $s7_1_options['cta_font_size'] ) : '';
prev/admin/admin.php CHANGED
@@ -18,5 +18,4 @@ include_once 'commons/class-ht-ccw-admin-lists.php';
18
 
19
  include_once 'class-ccw-admin-menu.php';
20
  include_once 'class-ccw-admin-page.php';
21
- include_once 'class-ccw-admin-page-customize-styles.php';
22
- include_once 'class-ccw-admin-others.php';
18
 
19
  include_once 'class-ccw-admin-menu.php';
20
  include_once 'class-ccw-admin-page.php';
21
+ include_once 'class-ccw-admin-page-customize-styles.php';
 
prev/admin/class-ccw-admin-others.php DELETED
@@ -1,49 +0,0 @@
1
- <?php
2
- /**
3
- * Other function, features .. to
4
- *
5
- * admin notices
6
- * If whatsapp number not added.
7
- *
8
- * @since 2.7
9
- * @package ctc
10
- * @subpackage admin
11
- */
12
-
13
- if ( ! defined( 'ABSPATH' ) ) exit;
14
-
15
- if ( ! class_exists( 'HT_CCW_Admin_Others' ) ) :
16
-
17
- class HT_CCW_Admin_Others {
18
-
19
-
20
- public function __construct() {
21
- $this->admin_notice();
22
- }
23
-
24
- function admin_notice() {
25
-
26
- // if number blank
27
- $ccw_options = get_option('ccw_options');
28
- if ( isset( $ccw_options['number'] ) ) {
29
- if ( '' == $ccw_options['number'] ) {
30
- add_action('admin_notices', array( $this, 'ifnumberblank') );
31
- }
32
- }
33
- }
34
-
35
- function ifnumberblank() {
36
- ?>
37
- <div class="notice notice-info is-dismissible">
38
- <p>Click to Chat is almost ready. <a href="<?= admin_url('admin.php?page=click-to-chat');?>">Add WhatsApp Number</a> to let vistiors chat.</p>
39
- <!-- <a href="?dismis">Dismiss</a> -->
40
- </div>
41
- <?php
42
- }
43
-
44
-
45
- }
46
-
47
- new HT_CCW_Admin_Others();
48
-
49
- endif; // END class_exists check
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
prev/admin/class-ccw-admin-page-customize-styles.php CHANGED
@@ -23,7 +23,6 @@ class CCW_Admin_Page_Customize_Styles {
23
  register_setting( 'ccw_settings_group_cs', 'ccw_options_cs' , 'ccw_options_sanitize_cs_cb' );
24
 
25
  register_setting( 'ccw_settings_group_cs', 'ht_ccw_ga' , 'ccw_options_sanitize_cs_cb' );
26
- register_setting( 'ccw_settings_group_cs', 'ht_ccw_fb' , 'ccw_options_sanitize_cs_cb' );
27
 
28
  add_settings_section( 'ccw_settings_cs', '', array( $this, 'ccw_settings_section_cs_cb' ), 'ccw_options_settings_cs' );
29
 
@@ -40,8 +39,6 @@ class CCW_Admin_Page_Customize_Styles {
40
  add_settings_field( 'ccw_animations', 'Animations', array( $this, 'ccw_animations_cb' ), 'ccw_options_settings_cs', 'ccw_settings_cs' );
41
 
42
  add_settings_field( 'ht_ccw_ga', 'Google Analytics', array( $this, 'ht_ccw_ga_cb' ), 'ccw_options_settings_cs', 'ccw_settings_cs' );
43
- add_settings_field( 'ht_ccw_fb', 'Facebook Analytics', array( $this, 'ht_ccw_fb_cb' ), 'ccw_options_settings_cs', 'ccw_settings_cs' );
44
-
45
  }
46
 
47
 
@@ -61,8 +58,6 @@ class CCW_Admin_Page_Customize_Styles {
61
  <p class="description"> Style-1 is the default theme button. (looks like currently activated Theme button).</p>
62
  <br>
63
  <p class="description">For customizable button, please select style-8</p>
64
- <br><br>
65
- <p class="description">changes made in style-1 since <a target="_blank" href="https://holithemes.com/plugins/whatsapp-chat/v-1-7">Version-1.7</a></p>
66
  </div>
67
 
68
  </div>
@@ -670,10 +665,9 @@ class CCW_Admin_Page_Customize_Styles {
670
  ?>
671
  <ul class="collapsible" data-collapsible="accordion">
672
  <li>
673
- <div class="collapsible-header">Animations - alpha release </div>
674
  <div class="collapsible-body">
675
 
676
- <p class="description"> alpha stage, things may change, may not work as like this in next releases, </br> may need to reconfigure also .. </p>
677
  <p class="description"> Animations for floating styles - <a target="_blank" href="https://holithemes.com/plugins/whatsapp-chat/animations/">more info</a> </p>
678
  <br><br>
679
 
@@ -784,108 +778,6 @@ class CCW_Admin_Page_Customize_Styles {
784
  }
785
 
786
 
787
- // fb Analytics
788
- function ht_ccw_fb_cb() {
789
- $ht_ccw_fb = get_option('ht_ccw_fb');
790
- $fb_event_name = esc_attr( $ht_ccw_fb['fb_event_name'] );
791
- $p1_value = esc_attr( $ht_ccw_fb['p1_value'] );
792
- $p2_value = esc_attr( $ht_ccw_fb['p2_value'] );
793
- $p3_value = esc_attr( $ht_ccw_fb['p3_value'] );
794
- $p1_name = esc_attr( $ht_ccw_fb['p1_name'] );
795
- $p2_name = esc_attr( $ht_ccw_fb['p2_name'] );
796
- $p3_name = esc_attr( $ht_ccw_fb['p3_name'] );
797
-
798
- ?>
799
- <ul class="collapsible" data-collapsible="accordion">
800
- <li>
801
- <div id="fb-analytics" class="collapsible-header">Facebook Analytics </div>
802
- <div class="collapsible-body">
803
-
804
- <p class="description"> Enable Facebook Analytics at plugin home settings - <a target="_blank" href="<?= admin_url( 'admin.php?page=click-to-chat' ); ?>"><?php _e( 'Click to Chat' , 'click-to-chat-for-whatsapp' ) ?></a> </p>
805
- <p class="description"> Event Parameters - <a target="_blank" href="https://holithemes.com/plugins/whatsapp-chat/facebook-analytics/"><?php _e( 'more info' , 'click-to-chat-for-whatsapp' ) ?></a> </p>
806
- <br><br>
807
-
808
- <!-- Event Name -->
809
- <div class="row">
810
- <div class="col s6">
811
- <p>Event Name</p>
812
- </div>
813
- <div class="input-field col s5">
814
- <input name="ht_ccw_fb[fb_event_name]" value="<?= esc_attr( $ht_ccw_fb['fb_event_name'] ) ?>" type="text" class="" >
815
- </div>
816
- </div>
817
-
818
- <!-- Parameter 1 -->
819
- <div class="row">
820
- <div class="col s6">
821
- <p>Custom Parameter 1</p>
822
- </div>
823
- <div class="input-field col s5">
824
-
825
- <div class="input-field col">
826
- <input name="ht_ccw_fb[p1_name]" value="<?= esc_attr( $ht_ccw_fb['p1_name'] ) ?>" id="p1_name" type="text" class="" >
827
- <label for="p1_name">Name: </label>
828
- </div>
829
-
830
- <div class="input-field col">
831
- <input name="ht_ccw_fb[p1_value]" value="<?= esc_attr( $ht_ccw_fb['p1_value'] ) ?>" id="p1_value" type="text" class="" >
832
- <label for="p1_value">Value: </label>
833
- </div>
834
-
835
- </div>
836
- </div>
837
-
838
-
839
- <!-- Parameter 2 -->
840
- <div class="row">
841
- <div class="col s6">
842
- <p>Custom Parameter 2</p>
843
- </div>
844
- <div class="input-field col s5">
845
-
846
- <div class="input-field col">
847
- <input name="ht_ccw_fb[p2_name]" value="<?= esc_attr( $ht_ccw_fb['p2_name'] ) ?>" id="p2_name" type="text" class="" >
848
- <label for="p2_name">Name: </label>
849
- </div>
850
-
851
- <div class="input-field col">
852
- <input name="ht_ccw_fb[p2_value]" value="<?= esc_attr( $ht_ccw_fb['p2_value'] ) ?>" id="p2_value" type="text" class="" >
853
- <label for="p2_value">Value: </label>
854
- </div>
855
-
856
- </div>
857
- </div>
858
-
859
-
860
- <!-- Parameter 3 -->
861
- <div class="row">
862
- <div class="col s6">
863
- <p>Custom Parameter 3</p>
864
- </div>
865
- <div class="input-field col s5">
866
-
867
- <div class="input-field col">
868
- <input name="ht_ccw_fb[p3_name]" value="<?= esc_attr( $ht_ccw_fb['p3_name'] ) ?>" id="p3_name" type="text" class="" >
869
- <label for="p3_name">Name: </label>
870
- </div>
871
-
872
- <div class="input-field col">
873
- <input name="ht_ccw_fb[p3_value]" value="<?= esc_attr( $ht_ccw_fb['p3_value'] ) ?>" id="p3_value" type="text" class="" >
874
- <label for="p3_value">Value: </label>
875
- </div>
876
-
877
- </div>
878
- </div>
879
-
880
- </div>
881
- </div>
882
- </li>
883
- </ul>
884
-
885
- <?php
886
- }
887
-
888
-
889
 
890
  // sanitize
891
  function ccw_options_sanitize_cs_cb( $input ) {
23
  register_setting( 'ccw_settings_group_cs', 'ccw_options_cs' , 'ccw_options_sanitize_cs_cb' );
24
 
25
  register_setting( 'ccw_settings_group_cs', 'ht_ccw_ga' , 'ccw_options_sanitize_cs_cb' );
 
26
 
27
  add_settings_section( 'ccw_settings_cs', '', array( $this, 'ccw_settings_section_cs_cb' ), 'ccw_options_settings_cs' );
28
 
39
  add_settings_field( 'ccw_animations', 'Animations', array( $this, 'ccw_animations_cb' ), 'ccw_options_settings_cs', 'ccw_settings_cs' );
40
 
41
  add_settings_field( 'ht_ccw_ga', 'Google Analytics', array( $this, 'ht_ccw_ga_cb' ), 'ccw_options_settings_cs', 'ccw_settings_cs' );
 
 
42
  }
43
 
44
 
58
  <p class="description"> Style-1 is the default theme button. (looks like currently activated Theme button).</p>
59
  <br>
60
  <p class="description">For customizable button, please select style-8</p>
 
 
61
  </div>
62
 
63
  </div>
665
  ?>
666
  <ul class="collapsible" data-collapsible="accordion">
667
  <li>
668
+ <div class="collapsible-header">Animations </div>
669
  <div class="collapsible-body">
670
 
 
671
  <p class="description"> Animations for floating styles - <a target="_blank" href="https://holithemes.com/plugins/whatsapp-chat/animations/">more info</a> </p>
672
  <br><br>
673
 
778
  }
779
 
780
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
781
 
782
  // sanitize
783
  function ccw_options_sanitize_cs_cb( $input ) {
prev/admin/class-ccw-admin-page.php CHANGED
@@ -21,7 +21,7 @@ class CCW_Admin_Page {
21
 
22
  add_settings_section( 'ccw_settings', '', array( $this, 'ccw_settings_section' ), 'ccw_options_settings' );
23
 
24
- add_settings_field( 'ht_ctc_switch', __( 'Switch to new User Interface' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_switch_cb' ), 'ccw_options_settings', 'ccw_settings' );
25
 
26
  add_settings_field( 'ccw_enable', __( 'Enable Floating Styles' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_enable_cb' ), 'ccw_options_settings', 'ccw_settings' );
27
  add_settings_field( 'ccw_enable_sc', __( 'Enable ShortCodes' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_enable_sc_cb' ), 'ccw_options_settings', 'ccw_settings' );
@@ -35,7 +35,6 @@ class CCW_Admin_Page {
35
  add_settings_field( 'ccw_placeholder', __( 'Text to Display' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_input_placeholder_cb' ), 'ccw_options_settings', 'ccw_settings' );
36
 
37
  add_settings_field( 'ccw_google_analytics', __( 'Google Analytics' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_google_analytics_cb' ), 'ccw_options_settings', 'ccw_settings' );
38
- add_settings_field( 'ccw_fb_analytics', __( 'Facebook Analytics' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_fb_analytics_cb' ), 'ccw_options_settings', 'ccw_settings' );
39
 
40
  add_settings_field( 'ccw_checkbox', __( 'Hide Based on post type' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_checkbox_cb' ), 'ccw_options_settings', 'ccw_settings' );
41
  add_settings_field( 'ccw_list_id_tohide', __( "Posts, Pages Id's to Hide" , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_list_id_tohide_cb' ), 'ccw_options_settings', 'ccw_settings' );
@@ -48,7 +47,7 @@ class CCW_Admin_Page {
48
 
49
  // heading
50
  function ccw_settings_section() {
51
- echo '<h1>Click to Chat For WhatsApp - Global Settings</h1>';
52
  }
53
 
54
 
@@ -69,7 +68,6 @@ class CCW_Admin_Page {
69
  <p class="description" style="color: red"> <strong> Please reconfigure the settings, after switching to the new interface </strong></p>
70
  <br>
71
  <p class="description">We developed a new interface with lot more features</p>
72
- <p class="description">Chat, Group and Share features</p>
73
  <br>
74
 
75
  <div class="row">
@@ -82,15 +80,6 @@ class CCW_Admin_Page {
82
  <label>Switch Interface</label>
83
  </div>
84
  </div>
85
-
86
- <!-- <p class="description"> Please reconfigure the settings, after switching to the new interface </p> -->
87
- <p class="description"> Modified: </p>
88
- <ol>
89
- <li class="description"> Styles </li>
90
- <li class="description"> Shortcodes </li>
91
- <li class="description"> Show/Hide feature to Show or Hide, the styles</li>
92
- </ol>
93
- <br>
94
  <p class="description"> <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/new-interface/">New Interface</a></p>
95
 
96
  </div>
@@ -369,38 +358,6 @@ class CCW_Admin_Page {
369
  }
370
 
371
 
372
- // Enable facebook Analytics
373
- function ccw_fb_analytics_cb() {
374
- $ccw_fb_analytics = get_option('ccw_options');
375
-
376
-
377
- if ( isset( $ccw_fb_analytics['fb_analytics'] ) ) {
378
- ?>
379
- <p>
380
- <label>
381
- <input name="ccw_options[fb_analytics]" type="checkbox" value="1" <?php checked( $ccw_fb_analytics['fb_analytics'], 1 ); ?> id="fb_analytics" />
382
- <span>Facebook Analytics</span>
383
- </label>
384
- </p>
385
- <?php
386
- } else {
387
- ?>
388
- <p>
389
- <label>
390
- <input name="ccw_options[fb_analytics]" type="checkbox" value="1" id="fb_analytics" />
391
- <span>Facebook Analytics</span>
392
- </label>
393
- </p>
394
- <?php
395
- }
396
- ?>
397
- <p class="description"> If Facebook Analytics is installed - creates an Event at there - <a target="_blank" href="https://holithemes.com/plugins/whatsapp-chat/facebook-analytics/">more info</a> </p>
398
- <p class="description"> Customize Event Values - <a target="_blank" href="<?= admin_url( 'admin.php?page=ccw-edit-styles#fb-analytics' ); ?>">Customize Styles</a> </p>
399
- <?php
400
- }
401
-
402
-
403
-
404
  // checkboxes - based on Type of posts ..
405
  function ccw_checkbox_cb() {
406
  $ccw_checkbox = get_option('ccw_options');
@@ -627,7 +584,7 @@ class CCW_Admin_Page {
627
  <p>
628
  <label>
629
  <input name="ccw_options[app_first]" type="checkbox" value="1" <?php checked( $ccw_app_first['app_first'], 1 ); ?> id="app_first" />
630
- <span>App First ( If Cache Issue )</span>
631
  </label>
632
  </p>
633
  <?php
@@ -636,13 +593,14 @@ class CCW_Admin_Page {
636
  <p>
637
  <label>
638
  <input name="ccw_options[app_first]" type="checkbox" value="1" id="app_first" />
639
- <span>App First ( If Cache Issue )</span>
640
  </label>
641
  </p>
642
  <?php
643
  }
644
  ?>
645
- <p class="description"> check this only if an issue with some cache plugin - api.whatsapp, web.whatsapp - <a target="_blank" href="https://holithemes.com/plugins/whatsapp-chat/app-first/">more info</a> </p>
 
646
  <?php
647
  }
648
 
21
 
22
  add_settings_section( 'ccw_settings', '', array( $this, 'ccw_settings_section' ), 'ccw_options_settings' );
23
 
24
+ add_settings_field( 'ht_ctc_switch', __( 'Switch to New Interface' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_switch_cb' ), 'ccw_options_settings', 'ccw_settings' );
25
 
26
  add_settings_field( 'ccw_enable', __( 'Enable Floating Styles' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_enable_cb' ), 'ccw_options_settings', 'ccw_settings' );
27
  add_settings_field( 'ccw_enable_sc', __( 'Enable ShortCodes' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_enable_sc_cb' ), 'ccw_options_settings', 'ccw_settings' );
35
  add_settings_field( 'ccw_placeholder', __( 'Text to Display' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_input_placeholder_cb' ), 'ccw_options_settings', 'ccw_settings' );
36
 
37
  add_settings_field( 'ccw_google_analytics', __( 'Google Analytics' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_google_analytics_cb' ), 'ccw_options_settings', 'ccw_settings' );
 
38
 
39
  add_settings_field( 'ccw_checkbox', __( 'Hide Based on post type' , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_checkbox_cb' ), 'ccw_options_settings', 'ccw_settings' );
40
  add_settings_field( 'ccw_list_id_tohide', __( "Posts, Pages Id's to Hide" , 'click-to-chat-for-whatsapp' ), array( $this, 'ccw_list_id_tohide_cb' ), 'ccw_options_settings', 'ccw_settings' );
47
 
48
  // heading
49
  function ccw_settings_section() {
50
+ echo '<h1>Click to Chat - Interface-1</h1>';
51
  }
52
 
53
 
68
  <p class="description" style="color: red"> <strong> Please reconfigure the settings, after switching to the new interface </strong></p>
69
  <br>
70
  <p class="description">We developed a new interface with lot more features</p>
 
71
  <br>
72
 
73
  <div class="row">
80
  <label>Switch Interface</label>
81
  </div>
82
  </div>
 
 
 
 
 
 
 
 
 
83
  <p class="description"> <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/new-interface/">New Interface</a></p>
84
 
85
  </div>
358
  }
359
 
360
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
361
  // checkboxes - based on Type of posts ..
362
  function ccw_checkbox_cb() {
363
  $ccw_checkbox = get_option('ccw_options');
584
  <p>
585
  <label>
586
  <input name="ccw_options[app_first]" type="checkbox" value="1" <?php checked( $ccw_app_first['app_first'], 1 ); ?> id="app_first" />
587
+ <span>App First ( api.whatsapp links )</span>
588
  </label>
589
  </p>
590
  <?php
593
  <p>
594
  <label>
595
  <input name="ccw_options[app_first]" type="checkbox" value="1" id="app_first" />
596
+ <span>App First ( api.whatsapp links )</span>
597
  </label>
598
  </p>
599
  <?php
600
  }
601
  ?>
602
+ <p class="description">if checked navigates to api.whatsapp in all devices instead of web.whatsapp in desktop - <a target="_blank" href="https://holithemes.com/plugins/whatsapp-chat/app-first/">more info</a> </p>
603
+ <p class="desciption">uncheck - If in mobile navigates to web.whatsapp, it might be cache issue.</p>
604
  <?php
605
  }
606
 
prev/admin/default-values.php CHANGED
@@ -134,22 +134,6 @@ $db_ccw_ga = get_option( 'ht_ccw_ga', array() );
134
  $update_ccw_ga = array_merge($ccw_ga, $db_ccw_ga);
135
  update_option('ht_ccw_ga', $update_ccw_ga);
136
 
137
- /**
138
- * fb Analytics
139
- * option - ht_ccw_fb
140
- */
141
- $ccw_fb = array(
142
- 'fb_event_name' => 'Click to Chat Event',
143
- 'p1_name' => 'Category',
144
- 'p2_name' => 'Action',
145
- 'p3_name' => 'Label',
146
- 'p1_value' => 'Click to Chat',
147
- 'p2_value' => 'Click',
148
- 'p3_value' => '{{url}}',
149
- );
150
- $db_ccw_fb = get_option( 'ht_ccw_fb', array() );
151
- $update_ccw_fb = array_merge($ccw_fb, $db_ccw_fb);
152
- update_option('ht_ccw_fb', $update_ccw_fb);
153
 
154
  // plugin details
155
  $plugin_details = array(
134
  $update_ccw_ga = array_merge($ccw_ga, $db_ccw_ga);
135
  update_option('ht_ccw_ga', $update_ccw_ga);
136
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
 
138
  // plugin details
139
  $plugin_details = array(
prev/admin/settings_page.php CHANGED
@@ -34,39 +34,5 @@ if ( ! defined( 'ABSPATH' ) ) exit;
34
 
35
  </div>
36
 
37
- <hr> <br> <br>
38
-
39
-
40
- <div class="row">
41
- <div class="col s12 m12 l12 xl9">
42
- <div class="row">
43
-
44
- <div class="col s12 m6">
45
- <div class="card blue-grey darken-1">
46
- <div class="card-content white-text">
47
- <span class="card-title">Plugin Review</span>
48
- <br>
49
- <p>If you like the plugin, please Support the Developers</p>
50
- <br>
51
- <p>By giving 5 Star rating</p>
52
- </div>
53
- <div class="card-action">
54
- <a target="_blank" href="https://wordpress.org/support/plugin/click-to-chat-for-whatsapp/reviews/#new-post">Plugin Review</a>
55
- </div>
56
- </div>
57
- </div>
58
-
59
- <div class="collection with-header">
60
- <div class="collection-header"><bold><?php _e( 'HoliThemes On', 'click-to-chat-for-whatsapp' ); ?></bold></div>
61
- <a target="_blank" href="https://www.facebook.com/holithemes/" class="collection-item"><?php _e( 'Facebook', 'click-to-chat-for-whatsapp' ); ?></a>
62
- <a target="_blank" href="https://twitter.com/holithemes" class="collection-item"><?php _e( 'Twitter', 'click-to-chat-for-whatsapp' ); ?></a>
63
- <a target="_blank" href="https://www.instagram.com/holithemes/" class="collection-item"><?php _e( 'Instagram', 'click-to-chat-for-whatsapp' ); ?></a>
64
- <a target="_blank" href="https://www.youtube.com/channel/UC2Tf_WB9PWffO2B3tswWCGw" class="collection-item"><?php _e( 'YouTube', 'click-to-chat-for-whatsapp' ); ?></a>
65
- <a target="_blank" href="https://www.linkedin.com/company/holithemes" class="collection-item"><?php _e( 'LinkedIn', 'click-to-chat-for-whatsapp' ); ?></a>
66
- </div>
67
-
68
- </div>
69
- </div>
70
- </div>
71
 
72
  </div>
34
 
35
  </div>
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
  </div>
prev/assets/css/mainstyles.css CHANGED
@@ -8,9 +8,7 @@
8
  font-weight: normal;
9
  font-style: normal;
10
  }
11
-
12
  .ccw_plugin .icon {
13
- /* use !important to prevent issues with browser extensions that change fonts */
14
  font-family: 'ccw' !important;
15
  speak: none;
16
  font-style: normal;
@@ -18,12 +16,9 @@
18
  font-variant: normal;
19
  text-transform: none;
20
  line-height: 1;
21
-
22
- /* Better Font Rendering =========== */
23
  -webkit-font-smoothing: antialiased;
24
  -moz-osx-font-smoothing: grayscale;
25
  }
26
-
27
  .icon-whatsapp2:before {
28
  content: "\E902";
29
  }
@@ -37,64 +32,41 @@
37
  .icon-whatsapp:before {
38
  content: "\EA93";
39
  }
40
-
41
- /* icon: prev: 5,6,7,8 */
42
-
43
-
44
- /*
45
- * animate.css
46
- *
47
- * custom Code
48
- */
49
  div.ccw_plugin,
50
  .inline {
51
  display: inline; }
52
-
53
  .inline-block {
54
  display: inline-block; }
55
-
56
  .chatbot {
57
  position: fixed;
58
  z-index: 99999999; }
59
-
60
  .img-icon {
61
  height: 48px; }
62
-
63
  .nofocus:focus {
64
  outline: none; }
65
-
66
  .pointer {
67
  cursor: pointer; }
68
-
69
  .sc_item {
70
  z-index: 99; }
71
-
72
  .style-3-sc {
73
  height: 20px; }
74
-
75
  .style-9-sc {
76
  height: 20px; }
77
-
78
  .img-icon-5 {
79
  height: 80%;
80
  vertical-align: middle; }
81
-
82
  .img-icon-6 {
83
  height: 63%;
84
  vertical-align: middle;
85
  margin-left: 7px; }
86
-
87
  .style-6-img {
88
  max-height: 40px;
89
  text-decoration: overline; }
90
-
91
  .icon-2 {
92
  font-size: 2rem; }
93
-
94
  .btn_only_style_div_circle {
95
  border-radius: 50%;
96
  text-align: center; }
97
-
98
  .btn_only_style_div_circle_sc {
99
  background-color: orange;
100
  border-radius: 50%;
@@ -102,34 +74,26 @@ div.ccw_plugin,
102
  width: 48px;
103
  line-height: 48px;
104
  text-align: center; }
105
-
106
  .btn_only_style_div {
107
  background-color: orange;
108
  height: 48px;
109
  width: 48px;
110
  line-height: 48px;
111
  text-align: center; }
112
-
113
  .style8 span {
114
  text-transform: none; }
115
-
116
- /* ==== animate.css ==== */
117
  .ccw_plugin .animated {
118
  animation-duration: 1s;
119
  animation-fill-mode: both; }
120
-
121
  .ccw_plugin .animated.infinite {
122
  animation-iteration-count: infinite; }
123
-
124
  .ccw_plugin .animated.hinge {
125
  animation-duration: 2s; }
126
-
127
  .ccw_plugin .animated.flipOutX,
128
  .ccw_plugin .animated.flipOutY,
129
  .ccw_plugin .animated.bounceIn,
130
  .ccw_plugin .animated.bounceOut {
131
  animation-duration: .75s; }
132
-
133
  @keyframes bounce {
134
  from, 20%, 53%, 80%, to {
135
  animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
@@ -142,20 +106,16 @@ div.ccw_plugin,
142
  transform: translate3d(0, -15px, 0); }
143
  90% {
144
  transform: translate3d(0, -4px, 0); } }
145
-
146
  .ccw_plugin .bounce {
147
  animation-name: bounce;
148
  transform-origin: center bottom; }
149
-
150
  @keyframes flash {
151
  from, 50%, to {
152
  opacity: 1; }
153
  25%, 75% {
154
  opacity: 0; } }
155
-
156
  .ccw_plugin .flash {
157
  animation-name: flash; }
158
-
159
  @keyframes tada {
160
  from {
161
  transform: scale3d(1, 1, 1); }
@@ -167,14 +127,8 @@ div.ccw_plugin,
167
  transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg); }
168
  to {
169
  transform: scale3d(1, 1, 1); } }
170
-
171
  .ccw_plugin .tada {
172
  animation-name: tada; }
173
-
174
-
175
-
176
-
177
- /* style-4 - chip style - added modified .. since v1.6+ silent release */
178
  .ccw_plugin .style-4.chip {
179
  display: inline-block;
180
  padding-left: 12px;
@@ -185,12 +139,10 @@ div.ccw_plugin,
185
  font-size: 13px;
186
  line-height: 32px;
187
  }
188
-
189
- /* Image */
190
  .ccw_plugin .style-4.chip img {
191
  float: left;
192
  margin: 0 8px 0 -12px;
193
  height: 32px;
194
  width: 32px;
195
  border-radius: 50%;
196
- }
8
  font-weight: normal;
9
  font-style: normal;
10
  }
 
11
  .ccw_plugin .icon {
 
12
  font-family: 'ccw' !important;
13
  speak: none;
14
  font-style: normal;
16
  font-variant: normal;
17
  text-transform: none;
18
  line-height: 1;
 
 
19
  -webkit-font-smoothing: antialiased;
20
  -moz-osx-font-smoothing: grayscale;
21
  }
 
22
  .icon-whatsapp2:before {
23
  content: "\E902";
24
  }
32
  .icon-whatsapp:before {
33
  content: "\EA93";
34
  }
 
 
 
 
 
 
 
 
 
35
  div.ccw_plugin,
36
  .inline {
37
  display: inline; }
 
38
  .inline-block {
39
  display: inline-block; }
 
40
  .chatbot {
41
  position: fixed;
42
  z-index: 99999999; }
 
43
  .img-icon {
44
  height: 48px; }
 
45
  .nofocus:focus {
46
  outline: none; }
 
47
  .pointer {
48
  cursor: pointer; }
 
49
  .sc_item {
50
  z-index: 99; }
 
51
  .style-3-sc {
52
  height: 20px; }
 
53
  .style-9-sc {
54
  height: 20px; }
 
55
  .img-icon-5 {
56
  height: 80%;
57
  vertical-align: middle; }
 
58
  .img-icon-6 {
59
  height: 63%;
60
  vertical-align: middle;
61
  margin-left: 7px; }
 
62
  .style-6-img {
63
  max-height: 40px;
64
  text-decoration: overline; }
 
65
  .icon-2 {
66
  font-size: 2rem; }
 
67
  .btn_only_style_div_circle {
68
  border-radius: 50%;
69
  text-align: center; }
 
70
  .btn_only_style_div_circle_sc {
71
  background-color: orange;
72
  border-radius: 50%;
74
  width: 48px;
75
  line-height: 48px;
76
  text-align: center; }
 
77
  .btn_only_style_div {
78
  background-color: orange;
79
  height: 48px;
80
  width: 48px;
81
  line-height: 48px;
82
  text-align: center; }
 
83
  .style8 span {
84
  text-transform: none; }
 
 
85
  .ccw_plugin .animated {
86
  animation-duration: 1s;
87
  animation-fill-mode: both; }
 
88
  .ccw_plugin .animated.infinite {
89
  animation-iteration-count: infinite; }
 
90
  .ccw_plugin .animated.hinge {
91
  animation-duration: 2s; }
 
92
  .ccw_plugin .animated.flipOutX,
93
  .ccw_plugin .animated.flipOutY,
94
  .ccw_plugin .animated.bounceIn,
95
  .ccw_plugin .animated.bounceOut {
96
  animation-duration: .75s; }
 
97
  @keyframes bounce {
98
  from, 20%, 53%, 80%, to {
99
  animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
106
  transform: translate3d(0, -15px, 0); }
107
  90% {
108
  transform: translate3d(0, -4px, 0); } }
 
109
  .ccw_plugin .bounce {
110
  animation-name: bounce;
111
  transform-origin: center bottom; }
 
112
  @keyframes flash {
113
  from, 50%, to {
114
  opacity: 1; }
115
  25%, 75% {
116
  opacity: 0; } }
 
117
  .ccw_plugin .flash {
118
  animation-name: flash; }
 
119
  @keyframes tada {
120
  from {
121
  transform: scale3d(1, 1, 1); }
127
  transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg); }
128
  to {
129
  transform: scale3d(1, 1, 1); } }
 
130
  .ccw_plugin .tada {
131
  animation-name: tada; }
 
 
 
 
 
132
  .ccw_plugin .style-4.chip {
133
  display: inline-block;
134
  padding-left: 12px;
139
  font-size: 13px;
140
  line-height: 32px;
141
  }
 
 
142
  .ccw_plugin .style-4.chip img {
143
  float: left;
144
  margin: 0 8px 0 -12px;
145
  height: 32px;
146
  width: 32px;
147
  border-radius: 50%;
148
+ }
prev/assets/js/app.js CHANGED
@@ -10,7 +10,6 @@ jQuery(document).ready(function () {
10
  });
11
  var url = window.location.href;
12
  var google_analytics = ht_ccw_var.google_analytics;
13
- var fb_analytics = ht_ccw_var.fb_analytics;
14
  var title = ht_ccw_var.page_title;
15
  ht_ccw_clickevent();
16
  function ht_ccw_clickevent() {
@@ -23,9 +22,6 @@ function ht_ccw_clicked() {
23
  if ( 'true' == google_analytics ) {
24
  google_analytics_event();
25
  }
26
- if ( 'true' == fb_analytics ) {
27
- fb_analytics_event();
28
- }
29
  }
30
  function google_analytics_event() {
31
  var ga_category = ht_ccw_var.ga_category.replace('{{url}}', url).replace('{{title}}', title);
@@ -41,19 +37,4 @@ function google_analytics_event() {
41
  'event_label': ga_label,
42
  });
43
  }
44
- }
45
- function fb_analytics_event() {
46
- var p1_value = ht_ccw_var.p1_value.replace('{{url}}', url).replace('{{title}}', title);
47
- var p2_value = ht_ccw_var.p2_value.replace('{{url}}', url).replace('{{title}}', title);
48
- var p3_value = ht_ccw_var.p3_value.replace('{{url}}', url).replace('{{title}}', title);
49
- var p1_name = ht_ccw_var.p1_name;
50
- var p2_name = ht_ccw_var.p2_name;
51
- var p3_name = ht_ccw_var.p3_name;
52
- var fb_event_name = ht_ccw_var.fb_event_name;
53
- var params = {};
54
- params[p1_name] = p1_value;
55
- params[p2_name] = p2_value;
56
- params[p3_name] = p3_value;
57
- // if fb analytics is not installed - uncheck the fb analytics option from plugin settings
58
- FB.AppEvents.logEvent(fb_event_name, null, params);
59
  }
10
  });
11
  var url = window.location.href;
12
  var google_analytics = ht_ccw_var.google_analytics;
 
13
  var title = ht_ccw_var.page_title;
14
  ht_ccw_clickevent();
15
  function ht_ccw_clickevent() {
22
  if ( 'true' == google_analytics ) {
23
  google_analytics_event();
24
  }
 
 
 
25
  }
26
  function google_analytics_event() {
27
  var ga_category = ht_ccw_var.ga_category.replace('{{url}}', url).replace('{{title}}', title);
37
  'event_label': ga_label,
38
  });
39
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  }
prev/inc/class-ht-ccw-chat.php CHANGED
@@ -79,69 +79,24 @@ class HT_CCW_Chat {
79
  }
80
 
81
 
82
- $fb_analytics = '';
83
- $fb_event_name = '';
84
- $p1_value = '';
85
- $p2_value = '';
86
- $p3_value = '';
87
- $p1_name = '';
88
- $p2_name = '';
89
- $p3_name = '';
90
-
91
- if ( isset( $values['fb_analytics'] ) ) {
92
- $fb_analytics = 'true';
93
-
94
- $ht_ccw_fb = get_option( 'ht_ccw_fb' );
95
-
96
- $fb_event_name = esc_attr( $ht_ccw_fb['fb_event_name'] );
97
- $p1_value = esc_attr( $ht_ccw_fb['p1_value'] );
98
- $p2_value = esc_attr( $ht_ccw_fb['p2_value'] );
99
- $p3_value = esc_attr( $ht_ccw_fb['p3_value'] );
100
- $p1_name = esc_attr( $ht_ccw_fb['p1_name'] );
101
- $p2_name = esc_attr( $ht_ccw_fb['p2_name'] );
102
- $p3_name = esc_attr( $ht_ccw_fb['p3_name'] );
103
- }
104
-
105
  $page_title = esc_html( get_the_title() );
106
 
107
  /**
108
  * pass values to JavaScript
109
- *
110
  * @var string google_analytics - is enable
111
- * @var string fb_analytics - is enable
112
- *
113
  */
114
  $ht_ccw_var = array(
115
  'page_title' => $page_title,
116
 
117
-
118
  'google_analytics' => $google_analytics,
119
  'ga_category' => $ga_category,
120
  'ga_action' => $ga_action,
121
  'ga_label' => $ga_label,
122
 
123
-
124
- 'fb_analytics' => $fb_analytics,
125
-
126
- 'fb_event_name' => $fb_event_name,
127
- 'p1_value' => $p1_value,
128
- 'p2_value' => $p2_value,
129
- 'p3_value' => $p3_value,
130
- 'p1_name' => $p1_name,
131
- 'p2_name' => $p2_name,
132
- 'p3_name' => $p3_name,
133
-
134
  );
135
 
136
- // push values to $ht_ccw_var
137
- // if ( 'php' == $device_based_on ) {
138
- // $ht_ccw_var['php_ismobile'] = '2';
139
- // }
140
-
141
  wp_localize_script( 'ccw_app', 'ht_ccw_var', $ht_ccw_var );
142
 
143
-
144
-
145
  // enable
146
  if( 1 == $enable ) {
147
  return;
79
  }
80
 
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  $page_title = esc_html( get_the_title() );
83
 
84
  /**
85
  * pass values to JavaScript
 
86
  * @var string google_analytics - is enable
 
 
87
  */
88
  $ht_ccw_var = array(
89
  'page_title' => $page_title,
90
 
 
91
  'google_analytics' => $google_analytics,
92
  'ga_category' => $ga_category,
93
  'ga_action' => $ga_action,
94
  'ga_label' => $ga_label,
95
 
 
 
 
 
 
 
 
 
 
 
 
96
  );
97
 
 
 
 
 
 
98
  wp_localize_script( 'ccw_app', 'ht_ccw_var', $ht_ccw_var );
99
 
 
 
100
  // enable
101
  if( 1 == $enable ) {
102
  return;
prev/inc/class-ht-ccw-register.php CHANGED
@@ -40,8 +40,9 @@ class HT_CCW_Register {
40
  public static function version_check() {
41
 
42
  $ccw_plugin_details = get_option('ccw_plugin_details');
43
-
44
- if ( HT_CTC_VERSION !== $ccw_plugin_details['version'] ) {
 
45
  // to update the plugin - just like activate plugin
46
  self::activate();
47
 
40
  public static function version_check() {
41
 
42
  $ccw_plugin_details = get_option('ccw_plugin_details');
43
+
44
+ $version = (isset($ccw_plugin_details['version'])) ? esc_attr($ccw_plugin_details['version']) : '';
45
+ if ( HT_CTC_VERSION !== $version ) {
46
  // to update the plugin - just like activate plugin
47
  self::activate();
48
 
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Click to Chat ===
2
  Requires at least: 4.6
3
- Tested up to: 5.9.3
4
  Requires PHP: 5.6
5
  Contributors: holithemes
6
- Stable tag: 3.9.2
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
@@ -48,13 +48,13 @@ Instead of selecting a pre-defined style, add any Image/Animated-image/GIF.
48
 
49
  == 🌈 Custom Element ==
50
 
51
- Convert any Element/Design as WhatsApp Chat Element by adding
52
 
53
  * Class name: 'ctc_chat' (or)
54
  * Id name: 'ctc_chat' (or)
55
  * Href/link: '#ctc_chat'
56
 
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)
60
 
@@ -64,11 +64,15 @@ Encourage user engagement by displaying the perfect message at the perfect time
64
 
65
  * [Greetings-1](https://holithemes.com/plugins/click-to-chat/greetings-1/): Customizable Design
66
  * [Greetings-2](https://holithemes.com/plugins/click-to-chat/greetings-2/): Content Specific Design
 
67
 
68
- PRO
69
 
70
- * [Greetings-Form](https://holithemes.com/plugins/click-to-chat/greetings-form/): Form Filling before initializing the chat
71
- * [Actions](https://holithemes.com/plugins/click-to-chat/greetings-actions/): Display/reappear Greetings dialog based on Time, Scroll
 
 
 
72
 
73
 
74
  == ✳️ Position to Place ==
@@ -498,24 +502,16 @@ After Activate the plugin, add WhatsApp Number at plugin settings.
498
 
499
  == Changelog ==
500
 
501
- = 3.9.2 =
502
- * Enchantment: Greetings feature
503
-
504
- = 3.9.1 =
505
- * Enchantment: Greetings feature
506
- * PRO: New - [Greetings - From filling](https://holithemes.com/plugins/click-to-chat/greetings-form/)
507
- * PRO: New - [Greetings Actions - Time, Scroll](https://holithemes.com/plugins/click-to-chat/greetings-actions/)
508
-
509
- = 3.9 =
510
- * New: Greetings Dialogs
511
- * Greetings 1: Customizable Design
512
- * Greetings 2: Content Specific
513
 
514
- = 3.8.1 =
515
- * Enchantment: Pre-filled message, Call to Action settings
516
 
517
- = 3.8 =
518
- * Enchantment: Style-1 button with icon.
519
- * Enchantment: WhatsApp at WooCommerce Shop, single product pages
 
 
520
 
521
  [changelog](https://holithemes.com/plugins/click-to-chat/changelog/)
1
  === Click to Chat ===
2
  Requires at least: 4.6
3
+ Tested up to: 6.0
4
  Requires PHP: 5.6
5
  Contributors: holithemes
6
+ Stable tag: 3.9.5
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
48
 
49
  == 🌈 Custom Element ==
50
 
51
+ Convert any Element as WhatsApp Chat Element by adding
52
 
53
  * Class name: 'ctc_chat' (or)
54
  * Id name: 'ctc_chat' (or)
55
  * Href/link: '#ctc_chat'
56
 
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)
60
 
64
 
65
  * [Greetings-1](https://holithemes.com/plugins/click-to-chat/greetings-1/): Customizable Design
66
  * [Greetings-2](https://holithemes.com/plugins/click-to-chat/greetings-2/): Content Specific Design
67
+ * [Greetings-Form](https://holithemes.com/plugins/click-to-chat/greetings-form/): Form Filling before initializing the chat [PRO]
68
 
69
+ Display Greetings:
70
 
71
+ * Click on any element which contains Class /Id name: 'ctc_greetings'
72
+ * Time, Scroll [PRO]
73
+ * When an element is in viewport(25% margin) with contains Class name: 'ctc_greetings_now' [PRO]
74
+
75
+ [Actions](https://holithemes.com/plugins/click-to-chat/greetings-actions/)
76
 
77
 
78
  == ✳️ Position to Place ==
502
 
503
  == Changelog ==
504
 
505
+ = 3.9.5 =
506
+ * Fix: display settings for custom post types
 
 
 
 
 
 
 
 
 
 
507
 
508
+ = 3.9.4 =
509
+ * Enchantment: Webhooks, greetings, admin interface.
510
 
511
+ = 3.9.3 =
512
+ * Enchantment: Greetings feature
513
+ * Open Greetings dialog:
514
+ * Click on any element which contains Class /Id name: 'ctc_greetings'
515
+ * When an element is in viewport(25% margin) which contains Class name: 'ctc_greetings_now' [PRO]
516
 
517
  [changelog](https://holithemes.com/plugins/click-to-chat/changelog/)