Click to Chat for WhatsApp Chat - Version 3.2.5

Version Description

  • Showcase - Add your website to Click-to-Chat portfolio
  • Show/Hide settings at page level
  • Fix: Shortcode navigation, if loaded dynamically.
  • Updated JavaScript File name. (to fix cache issues)
Download this release

Release Info

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

Code changes from version 3.2.4 to 3.2.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.2.4
7
  Author: HoliThemes
8
  Author URI: https://holithemes.com/plugins/click-to-chat/
9
  License: GPL2
@@ -17,13 +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.2.4' );
21
- }
22
-
23
- // environment - production, staging, development, test
24
- // define( 'HT_CTC_ENVIRONMENT', 'development' ); //todo
25
- if ( ! defined( 'HT_CTC_ENVIRONMENT' ) ) {
26
- define( 'HT_CTC_ENVIRONMENT', 'production' );
27
  }
28
 
29
  // 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.2.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.2.5' );
 
 
 
 
 
 
21
  }
22
 
23
  // define HT_CTC_PLUGIN_FILE
new/admin/admin_commons/admin-sidebar-content.php CHANGED
@@ -8,6 +8,7 @@
8
 
9
  <div class="col s12 m8 l12 xl12">
10
  <div class="row">
 
11
  <ul class="collapsible popout">
12
  <li class="active">
13
  <div class="collapsible-header"><?php _e( 'Contact Us', 'click-to-chat-for-whatsapp' ); ?></div>
@@ -20,6 +21,23 @@
20
  </div>
21
  </div>
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  <!-- <div class="col s12 m8">
24
  <div class="collection with-header">
25
  <div class="collection-header"><bold>HoliThemes On</bold></div>
8
 
9
  <div class="col s12 m8 l12 xl12">
10
  <div class="row">
11
+ <!-- <ul class="collapsible popout"> -->
12
  <ul class="collapsible popout">
13
  <li class="active">
14
  <div class="collapsible-header"><?php _e( 'Contact Us', 'click-to-chat-for-whatsapp' ); ?></div>
21
  </div>
22
  </div>
23
 
24
+ <div class="col s12 m8 l12 xl12">
25
+ <div class="row">
26
+ <!-- <ul class="collapsible popout"> -->
27
+ <ul class="collapsible popout">
28
+ <li class="active">
29
+ <div class="collapsible-header"><?php _e( 'ShowCase', 'click-to-chat-for-whatsapp' ); ?></div>
30
+ <div class="collapsible-body">
31
+ <!-- <p class="description"><?php _e( 'Click to Chat is Customizable - Style, color, own image', 'click-to-chat-for-whatsapp' ); ?> </p> -->
32
+ <!-- <p class="description"><?php _e( 'We are planning to add a portfolio for Click to Chat installed Website', 'click-to-chat-for-whatsapp' ); ?> </p> -->
33
+ <!-- <br> -->
34
+ <p class="description"><a target="_blank" href="https://docs.google.com/forms/d/e/1FAIpQLSdPgUgjaZLxfEk-jRQUd8efV-SNh5eOgc2Qe5Xl9uz0ti8tEw/viewform?usp=sf_link">Share your website address</a>, we will add your website link in 'Click to Chat' portfolio.</p>
35
+ </div>
36
+ </li>
37
+ </ul>
38
+ </div>
39
+ </div>
40
+
41
  <!-- <div class="col s12 m8">
42
  <div class="collection with-header">
43
  <div class="collection-header"><bold>HoliThemes On</bold></div>
new/admin/admin_commons/class-ht-ctc-metabox.php CHANGED
@@ -10,11 +10,6 @@ if ( ! class_exists( 'HT_CTC_MetaBox' ) ) :
10
 
11
  class HT_CTC_MetaBox {
12
 
13
- // update from previous method
14
- function prev_meta() {
15
- do_action('ht_ctc_ah_previous_metabox');
16
- }
17
-
18
 
19
  /**
20
  * add meta box
@@ -37,9 +32,7 @@ class HT_CTC_MetaBox {
37
  function display_meta_box( $current_post ) {
38
 
39
  wp_nonce_field( 'ht_ctc_page_meta_box', 'ht_ctc_page_meta_box_nonce' );
40
-
41
- $options = get_option( 'ht_ctc_othersettings' );
42
-
43
  $ht_ctc_pagelevel = get_post_meta( $current_post->ID, 'ht_ctc_pagelevel', true );
44
 
45
  ?>
@@ -51,27 +44,60 @@ class HT_CTC_MetaBox {
51
  $number = ( isset($ht_ctc_pagelevel['number']) ) ? esc_attr($ht_ctc_pagelevel['number']) : '';
52
  $call_to_action = ( isset($ht_ctc_pagelevel['call_to_action']) ) ? esc_attr($ht_ctc_pagelevel['call_to_action']) : '';
53
  $pre_filled = ( isset($ht_ctc_pagelevel['pre_filled']) ) ? esc_attr($ht_ctc_pagelevel['pre_filled']) : '';
54
- $blogname = HT_CTC_BLOG_NAME;
55
- $placeholder = "Hello $blogname!! \n{url}, {title}";
 
 
 
 
 
 
 
 
 
 
 
 
56
  ?>
57
 
58
  <!-- number -->
59
  <div class="row">
60
- <label for="number">WhatsApp Number</label><br>
61
- <input name="ht_ctc_pagelevel[number]" value="<?php echo $number ?>" id="number" type="text">
62
  <p class="description"><a style="text-decoration: none" target="_blank" href="https://holithemes.com/plugins/click-to-chat/whatsapp-number/">WhatsApp Number</a> with country code</p>
63
  </div>
64
 
65
  <!-- call to action -->
66
  <div class="row">
67
- <label for="call_to_action">Call to Action</label><br>
68
- <input name="ht_ctc_pagelevel[call_to_action]" value="<?php echo $call_to_action ?>" id="call_to_action" type="text">
69
  </div>
70
 
71
  <!-- pre-filled message -->
72
  <div class="row">
73
- <label for="pre_filled">Pre-filled Message</label><br>
74
- <textarea style="min-height: 74px; min-width: 72%" placeholder="<?php echo $placeholder ?>" name="ht_ctc_pagelevel[pre_filled]" id="pre_filled" class="materialize-textarea input-margin"><?php echo $pre_filled ?></textarea>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  </div>
76
 
77
  <?php
@@ -80,7 +106,7 @@ class HT_CTC_MetaBox {
80
 
81
 
82
  // if group enabled
83
- if ( isset( $options['enable_group'] ) ) {
84
  $group_id = ( isset($ht_ctc_pagelevel['group_id']) ) ? esc_attr($ht_ctc_pagelevel['group_id']) : '';
85
  ?>
86
  <br>
@@ -162,7 +188,6 @@ class HT_CTC_MetaBox {
162
 
163
  $ht_ctc_metabox = new HT_CTC_MetaBox();
164
 
165
- add_action( 'add_meta_boxes', array($ht_ctc_metabox, 'prev_meta') );
166
  add_action( 'add_meta_boxes', array($ht_ctc_metabox, 'meta_box') );
167
  add_action( 'save_post', array($ht_ctc_metabox, 'save_meta_box') );
168
 
10
 
11
  class HT_CTC_MetaBox {
12
 
 
 
 
 
 
13
 
14
  /**
15
  * add meta box
32
  function display_meta_box( $current_post ) {
33
 
34
  wp_nonce_field( 'ht_ctc_page_meta_box', 'ht_ctc_page_meta_box_nonce' );
35
+ $os = get_option( 'ht_ctc_othersettings' );
 
 
36
  $ht_ctc_pagelevel = get_post_meta( $current_post->ID, 'ht_ctc_pagelevel', true );
37
 
38
  ?>
44
  $number = ( isset($ht_ctc_pagelevel['number']) ) ? esc_attr($ht_ctc_pagelevel['number']) : '';
45
  $call_to_action = ( isset($ht_ctc_pagelevel['call_to_action']) ) ? esc_attr($ht_ctc_pagelevel['call_to_action']) : '';
46
  $pre_filled = ( isset($ht_ctc_pagelevel['pre_filled']) ) ? esc_attr($ht_ctc_pagelevel['pre_filled']) : '';
47
+ $show_hide = ( isset($ht_ctc_pagelevel['show_hide']) ) ? esc_attr($ht_ctc_pagelevel['show_hide']) : '';
48
+
49
+ $options = get_option('ht_ctc_chat_options');
50
+
51
+ $ph_number = '';
52
+ $ph_call_to_action = '';
53
+ $ph_pre_filled = '';
54
+ // If db values are correct
55
+ if ( is_array($options) ) {
56
+ $ph_number = ( isset( $options['number']) ) ? esc_attr( $options['number'] ) : '';
57
+ $ph_call_to_action = ( isset( $options['call_to_action']) ) ? esc_attr( $options['call_to_action'] ) : '';
58
+ $ph_pre_filled = ( isset( $options['pre_filled']) ) ? esc_attr( $options['pre_filled'] ) : '';
59
+ }
60
+
61
  ?>
62
 
63
  <!-- number -->
64
  <div class="row">
65
+ <label for="number"><?php _e( 'WhatsApp Number', 'click-to-chat-for-whatsapp' ); ?></label><br>
66
+ <input name="ht_ctc_pagelevel[number]" value="<?php echo $number ?>" id="number" type="text" placeholder="<?php echo $ph_number ?>">
67
  <p class="description"><a style="text-decoration: none" target="_blank" href="https://holithemes.com/plugins/click-to-chat/whatsapp-number/">WhatsApp Number</a> with country code</p>
68
  </div>
69
 
70
  <!-- call to action -->
71
  <div class="row">
72
+ <label for="call_to_action"><?php _e( 'Call to Action', 'click-to-chat-for-whatsapp' ); ?></label><br>
73
+ <input name="ht_ctc_pagelevel[call_to_action]" value="<?php echo $call_to_action ?>" id="call_to_action" type="text" placeholder="<?php echo $ph_call_to_action ?>">
74
  </div>
75
 
76
  <!-- pre-filled message -->
77
  <div class="row">
78
+ <label for="pre_filled"><?php _e( 'Pre-filled Message', 'click-to-chat-for-whatsapp' ); ?></label><br>
79
+ <textarea style="min-height: 74px; min-width: 72%" placeholder="<?php echo $ph_pre_filled ?>" name="ht_ctc_pagelevel[pre_filled]" id="pre_filled" class="materialize-textarea input-margin"><?php echo $pre_filled ?></textarea>
80
+ </div>
81
+
82
+ <!-- show/hide -->
83
+ <div class="row">
84
+ <label for="show_hide"><?php _e( 'Display Settings', 'click-to-chat-for-whatsapp' ); ?></label><br>
85
+ <label for="show">
86
+ <input name="ht_ctc_pagelevel[show_hide]" <?php checked( 'show' == $show_hide ); ?> value="show" id="show" type="radio">
87
+ <?php _e( 'Show', 'click-to-chat-for-whatsapp' ); ?>
88
+ <!-- <span class="dashicons dashicons-visibility"></span> -->
89
+ </label>
90
+ &emsp;
91
+ <label for="hide">
92
+ <input name="ht_ctc_pagelevel[show_hide]" <?php checked( 'hide' == $show_hide ); ?> value="hide" id="hide" type="radio">
93
+ <?php _e( 'Hide', 'click-to-chat-for-whatsapp' ); ?>
94
+ <!-- <span class="dashicons dashicons-hidden"></span> -->
95
+ </label>
96
+ &emsp;
97
+ <label for="default">
98
+ <input name="ht_ctc_pagelevel[show_hide]" <?php checked( '' == $show_hide ); ?> value="" id="default" type="radio">
99
+ <?php _e( 'Default', 'click-to-chat-for-whatsapp' ); ?>
100
+ </label>
101
  </div>
102
 
103
  <?php
106
 
107
 
108
  // if group enabled
109
+ if ( isset( $os['enable_group'] ) ) {
110
  $group_id = ( isset($ht_ctc_pagelevel['group_id']) ) ? esc_attr($ht_ctc_pagelevel['group_id']) : '';
111
  ?>
112
  <br>
188
 
189
  $ht_ctc_metabox = new HT_CTC_MetaBox();
190
 
 
191
  add_action( 'add_meta_boxes', array($ht_ctc_metabox, 'meta_box') );
192
  add_action( 'save_post', array($ht_ctc_metabox, 'save_meta_box') );
193
 
new/admin/class-ht-ctc-admin-customize-styles.php CHANGED
@@ -101,7 +101,7 @@ class HT_CTC_Admin_Customize_Styles {
101
  <?php submit_button() ?>
102
  </form>
103
  </div>
104
- <!-- <div class="col s12 m12 xl6 ht-cc-admin-sidebar">
105
  </div> -->
106
  </div>
107
 
101
  <?php submit_button() ?>
102
  </form>
103
  </div>
104
+ <!-- <div class="col s12 m12 xl6 ht-ctc-admin-sidebar">
105
  </div> -->
106
  </div>
107
 
new/admin/class-ht-ctc-admin-group-page.php CHANGED
@@ -47,7 +47,7 @@ class HT_CTC_Admin_Group_Page {
47
  <?php submit_button() ?>
48
  </form>
49
  </div>
50
- <!-- <div class="col s12 m12 xl6 ht-cc-admin-sidebar">
51
  </div> -->
52
  </div>
53
 
47
  <?php submit_button() ?>
48
  </form>
49
  </div>
50
+ <!-- <div class="col s12 m12 xl6 ht-ctc-admin-sidebar">
51
  </div> -->
52
  </div>
53
 
new/admin/class-ht-ctc-admin-main-page.php CHANGED
@@ -27,7 +27,7 @@ class HT_CTC_Admin_Main_Page {
27
  'manage_options',
28
  'click-to-chat',
29
  array( $this, 'settings_page' ),
30
- 'dashicons-format-chat'
31
  );
32
  }
33
 
@@ -55,7 +55,7 @@ class HT_CTC_Admin_Main_Page {
55
  </div>
56
 
57
  <!-- sidebar content -->
58
- <div class="col s12 m12 l7 xl4 ht-cc-admin-sidebar sticky-sidebar">
59
  <?php include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-sidebar-content.php'; ?>
60
  </div>
61
 
@@ -103,6 +103,9 @@ class HT_CTC_Admin_Main_Page {
103
  if ( class_exists( 'WooCommerce' ) ) {
104
  add_settings_field( 'ctc_woo', 'WooCommerce', array( $this, 'ctc_woo_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
105
  }
 
 
 
106
  add_settings_field( 'ctc_notes', '', array( $this, 'ctc_notes_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
107
 
108
 
@@ -118,12 +121,6 @@ class HT_CTC_Admin_Main_Page {
118
  }
119
 
120
 
121
- // WooCommerce related settings
122
- public function ctc_woo_cb() {
123
- do_action('ht_ctc_ah_admin_chat_woo_settings');
124
- }
125
-
126
-
127
  public function chat_settings_section_cb() {
128
  ?>
129
  <h1 id="chat_settings">Click to Chat - Chat Settings </h1>
@@ -296,6 +293,16 @@ class HT_CTC_Admin_Main_Page {
296
  }
297
 
298
 
 
 
 
 
 
 
 
 
 
 
299
 
300
  function ctc_notes_cb() {
301
  ?>
@@ -308,19 +315,6 @@ class HT_CTC_Admin_Main_Page {
308
 
309
 
310
 
311
-
312
- /**
313
- * Enable featues ..
314
- *
315
- */
316
- public function switch_interface_cb() {
317
- ?>
318
- <h1><?php _e( 'Enable features', 'click-to-chat-for-whatsapp' ); ?></h1>
319
- <?php
320
- }
321
-
322
-
323
-
324
  // switch interface
325
  function ht_ctc_switch_cb() {
326
  $options = get_option('ht_ctc_switch');
27
  'manage_options',
28
  'click-to-chat',
29
  array( $this, 'settings_page' ),
30
+ 'dashicons-whatsapp'
31
  );
32
  }
33
 
55
  </div>
56
 
57
  <!-- sidebar content -->
58
+ <div class="col s12 m12 l7 xl4 ht-ctc-admin-sidebar sticky-sidebar">
59
  <?php include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-sidebar-content.php'; ?>
60
  </div>
61
 
103
  if ( class_exists( 'WooCommerce' ) ) {
104
  add_settings_field( 'ctc_woo', 'WooCommerce', array( $this, 'ctc_woo_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
105
  }
106
+
107
+ add_settings_field( 'options', '', array( $this, 'options_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
108
+
109
  add_settings_field( 'ctc_notes', '', array( $this, 'ctc_notes_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
110
 
111
 
121
  }
122
 
123
 
 
 
 
 
 
 
124
  public function chat_settings_section_cb() {
125
  ?>
126
  <h1 id="chat_settings">Click to Chat - Chat Settings </h1>
293
  }
294
 
295
 
296
+ // WooCommerce related settings
297
+ public function ctc_woo_cb() {
298
+ do_action('ht_ctc_ah_admin_chat_woo_settings');
299
+ }
300
+
301
+
302
+ // More options - for addon plugins
303
+ function options_cb() {
304
+ do_action('ht_ctc_ah_admin_chat_more_options');
305
+ }
306
 
307
  function ctc_notes_cb() {
308
  ?>
315
 
316
 
317
 
 
 
 
 
 
 
 
 
 
 
 
 
 
318
  // switch interface
319
  function ht_ctc_switch_cb() {
320
  $options = get_option('ht_ctc_switch');
new/admin/class-ht-ctc-admin-other-settings.php CHANGED
@@ -49,7 +49,7 @@ class HT_CTC_Admin_Other_Settings {
49
  <?php submit_button() ?>
50
  </form>
51
  </div>
52
- <!-- <div class="col s12 m12 xl6 ht-cc-admin-sidebar">
53
  </div> -->
54
  </div>
55
 
49
  <?php submit_button() ?>
50
  </form>
51
  </div>
52
+ <!-- <div class="col s12 m12 xl6 ht-ctc-admin-sidebar">
53
  </div> -->
54
  </div>
55
 
new/admin/class-ht-ctc-admin-share-page.php CHANGED
@@ -47,7 +47,7 @@ class HT_CTC_Admin_Share_Page {
47
  <?php submit_button() ?>
48
  </form>
49
  </div>
50
- <!-- <div class="col s12 m12 xl6 ht-cc-admin-sidebar">
51
  </div> -->
52
  </div>
53
 
47
  <?php submit_button() ?>
48
  </form>
49
  </div>
50
+ <!-- <div class="col s12 m12 xl6 ht-ctc-admin-sidebar">
51
  </div> -->
52
  </div>
53
 
new/admin/class-ht-ctc-db.php CHANGED
@@ -708,6 +708,7 @@ class HT_CTC_DB {
708
  $values = array(
709
  'version' => HT_CTC_VERSION,
710
  'v3' => 'v3',
 
711
  );
712
 
713
  // Always use update_option - override new values .. don't preseve already existing values
708
  $values = array(
709
  'version' => HT_CTC_VERSION,
710
  'v3' => 'v3',
711
+ 'v3_2_5' => 'v3_2_5',
712
  );
713
 
714
  // Always use update_option - override new values .. don't preseve already existing values
new/inc/assets/js/325.app.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(h){h(function(){var t,e,a,n,o,i=window.location.href,c=void 0!==document.title?document.title:"",r=void 0!==screen.width&&1024<screen.width?"no":"yes";function d(e){try{var t=parseInt(e.getAttribute("data-show_effect"));h(e).show(t)}catch(t){e.style.display="block"}try{n=(a=e).getAttribute("data-an_type"),setTimeout(function(){a.classList.add("ht_ctc_animation",n)},120),h(".ht-ctc-chat").hover(function(){h(".ht-ctc-chat .ht-ctc-cta-hover").show(120)},function(){h(".ht-ctc-chat .ht-ctc-cta-hover").hide(100)})}catch(t){}var a,n}function s(t){var e=t.getAttribute("data-number"),a="Click to Chat for WhatsApp",n="chat: "+e,o=c+", "+i;"yes"==t.getAttribute("data-is_ga_enable")&&("undefined"!=typeof gtag?gtag("event",n,{event_category:a,event_label:o}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",a,n,o):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",a,n,o)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",event_category:a,event_label:o,event_action:n}),"yes"==t.getAttribute("data-is_fb_pixel")&&"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:"chat",ID:e,Title:c,URL:i})}(o=document.querySelector(".ht-ctc-chat"))&&(t=o,"yes"==r?"show"==t.getAttribute("data-display_mobile")&&((n=document.querySelector(".ht_ctc_desktop_chat"))&&n.remove(),a=t.getAttribute("data-css"),e=t.getAttribute("data-position_mobile"),t.style.cssText=e+a,d(t)):"show"==t.getAttribute("data-display_desktop")&&((n=document.querySelector(".ht_ctc_mobile_chat"))&&n.remove(),a=t.getAttribute("data-css"),n=t.getAttribute("data-position"),t.style.cssText=n+a,d(t)),o.addEventListener("click",function(){!function(t){var e=t.getAttribute("data-number"),a=t.getAttribute("data-pre_filled");a=a.replace(/\[url]/gi,i),a=encodeURIComponent(a);var n,o=t.getAttribute("data-webandapi");if(""==e)return t.innerHTML=t.getAttribute("data-no_number");"webapi"==o?(n="yes"==r?"https://api.whatsapp.com/send":"https://web.whatsapp.com/send",window.open(n+"?phone="+e+"&text="+a,"_blank","noopener")):(n="https://wa.me/",window.open(n+e+"?text="+a,"_blank","noopener"))}(o),s(o)})),h(document).on("click",".ht-ctc-sc-chat",function(){var t,e=this.getAttribute("data-number"),a=(a=this.getAttribute("data-pre_filled")).replace(/\[url]/gi,i);a=encodeURIComponent(a),"webapi"==this.getAttribute("data-webandapi")?(t="yes"==r?"https://api.whatsapp.com/send":"https://web.whatsapp.com/send",window.open(t+"?phone="+e+"&text="+a,"_blank","noopener")):(t="https://wa.me/",window.open(t+e+"?text="+a,"_blank","noopener")),s(this)})})}(jQuery);
new/inc/assets/js/app.js CHANGED
@@ -1 +1 @@
1
- function ht_ctc_click(t){}function ht_ctc_shortcode_click(t){}!function(o){var c=window.location.href,i=void 0!==document.title?document.title:"",r=void 0!==screen.width&&1024<screen.width?"no":"yes";function t(){var t=document.querySelector(".ht-ctc-chat");t&&(function(t){{var e,a,n,o;"yes"==r?"show"==t.getAttribute("data-display_mobile")&&((a=document.querySelector(".ht_ctc_desktop_chat"))&&a.remove(),n=t.getAttribute("data-css"),e=t.getAttribute("data-position_mobile"),t.style.cssText=e+n,d(t)):"show"==t.getAttribute("data-display_desktop")&&((a=document.querySelector(".ht_ctc_mobile_chat"))&&a.remove(),n=t.getAttribute("data-css"),o=t.getAttribute("data-position"),t.style.cssText=o+n,d(t))}}(t),t.addEventListener("click",function(){!function(t){var e=t.getAttribute("data-number"),a=t.getAttribute("data-pre_filled");a=a.replace(/\[url]/gi,c),a=encodeURIComponent(a);var n=t.getAttribute("data-webandapi");if(""==e)return t.innerHTML=t.getAttribute("data-no_number");{var o;"webapi"==n?(o="yes"==r?"https://api.whatsapp.com/send":"https://web.whatsapp.com/send",window.open(o+"?phone="+e+"&text="+a,"_blank","noopener")):(o="https://wa.me/",window.open(o+e+"?text="+a,"_blank","noopener"))}}(t),n(t)})),o(".ht-ctc-sc-chat").click(function(){var t,e=this.getAttribute("data-number"),a=(a=this.getAttribute("data-pre_filled")).replace(/\[url]/gi,c);a=encodeURIComponent(a),"webapi"==this.getAttribute("data-webandapi")?(t="yes"==r?"https://api.whatsapp.com/send":"https://web.whatsapp.com/send",window.open(t+"?phone="+e+"&text="+a,"_blank","noopener")):(t="https://wa.me/",window.open(t+e+"?text="+a,"_blank","noopener")),n(this)})}function d(e){try{var t=parseInt(e.getAttribute("data-show_effect"));o(e).show(t)}catch(t){e.style.display="block"}try{n=(a=e).getAttribute("data-an_type"),setTimeout(function(){a.classList.add("ht_ctc_animation",n)},120),o(".ht-ctc-chat").hover(function(){o(".ht-ctc-chat .ht-ctc-cta-hover").show(120)},function(){o(".ht-ctc-chat .ht-ctc-cta-hover").hide(100)})}catch(t){}var a,n}function n(t){var e=t.getAttribute("data-number"),a="Click to Chat for WhatsApp",n="chat: "+e,o=i+", "+c;"yes"==t.getAttribute("data-is_ga_enable")&&("undefined"!=typeof gtag?gtag("event",n,{event_category:a,event_label:o}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",a,n,o):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",a,n,o)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",event_category:a,event_label:o,event_action:n}),"yes"==t.getAttribute("data-is_fb_pixel")&&"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:"chat",ID:e,Title:i,URL:c})}"complete"==document.readyState||"interactive"==document.readyState?t():document.addEventListener("DOMContentLoaded",t)}(jQuery);
1
+ !function(h){h(function(){var t,e,a,n,o,i=window.location.href,c=void 0!==document.title?document.title:"",r=void 0!==screen.width&&1024<screen.width?"no":"yes";function d(e){try{var t=parseInt(e.getAttribute("data-show_effect"));h(e).show(t)}catch(t){e.style.display="block"}try{n=(a=e).getAttribute("data-an_type"),setTimeout(function(){a.classList.add("ht_ctc_animation",n)},120),h(".ht-ctc-chat").hover(function(){h(".ht-ctc-chat .ht-ctc-cta-hover").show(120)},function(){h(".ht-ctc-chat .ht-ctc-cta-hover").hide(100)})}catch(t){}var a,n}function s(t){var e=t.getAttribute("data-number"),a="Click to Chat for WhatsApp",n="chat: "+e,o=c+", "+i;"yes"==t.getAttribute("data-is_ga_enable")&&("undefined"!=typeof gtag?gtag("event",n,{event_category:a,event_label:o}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",a,n,o):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",a,n,o)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",event_category:a,event_label:o,event_action:n}),"yes"==t.getAttribute("data-is_fb_pixel")&&"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:"chat",ID:e,Title:c,URL:i})}(o=document.querySelector(".ht-ctc-chat"))&&(t=o,"yes"==r?"show"==t.getAttribute("data-display_mobile")&&((n=document.querySelector(".ht_ctc_desktop_chat"))&&n.remove(),a=t.getAttribute("data-css"),e=t.getAttribute("data-position_mobile"),t.style.cssText=e+a,d(t)):"show"==t.getAttribute("data-display_desktop")&&((n=document.querySelector(".ht_ctc_mobile_chat"))&&n.remove(),a=t.getAttribute("data-css"),n=t.getAttribute("data-position"),t.style.cssText=n+a,d(t)),o.addEventListener("click",function(){!function(t){var e=t.getAttribute("data-number"),a=t.getAttribute("data-pre_filled");a=a.replace(/\[url]/gi,i),a=encodeURIComponent(a);var n,o=t.getAttribute("data-webandapi");if(""==e)return t.innerHTML=t.getAttribute("data-no_number");"webapi"==o?(n="yes"==r?"https://api.whatsapp.com/send":"https://web.whatsapp.com/send",window.open(n+"?phone="+e+"&text="+a,"_blank","noopener")):(n="https://wa.me/",window.open(n+e+"?text="+a,"_blank","noopener"))}(o),s(o)})),h(document).on("click",".ht-ctc-sc-chat",function(){var t,e=this.getAttribute("data-number"),a=(a=this.getAttribute("data-pre_filled")).replace(/\[url]/gi,i);a=encodeURIComponent(a),"webapi"==this.getAttribute("data-webandapi")?(t="yes"==r?"https://api.whatsapp.com/send":"https://web.whatsapp.com/send",window.open(t+"?phone="+e+"&text="+a,"_blank","noopener")):(t="https://wa.me/",window.open(t+e+"?text="+a,"_blank","noopener")),s(this)})})}(jQuery);
new/inc/assets/js/dev/app.dev.js CHANGED
@@ -1,23 +1,16 @@
1
  // Click to Chat
2
  (function ($) {
3
 
4
- var v = '3.2';
 
 
 
 
5
  var url = window.location.href;
6
  var post_title = (typeof document.title !== "undefined" ) ? document.title : '';
7
  // is_mobile yes/no, desktop > 1024
8
  var is_mobile = (typeof screen.width !== "undefined" && screen.width > 1024) ? "no" : "yes";
9
 
10
- function afterdom_loaded() {
11
- if ('complete' == document.readyState || 'interactive' == document.readyState) {
12
- console.log('call ht_ctc direclty');
13
- // call direclty
14
- ht_ctc();
15
- } else {
16
- console.log('call ht_ctc event listener');
17
- document.addEventListener('DOMContentLoaded', ht_ctc);
18
- }
19
- }
20
- afterdom_loaded();
21
 
22
  function ht_ctc() {
23
  console.log('ht_ctc');
@@ -41,7 +34,8 @@ function ht_ctc() {
41
  }
42
 
43
  // shortcode - click
44
- $('.ht-ctc-sc-chat').click(function () {
 
45
  console.log('shortcode click');
46
 
47
  var number = this.getAttribute('data-number');
@@ -70,6 +64,7 @@ function ht_ctc() {
70
 
71
 
72
  }
 
73
 
74
  // display based on device
75
  function display_chat(p) {
@@ -220,14 +215,6 @@ function ht_ctc_link(values) {
220
 
221
  }
222
 
 
223
 
224
-
225
- })(jQuery);
226
-
227
-
228
- // todo: 3.3
229
- // if app.js file is not updated in the user website - due to cache - later version remove onclick attribute at html.
230
- function ht_ctc_click(values) {
231
- console.log(values);
232
- return;
233
- }
1
  // Click to Chat
2
  (function ($) {
3
 
4
+ var v = '3.2.5';
5
+
6
+ // ready
7
+ $(function () {
8
+
9
  var url = window.location.href;
10
  var post_title = (typeof document.title !== "undefined" ) ? document.title : '';
11
  // is_mobile yes/no, desktop > 1024
12
  var is_mobile = (typeof screen.width !== "undefined" && screen.width > 1024) ? "no" : "yes";
13
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
  function ht_ctc() {
16
  console.log('ht_ctc');
34
  }
35
 
36
  // shortcode - click
37
+ // $('.ht-ctc-sc-chat').click(function () {
38
+ $(document).on('click', '.ht-ctc-sc-chat', function () {
39
  console.log('shortcode click');
40
 
41
  var number = this.getAttribute('data-number');
64
 
65
 
66
  }
67
+ ht_ctc();
68
 
69
  // display based on device
70
  function display_chat(p) {
215
 
216
  }
217
 
218
+ });
219
 
220
+ })(jQuery);
 
 
 
 
 
 
 
 
 
new/inc/assets/js/dev/app.test.js CHANGED
@@ -1,112 +1,81 @@
1
- var ht_ctc_v = "2.11"
2
- , url = window.location.href
3
- , is_mobile = "yes";
4
- void 0 !== screen.width && (is_mobile = 1024 < screen.width ? "no" : "yes");
5
- var post_title = void 0 !== document.title ? document.title : "";
6
- function afterdom_loaded() {
7
- "complete" == document.readyState || "interactive" == document.readyState ? ht_ctc() : document.addEventListener("DOMContentLoaded", ht_ctc)
8
- }
9
- function ht_ctc_loaded() {
10
- afterdom_loaded()
11
- }
12
- function ht_ctc() {
13
- var t = document.querySelector(".ht-ctc-chat");
14
- t && hide_basedon_device(t);
15
- var e = document.querySelector(".ht-ctc-share");
16
- e && hide_basedon_device(e);
17
- var a = document.querySelector(".ht-ctc-group");
18
- a && hide_basedon_device(a)
19
- }
20
- function hide_basedon_device(t) {
21
- var e, a, n, o;
22
- "yes" == is_mobile ? "show" == t.getAttribute("data-display_mobile") && ((a = document.querySelector(".ht_ctc_desktop_" + t.getAttribute("data-return_type"))) && a.remove(),
23
- n = t.getAttribute("data-css"),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  e = t.getAttribute("data-position_mobile"),
25
- t.style.cssText = e + n,
26
- display(t)) : "show" == t.getAttribute("data-display_desktop") && ((a = document.querySelector(".ht_ctc_mobile_" + t.getAttribute("data-return_type"))) && a.remove(),
27
- n = t.getAttribute("data-css"),
28
- o = t.getAttribute("data-position"),
29
- t.style.cssText = o + n,
30
- display(t))
31
- }
32
- function display(t) {
33
- t.style.display = "block"
34
- }
35
- function ht_ctc_shortcode_click(t) {
36
- data_link = t.getAttribute("data-ctc-link"),
37
- data_link = encodeURI(data_link),
38
- window.open(data_link, "_blank", "noopener"),
39
- ht_ctc_analytics(t)
40
- }
41
- function ht_ctc_click(t) {
42
- ht_ctc_link(t),
43
- ht_ctc_analytics(t)
44
- }
45
- function ht_ctc_link(t) {
46
- var e = t.getAttribute("data-return_type");
47
- if ("group" == e) {
48
- var a = "https://chat.whatsapp.com/"
49
- , n = t.getAttribute("data-group_id");
50
- window.open(a + n, "_blank", "noopener")
51
- } else if ("share" == e) {
52
- var o = t.getAttribute("data-share_text")
53
- , i = "api";
54
- "webapi" == (c = t.getAttribute("data-webandapi")) && (i = "yes" == is_mobile ? "api" : "web");
55
- a = "https://" + i + ".whatsapp.com/send";
56
- window.open(a + "?text=" + o, "_blank", "noopener")
57
- } else {
58
- var r = t.getAttribute("data-number")
59
- , d = t.getAttribute("data-pre_filled")
60
- , d = encodeURIComponent(d)
61
- , c = t.getAttribute("data-webandapi");
62
- if ("" == r && t.classList.contains("admin"))
63
- return void (t.innerHTML = "<p style='background-color: #ffffff; margin:0; border: 1px solid #fbfbfb; padding:11px; border-radius:4px; box-shadow: 5px 10px 8px #888888;'>No WhatsApp Number Found!<br><small style='color: red;'>Admin Notice:<br></small><small>Add WhatsApp number at pluign Settings<br>If already added, <strong>clear the Cache</strong> and try.<br>If still an issue, please contact plugin developers</small></p>");
64
- if ("" == r)
65
- return void (t.innerHTML = "<p>No WhatsApp Number Found!</p>");
66
- "webapi" == c ? (a = "yes" == is_mobile ? "https://api.whatsapp.com/send" : "https://web.whatsapp.com/send",
67
- window.open(a + "?phone=" + r + "&text=" + d, "_blank", "noopener")) : (a = "https://wa.me/",
68
- window.open(a + r + "?text=" + d, "_blank", "noopener"))
69
- }
70
- }
71
- function ht_ctc_analytics(t) {
72
- var e = t.getAttribute("data-return_type")
73
- , a = "";
74
- "chat" == e ? a = t.getAttribute("data-number") : "group" == e ? a = t.getAttribute("data-group_id") : "share" == e && (a = t.getAttribute("data-share_text")),
75
- ht_ctc_ga(e, a, t),
76
- "yes" == t.getAttribute("data-is_fb_pixel") && ht_ctc_fb_pixel(e, a),
77
- "yes" == t.getAttribute("data-is_fb_an_enable") && ht_ctc_fb_an(e, a)
78
- }
79
- function ht_ctc_ga(t, e, a) {
80
- var n = "Click to Chat for WhatsApp"
81
- , o = t + ": " + e
82
- , i = post_title + ", " + url;
83
- "yes" == a.getAttribute("data-is_ga_enable") && ("undefined" != typeof gtag ? gtag("event", o, {
84
- event_category: n,
85
- event_label: i
86
- }) : "undefined" != typeof ga && void 0 !== ga.getAll ? ga.getAll()[0].send("event", n, o, i) : "undefined" != typeof __gaTracker && __gaTracker("send", "event", n, o, i)),
87
- "undefined" != typeof dataLayer && dataLayer.push({
88
- event: "Click to Chat",
89
- event_category: n,
90
- event_label: i,
91
- event_action: o
92
  })
93
- }
94
- function ht_ctc_fb_pixel(t, e) {
95
- "undefined" != typeof fbq && fbq("trackCustom", "Click to Chat by HoliThemes", {
96
- Category: "Click to Chat for WhatsApp",
97
- return_type: t,
98
- ID: e,
99
- Title: post_title,
100
- URL: url
101
  })
102
- }
103
- function ht_ctc_fb_an(t, e) {
104
- var a = {
105
- Category: "Click to Chat for WhatsApp"
106
- };
107
- a.return_type = t,
108
- a.ID = e,
109
- a.Label = post_title + ", " + url,
110
- "undefined" != typeof FB && FB.AppEvents.logEvent("Click to Chat for WhatsApp", null, a)
111
- }
112
- afterdom_loaded();
1
+ !function(h) {
2
+ h(function() {
3
+ var t, e, a, n, o, i = window.location.href, c = void 0 !== document.title ? document.title : "", r = void 0 !== screen.width && 1024 < screen.width ? "no" : "yes";
4
+ function d(e) {
5
+ try {
6
+ var t = parseInt(e.getAttribute("data-show_effect"));
7
+ h(e).show(t)
8
+ } catch (t) {
9
+ e.style.display = "block"
10
+ }
11
+ try {
12
+ n = (a = e).getAttribute("data-an_type"),
13
+ setTimeout(function() {
14
+ a.classList.add("ht_ctc_animation", n)
15
+ }, 120),
16
+ h(".ht-ctc-chat").hover(function() {
17
+ h(".ht-ctc-chat .ht-ctc-cta-hover").show(120)
18
+ }, function() {
19
+ h(".ht-ctc-chat .ht-ctc-cta-hover").hide(100)
20
+ })
21
+ } catch (t) {}
22
+ var a, n
23
+ }
24
+ function s(t) {
25
+ var e = t.getAttribute("data-number")
26
+ , a = "Click to Chat for WhatsApp"
27
+ , n = "chat: " + e
28
+ , o = c + ", " + i;
29
+ "yes" == t.getAttribute("data-is_ga_enable") && ("undefined" != typeof gtag ? gtag("event", n, {
30
+ event_category: a,
31
+ event_label: o
32
+ }) : "undefined" != typeof ga && void 0 !== ga.getAll ? ga.getAll()[0].send("event", a, n, o) : "undefined" != typeof __gaTracker && __gaTracker("send", "event", a, n, o)),
33
+ "undefined" != typeof dataLayer && dataLayer.push({
34
+ event: "Click to Chat",
35
+ event_category: a,
36
+ event_label: o,
37
+ event_action: n
38
+ }),
39
+ "yes" == t.getAttribute("data-is_fb_pixel") && "undefined" != typeof fbq && fbq("trackCustom", "Click to Chat by HoliThemes", {
40
+ Category: "Click to Chat for WhatsApp",
41
+ return_type: "chat",
42
+ ID: e,
43
+ Title: c,
44
+ URL: i
45
+ })
46
+ }
47
+ (o = document.querySelector(".ht-ctc-chat")) && (t = o,
48
+ "yes" == r ? "show" == t.getAttribute("data-display_mobile") && ((n = document.querySelector(".ht_ctc_desktop_chat")) && n.remove(),
49
+ a = t.getAttribute("data-css"),
50
  e = t.getAttribute("data-position_mobile"),
51
+ t.style.cssText = e + a,
52
+ d(t)) : "show" == t.getAttribute("data-display_desktop") && ((n = document.querySelector(".ht_ctc_mobile_chat")) && n.remove(),
53
+ a = t.getAttribute("data-css"),
54
+ n = t.getAttribute("data-position"),
55
+ t.style.cssText = n + a,
56
+ d(t)),
57
+ o.addEventListener("click", function() {
58
+ !function(t) {
59
+ var e = t.getAttribute("data-number")
60
+ , a = t.getAttribute("data-pre_filled");
61
+ a = a.replace(/\[url]/gi, i),
62
+ a = encodeURIComponent(a);
63
+ var n, o = t.getAttribute("data-webandapi");
64
+ if ("" == e)
65
+ return t.innerHTML = t.getAttribute("data-no_number");
66
+ "webapi" == o ? (n = "yes" == r ? "https://api.whatsapp.com/send" : "https://web.whatsapp.com/send",
67
+ window.open(n + "?phone=" + e + "&text=" + a, "_blank", "noopener")) : (n = "https://wa.me/",
68
+ window.open(n + e + "?text=" + a, "_blank", "noopener"))
69
+ }(o),
70
+ s(o)
71
+ })),
72
+ h(document).on("click", ".ht-ctc-sc-chat", function() {
73
+ var t, e = this.getAttribute("data-number"), a = (a = this.getAttribute("data-pre_filled")).replace(/\[url]/gi, i);
74
+ a = encodeURIComponent(a),
75
+ "webapi" == this.getAttribute("data-webandapi") ? (t = "yes" == r ? "https://api.whatsapp.com/send" : "https://web.whatsapp.com/send",
76
+ window.open(t + "?phone=" + e + "&text=" + a, "_blank", "noopener")) : (t = "https://wa.me/",
77
+ window.open(t + e + "?text=" + a, "_blank", "noopener")),
78
+ s(this)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  })
 
 
 
 
 
 
 
 
80
  })
81
+ }(jQuery);
 
 
 
 
 
 
 
 
 
 
new/inc/assets/js/dev/group.dev.js CHANGED
@@ -1,17 +1,13 @@
1
  // Click to Chat - Group
2
  (function ($) {
3
 
 
 
 
4
  var url = window.location.href;
5
  var is_mobile = (typeof screen.width !== "undefined" && screen.width > 1024) ? "no" : "yes";
6
  var post_title = (typeof document.title !== "undefined" ) ? document.title : '';
7
 
8
- if ('complete' == document.readyState || 'interactive' == document.readyState) {
9
- // call direclty
10
- group_ht_ctc();
11
- } else {
12
- document.addEventListener('DOMContentLoaded', group_ht_ctc);
13
- }
14
-
15
  function group_ht_ctc() {
16
  var ht_ctc_group = document.querySelector('.ht-ctc-group');
17
  if (ht_ctc_group) {
@@ -32,7 +28,7 @@ function group_ht_ctc() {
32
  }
33
 
34
  // shortcode - click
35
- $('.ht-ctc-sc-group').click(function () {
36
 
37
  data_link = this.getAttribute("data-ctc-link");
38
  data_link = encodeURI(data_link);
@@ -43,6 +39,7 @@ function group_ht_ctc() {
43
  });
44
 
45
  }
 
46
 
47
  // Hide based on device
48
  function group_display(p) {
@@ -162,4 +159,6 @@ function group_analytics(values) {
162
  }
163
  }
164
 
 
 
165
  })(jQuery);
1
  // Click to Chat - Group
2
  (function ($) {
3
 
4
+ // ready
5
+ $(function () {
6
+
7
  var url = window.location.href;
8
  var is_mobile = (typeof screen.width !== "undefined" && screen.width > 1024) ? "no" : "yes";
9
  var post_title = (typeof document.title !== "undefined" ) ? document.title : '';
10
 
 
 
 
 
 
 
 
11
  function group_ht_ctc() {
12
  var ht_ctc_group = document.querySelector('.ht-ctc-group');
13
  if (ht_ctc_group) {
28
  }
29
 
30
  // shortcode - click
31
+ $(document).on('click', '.ht-ctc-sc-group', function () {
32
 
33
  data_link = this.getAttribute("data-ctc-link");
34
  data_link = encodeURI(data_link);
39
  });
40
 
41
  }
42
+ group_ht_ctc();
43
 
44
  // Hide based on device
45
  function group_display(p) {
159
  }
160
  }
161
 
162
+ });
163
+
164
  })(jQuery);
new/inc/assets/js/dev/group.new.js DELETED
@@ -1,107 +0,0 @@
1
- // Click to Chat - Group
2
- (function ($) {
3
-
4
- var is_mobile = (screen.width > 1024) ? "no" : "yes";
5
-
6
- // ready
7
- $(function () {
8
-
9
- var ht_ctc_group = document.querySelector('.ht-ctc-group');
10
-
11
- // display, click
12
- if (ht_ctc_group) {
13
- display(ht_ctc_group);
14
-
15
- ht_ctc_group.addEventListener('click', function () {
16
-
17
- // link
18
- var base_link = 'https://chat.whatsapp.com/';
19
- var group_id = ht_ctc_group.getAttribute('data-group_id');
20
- window.open(base_link + group_id, '_blank', 'noopener');
21
-
22
- ht_ctc_group_analytics(values);
23
-
24
- });
25
- }
26
-
27
- // click shortcode
28
- $('.ht-ctc-sc-group').click(function () {
29
-
30
- data_link = this.getAttribute("data-ctc-link");
31
- data_link = encodeURI(data_link);
32
- window.open(data_link, '_blank', 'noopener');
33
-
34
- analytics(this);
35
-
36
- });
37
-
38
- function analytics(values) {
39
- // analytics
40
- try {
41
- // (app.js fn)
42
- id = values.getAttribute('data-group_id');
43
- ht_ctc_analytics(values, id);
44
- } catch (e) { }
45
- }
46
-
47
-
48
- // Hide based on device
49
- function display(p) {
50
- if (is_mobile == 'yes') {
51
- var display_mobile = p.getAttribute('data-display_mobile');
52
- if ('show' == display_mobile) {
53
-
54
- // remove desktop style
55
- var rm = document.querySelector('.ht_ctc_desktop_' + p.getAttribute('data-return_type'));
56
- (rm) ? rm.remove() : '';
57
-
58
- var css = p.getAttribute('data-css');
59
- var position_mobile = p.getAttribute('data-position_mobile');
60
- p.style.cssText = position_mobile + css;
61
- group_display(p)
62
- }
63
- } else {
64
- var display_desktop = p.getAttribute('data-display_desktop');
65
- if ('show' == display_desktop) {
66
-
67
- // remove mobile style
68
- var rm = document.querySelector('.ht_ctc_mobile_' + p.getAttribute('data-return_type'));
69
- (rm) ? rm.remove() : '';
70
-
71
- var css = p.getAttribute('data-css');
72
- var position = p.getAttribute('data-position');
73
- p.style.cssText = position + css;
74
- group_display(p)
75
- }
76
- }
77
- }
78
-
79
-
80
- function group_display(p) {
81
-
82
- try {
83
- var dt = parseInt(p.getAttribute('data-show_effect'));
84
- $(p).show(dt);
85
- } catch (e) {
86
- p.style.display = "block";
87
- }
88
-
89
- // animations
90
- var animateclass = p.getAttribute('data-an_type')
91
- setTimeout(function () {
92
- p.classList.add('ht_ctc_animation', animateclass);
93
- }, 120);
94
-
95
- // hover effects
96
- $(".ht-ctc-group").hover(function () {
97
- $('.ht-ctc-group .ht-ctc-cta-hover').show(220);
98
- }, function () {
99
- $('.ht-ctc-group .ht-ctc-cta-hover').hide(100);
100
- });
101
-
102
- }
103
-
104
-
105
- });
106
-
107
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
new/inc/assets/js/dev/share.dev.js CHANGED
@@ -1,17 +1,13 @@
1
  // Click to Chat - Share
2
  (function ($) {
3
 
 
 
 
4
  var url = window.location.href;
5
  var is_mobile = (typeof screen.width !== "undefined" && screen.width > 1024) ? "no" : "yes";
6
  var post_title = (typeof document.title !== "undefined" ) ? document.title : '';
7
 
8
- if ('complete' == document.readyState || 'interactive' == document.readyState) {
9
- // call direclty
10
- share_ht_ctc();
11
- } else {
12
- document.addEventListener('DOMContentLoaded', share_ht_ctc);
13
- }
14
-
15
  function share_ht_ctc() {
16
  var ht_ctc_share = document.querySelector('.ht-ctc-share');
17
  if (ht_ctc_share) {
@@ -22,7 +18,7 @@ function share_ht_ctc() {
22
  }
23
 
24
  // shortcode
25
- $('.ht-ctc-sc-share').click(function () {
26
 
27
  data_link = this.getAttribute("data-ctc-link");
28
  data_link = encodeURI(data_link);
@@ -32,8 +28,8 @@ function share_ht_ctc() {
32
 
33
  });
34
 
35
-
36
  }
 
37
 
38
  // Hide based on device
39
  function share_display(p) {
@@ -177,4 +173,6 @@ function share_link(values) {
177
  window.open(base_link + '?text=' + share_text, '_blank', 'noopener');
178
  }
179
 
 
 
180
  })(jQuery);
1
  // Click to Chat - Share
2
  (function ($) {
3
 
4
+ // ready
5
+ $(function () {
6
+
7
  var url = window.location.href;
8
  var is_mobile = (typeof screen.width !== "undefined" && screen.width > 1024) ? "no" : "yes";
9
  var post_title = (typeof document.title !== "undefined" ) ? document.title : '';
10
 
 
 
 
 
 
 
 
11
  function share_ht_ctc() {
12
  var ht_ctc_share = document.querySelector('.ht-ctc-share');
13
  if (ht_ctc_share) {
18
  }
19
 
20
  // shortcode
21
+ $(document).on('click', '.ht-ctc-sc-share', function () {
22
 
23
  data_link = this.getAttribute("data-ctc-link");
24
  data_link = encodeURI(data_link);
28
 
29
  });
30
 
 
31
  }
32
+ share_ht_ctc();
33
 
34
  // Hide based on device
35
  function share_display(p) {
173
  window.open(base_link + '?text=' + share_text, '_blank', 'noopener');
174
  }
175
 
176
+ });
177
+
178
  })(jQuery);
new/inc/assets/js/group.js CHANGED
@@ -1 +1 @@
1
- !function(o){var i=window.location.href,c=void 0!==screen.width&&1024<screen.width?"no":"yes",r=void 0!==document.title?document.title:"";function t(){var e=document.querySelector(".ht-ctc-group");e&&(function(t){{var e,a,o,n;"yes"==c?"show"==t.getAttribute("data-display_mobile")&&((a=document.querySelector(".ht_ctc_desktop_group"))&&a.remove(),o=t.getAttribute("data-css"),e=t.getAttribute("data-position_mobile"),t.style.cssText=e+o,d(t)):"show"==t.getAttribute("data-display_desktop")&&((a=document.querySelector(".ht_ctc_mobile_group"))&&a.remove(),o=t.getAttribute("data-css"),n=t.getAttribute("data-position"),t.style.cssText=n+o,d(t))}}(e),e.addEventListener("click",function(){var t=e.getAttribute("data-group_id");window.open("https://chat.whatsapp.com/"+t,"_blank","noopener"),a(e)})),o(".ht-ctc-sc-group").click(function(){data_link=this.getAttribute("data-ctc-link"),data_link=encodeURI(data_link),window.open(data_link,"_blank","noopener"),a(this)})}function d(e){try{var t=parseInt(e.getAttribute("data-show_effect"));o(e).show(t)}catch(t){e.style.display="block"}var a=e.getAttribute("data-an_type");setTimeout(function(){e.classList.add("ht_ctc_animation",a)},120),o(".ht-ctc-group").hover(function(){o(".ht-ctc-group .ht-ctc-cta-hover").show(220)},function(){o(".ht-ctc-group .ht-ctc-cta-hover").hide(100)})}function a(t){var e=t.getAttribute("data-group_id"),a="Click to Chat for WhatsApp",o="group: "+e,n=r+", "+i;"yes"==t.getAttribute("data-is_ga_enable")&&("undefined"!=typeof gtag?gtag("event",o,{event_category:a,event_label:n}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",a,o,n):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",a,o,n)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",event_category:a,event_label:n,event_action:o}),"yes"==t.getAttribute("data-is_fb_pixel")&&"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:"group",ID:e,Title:r,URL:i})}"complete"==document.readyState||"interactive"==document.readyState?t():document.addEventListener("DOMContentLoaded",t)}(jQuery);
1
+ !function(s){s(function(){var t,e,a,o,n,i=window.location.href,c=void 0!==screen.width&&1024<screen.width?"no":"yes",r=void 0!==document.title?document.title:"";function d(e){try{var t=parseInt(e.getAttribute("data-show_effect"));s(e).show(t)}catch(t){e.style.display="block"}var a=e.getAttribute("data-an_type");setTimeout(function(){e.classList.add("ht_ctc_animation",a)},120),s(".ht-ctc-group").hover(function(){s(".ht-ctc-group .ht-ctc-cta-hover").show(220)},function(){s(".ht-ctc-group .ht-ctc-cta-hover").hide(100)})}function u(t){var e=t.getAttribute("data-group_id"),a="Click to Chat for WhatsApp",o="group: "+e,n=r+", "+i;"yes"==t.getAttribute("data-is_ga_enable")&&("undefined"!=typeof gtag?gtag("event",o,{event_category:a,event_label:n}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",a,o,n):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",a,o,n)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",event_category:a,event_label:n,event_action:o}),"yes"==t.getAttribute("data-is_fb_pixel")&&"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:"group",ID:e,Title:r,URL:i})}(n=document.querySelector(".ht-ctc-group"))&&(t=n,"yes"==c?"show"==t.getAttribute("data-display_mobile")&&((o=document.querySelector(".ht_ctc_desktop_group"))&&o.remove(),a=t.getAttribute("data-css"),e=t.getAttribute("data-position_mobile"),t.style.cssText=e+a,d(t)):"show"==t.getAttribute("data-display_desktop")&&((o=document.querySelector(".ht_ctc_mobile_group"))&&o.remove(),a=t.getAttribute("data-css"),o=t.getAttribute("data-position"),t.style.cssText=o+a,d(t)),n.addEventListener("click",function(){var t=n.getAttribute("data-group_id");window.open("https://chat.whatsapp.com/"+t,"_blank","noopener"),u(n)})),s(document).on("click",".ht-ctc-sc-group",function(){data_link=this.getAttribute("data-ctc-link"),data_link=encodeURI(data_link),window.open(data_link,"_blank","noopener"),u(this)})})}(jQuery);
new/inc/assets/js/share.js CHANGED
@@ -1 +1 @@
1
- !function(i){var o=window.location.href,c=void 0!==screen.width&&1024<screen.width?"no":"yes",r=void 0!==document.title?document.title:"";function t(){var e=document.querySelector(".ht-ctc-share");e&&(function(t){{var e,a,n,i;"yes"==c?"show"==t.getAttribute("data-display_mobile")&&((a=document.querySelector(".ht_ctc_desktop_share"))&&a.remove(),n=t.getAttribute("data-css"),e=t.getAttribute("data-position_mobile"),t.style.cssText=e+n,d(t)):"show"==t.getAttribute("data-display_desktop")&&((a=document.querySelector(".ht_ctc_mobile_share"))&&a.remove(),n=t.getAttribute("data-css"),i=t.getAttribute("data-position"),t.style.cssText=i+n,d(t))}}(e),e.addEventListener("click",function(){var t;(function(t){var e=t.getAttribute("data-share_text"),a=t.getAttribute("data-webandapi"),n="api";"webapi"==a&&(n="yes"==c?"api":"web");var i="https://"+n+".whatsapp.com/send";window.open(i+"?text="+e,"_blank","noopener")})(t=e),a(t)})),i(".ht-ctc-sc-share").click(function(){data_link=this.getAttribute("data-ctc-link"),data_link=encodeURI(data_link),window.open(data_link,"_blank","noopener"),a(this)})}function d(e){try{var t=parseInt(e.getAttribute("data-show_effect"));i(e).show(t)}catch(t){e.style.display="block"}var a,n;n=(a=e).getAttribute("data-an_type"),setTimeout(function(){a.classList.add("ht_ctc_animation",n)},120),i(".ht-ctc-share").hover(function(){i(".ht-ctc-share .ht-ctc-cta-hover").show(220)},function(){i(".ht-ctc-share .ht-ctc-cta-hover").hide(100)})}function a(t){var e=t.getAttribute("data-share_text"),a="Click to Chat for WhatsApp",n="share: "+e,i=r+", "+o;"yes"==t.getAttribute("data-is_ga_enable")&&("undefined"!=typeof gtag?gtag("event",n,{event_category:a,event_label:i}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",a,n,i):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",a,n,i)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",event_category:a,event_label:i,event_action:n}),"yes"==t.getAttribute("data-is_fb_pixel")&&"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:"share",ID:e,Title:r,URL:o})}"complete"==document.readyState||"interactive"==document.readyState?t():document.addEventListener("DOMContentLoaded",t)}(jQuery);
1
+ !function(h){h(function(){var t,e,a,n,i,o=window.location.href,c=void 0!==screen.width&&1024<screen.width?"no":"yes",r=void 0!==document.title?document.title:"";function s(e){try{var t=parseInt(e.getAttribute("data-show_effect"));h(e).show(t)}catch(t){e.style.display="block"}var a,n;n=(a=e).getAttribute("data-an_type"),setTimeout(function(){a.classList.add("ht_ctc_animation",n)},120),h(".ht-ctc-share").hover(function(){h(".ht-ctc-share .ht-ctc-cta-hover").show(220)},function(){h(".ht-ctc-share .ht-ctc-cta-hover").hide(100)})}function d(t){var e=t.getAttribute("data-share_text"),a="Click to Chat for WhatsApp",n="share: "+e,i=r+", "+o;"yes"==t.getAttribute("data-is_ga_enable")&&("undefined"!=typeof gtag?gtag("event",n,{event_category:a,event_label:i}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",a,n,i):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",a,n,i)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",event_category:a,event_label:i,event_action:n}),"yes"==t.getAttribute("data-is_fb_pixel")&&"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:"share",ID:e,Title:r,URL:o})}(i=document.querySelector(".ht-ctc-share"))&&(t=i,"yes"==c?"show"==t.getAttribute("data-display_mobile")&&((n=document.querySelector(".ht_ctc_desktop_share"))&&n.remove(),a=t.getAttribute("data-css"),e=t.getAttribute("data-position_mobile"),t.style.cssText=e+a,s(t)):"show"==t.getAttribute("data-display_desktop")&&((n=document.querySelector(".ht_ctc_mobile_share"))&&n.remove(),a=t.getAttribute("data-css"),n=t.getAttribute("data-position"),t.style.cssText=n+a,s(t)),i.addEventListener("click",function(){var t;(function(t){var e=t.getAttribute("data-share_text");t="https://"+(t="webapi"==t.getAttribute("data-webandapi")?"yes"==c?"api":"web":"api")+".whatsapp.com/send",window.open(t+"?text="+e,"_blank","noopener")})(t=i),d(t)})),h(document).on("click",".ht-ctc-sc-share",function(){data_link=this.getAttribute("data-ctc-link"),data_link=encodeURI(data_link),window.open(data_link,"_blank","noopener"),d(this)})})}(jQuery);
new/inc/chat/class-ht-ctc-chat-shortcode.php CHANGED
@@ -176,8 +176,6 @@ class HT_CTC_Chat_Shortcode {
176
  // shortcode template file path
177
  $sc_path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles-shortcode/sc-style-' . $style. '.php';
178
 
179
- // todo: 3.3 - later have to remove onclick attribute
180
-
181
  if ( is_file( $sc_path ) ) {
182
  $o .= '<div data-webandapi="'.$webandapi.'" data-number="'.$number.'" data-pre_filled="'.$pre_filled.'" data-return_type="'.$return_type.'" data-style="'.$style.'" data-is_ga_enable="'.$ht_ctc_os['is_ga_enable'].'" data-is_fb_pixel="'.$ht_ctc_os['is_fb_pixel'].'" style="display: inline; cursor: pointer; z-index: 99999999; '.$css.'" class="'.$class_names.' ht-ctc-inline">';
183
  include $sc_path;
176
  // shortcode template file path
177
  $sc_path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles-shortcode/sc-style-' . $style. '.php';
178
 
 
 
179
  if ( is_file( $sc_path ) ) {
180
  $o .= '<div data-webandapi="'.$webandapi.'" data-number="'.$number.'" data-pre_filled="'.$pre_filled.'" data-return_type="'.$return_type.'" data-style="'.$style.'" data-is_ga_enable="'.$ht_ctc_os['is_ga_enable'].'" data-is_fb_pixel="'.$ht_ctc_os['is_fb_pixel'].'" style="display: inline; cursor: pointer; z-index: 99999999; '.$css.'" class="'.$class_names.' ht-ctc-inline">';
181
  include $sc_path;
new/inc/chat/class-ht-ctc-chat.php CHANGED
@@ -35,11 +35,28 @@ class HT_CTC_Chat {
35
  $ht_ctc_chat = array();
36
  $ht_ctc_os = array();
37
 
38
- // show/hide
39
- include HT_CTC_PLUGIN_DIR .'new/inc/commons/show-hide.php';
 
40
 
41
- if ( 'no' == $display ) {
42
- return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  }
44
 
45
 
@@ -56,14 +73,7 @@ class HT_CTC_Chat {
56
  $ht_ctc_chat['position_mobile'] = $position_mobile;
57
 
58
 
59
- $page_id = get_the_ID();
60
- $page_url = get_permalink();
61
- $post_title = esc_html( get_the_title() );
62
-
63
- do_action('ht_ctc_ah_previous_metabox');
64
-
65
- // page level
66
- $ht_ctc_pagelevel = get_post_meta( $page_id, 'ht_ctc_pagelevel', true );
67
 
68
  // Number
69
  $ht_ctc_chat['number'] = (isset($ht_ctc_pagelevel['number'])) ? esc_attr($ht_ctc_pagelevel['number']) : esc_attr( $options['number'] );
@@ -101,6 +111,7 @@ class HT_CTC_Chat {
101
 
102
  // class names
103
  $ht_ctc_chat['class_names'] = "ht-ctc ht-ctc-chat ctc-analytics ";
 
104
 
105
  $ht_ctc_chat['css'] = "display: none; cursor: pointer; z-index: 99999999;";
106
 
@@ -152,14 +163,12 @@ class HT_CTC_Chat {
152
 
153
  // AMP
154
  $on = "";
155
- $onclick = "onclick='ht_ctc_click(this)'";
156
 
157
  // AMP
158
  if ( isset($options['amp']) ) {
159
  // ampforwp_is_amp_endpoint / is_amp_endpoint / amp_is_request
160
  if ( function_exists( 'amp_is_request' ) && amp_is_request() ) {
161
 
162
- $onclick = "";
163
  if ( 'yes' == $is_mobile ) {
164
  if ( 'show' == $ht_ctc_chat['display_mobile'] ) {
165
  $display_css = "";
@@ -185,9 +194,8 @@ class HT_CTC_Chat {
185
 
186
  if ( is_file( $path ) ) {
187
  do_action('ht_ctc_ah_before_fixed_position');
188
- // todo: 3.3 - later have to remove onclick attribute
189
  ?>
190
- <div <?php echo $onclick ?> class="<?php echo $ht_ctc_chat['class_names'] ?>"
191
  style="<?php echo $display_css ?> <?php echo $default_position ?>"
192
  data-return_type="<?php echo $type ?>"
193
  data-style="<?php echo $ht_ctc_chat['style'] ?>"
35
  $ht_ctc_chat = array();
36
  $ht_ctc_os = array();
37
 
38
+ $page_id = get_the_ID();
39
+ $page_url = get_permalink();
40
+ $post_title = esc_html( get_the_title() );
41
 
42
+ // page level
43
+ $ht_ctc_pagelevel = get_post_meta( $page_id, 'ht_ctc_pagelevel', true );
44
+
45
+ /**
46
+ * show/hide
47
+ *
48
+ * $page_display - page level settings - show/hide/ null
49
+ * $display - global settings
50
+ */
51
+ $page_display = (isset($ht_ctc_pagelevel['show_hide'])) ? esc_attr($ht_ctc_pagelevel['show_hide']) : '';
52
+
53
+ if ( 'show' !== $page_display ) {
54
+ include HT_CTC_PLUGIN_DIR .'new/inc/commons/show-hide.php';
55
+ // 'no' == $display - hided from global settings
56
+ // 'hide' == $page_display - hided at page level settings
57
+ if ( 'no' == $display || 'hide' == $page_display ) {
58
+ return;
59
+ }
60
  }
61
 
62
 
73
  $ht_ctc_chat['position_mobile'] = $position_mobile;
74
 
75
 
76
+
 
 
 
 
 
 
 
77
 
78
  // Number
79
  $ht_ctc_chat['number'] = (isset($ht_ctc_pagelevel['number'])) ? esc_attr($ht_ctc_pagelevel['number']) : esc_attr( $options['number'] );
111
 
112
  // class names
113
  $ht_ctc_chat['class_names'] = "ht-ctc ht-ctc-chat ctc-analytics ";
114
+ $ht_ctc_chat['id'] = "ht-ctc-chat ";
115
 
116
  $ht_ctc_chat['css'] = "display: none; cursor: pointer; z-index: 99999999;";
117
 
163
 
164
  // AMP
165
  $on = "";
 
166
 
167
  // AMP
168
  if ( isset($options['amp']) ) {
169
  // ampforwp_is_amp_endpoint / is_amp_endpoint / amp_is_request
170
  if ( function_exists( 'amp_is_request' ) && amp_is_request() ) {
171
 
 
172
  if ( 'yes' == $is_mobile ) {
173
  if ( 'show' == $ht_ctc_chat['display_mobile'] ) {
174
  $display_css = "";
194
 
195
  if ( is_file( $path ) ) {
196
  do_action('ht_ctc_ah_before_fixed_position');
 
197
  ?>
198
+ <div class="<?php echo $ht_ctc_chat['class_names'] ?>" id="<?php echo $ht_ctc_chat['id'] ?>"
199
  style="<?php echo $display_css ?> <?php echo $default_position ?>"
200
  data-return_type="<?php echo $type ?>"
201
  data-style="<?php echo $ht_ctc_chat['style'] ?>"
new/inc/commons/class-ht-ctc-hooks.php CHANGED
@@ -34,9 +34,6 @@ class HT_CTC_Hooks {
34
  // other settings
35
  add_filter( 'ht_ctc_fh_os', array($this, 'other_settings') );
36
 
37
- // previous metaboxes to new (clear: 3.11)
38
- add_action( 'ht_ctc_ah_previous_metabox', array($this, 'previous_metabox') );
39
-
40
  }
41
 
42
  /**
@@ -134,40 +131,7 @@ class HT_CTC_Hooks {
134
  }
135
 
136
 
137
- // update from previous method
138
- function previous_metabox() {
139
-
140
- $post_id = get_the_ID();
141
- $ht_ctc_pagelevel = get_post_meta( $post_id, 'ht_ctc_pagelevel', true );
142
-
143
- if ( !isset($ht_ctc_pagelevel) || empty($ht_ctc_pagelevel) ) {
144
- $prev_number = esc_attr( get_post_meta( $post_id, 'ht_ctc_page_number', true ) );
145
- $prev_number = (isset($prev_number)) ? $prev_number : '';
146
- $prev_call_to_action = esc_attr( get_post_meta( $post_id, 'ht_ctc_page_call_to_action', true ) );
147
- $prev_call_to_action = (isset($prev_call_to_action)) ? $prev_call_to_action : '';
148
- $prev_group_id = esc_attr( get_post_meta( $post_id, 'ht_ctc_page_group_id', true ) );
149
- $prev_group_id = (isset($prev_group_id)) ? $prev_group_id : '';
150
-
151
- $prev_ht_ctc_pagelevel = array();
152
- if ( '' !== $prev_number ) {
153
- $prev_ht_ctc_pagelevel['number'] = $prev_number;
154
- }
155
- if ( '' !== $prev_call_to_action ) {
156
- $prev_ht_ctc_pagelevel['call_to_action'] = $prev_call_to_action;
157
- }
158
- if ( '' !== $prev_group_id ) {
159
- $prev_ht_ctc_pagelevel['group_id'] = $prev_group_id;
160
- }
161
- $prev_ht_ctc_pagelevel = array_filter( $prev_ht_ctc_pagelevel );
162
- if ( !empty( $prev_ht_ctc_pagelevel ) ) {
163
- update_post_meta( $post_id, 'ht_ctc_pagelevel', $prev_ht_ctc_pagelevel );
164
- }
165
-
166
- delete_post_meta($post_id, 'ht_ctc_page_number', '' );
167
- delete_post_meta($post_id, 'ht_ctc_page_call_to_action', '' );
168
- delete_post_meta($post_id, 'ht_ctc_page_group_id', '' );
169
- }
170
- }
171
 
172
 
173
 
34
  // other settings
35
  add_filter( 'ht_ctc_fh_os', array($this, 'other_settings') );
36
 
 
 
 
37
  }
38
 
39
  /**
131
  }
132
 
133
 
134
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
 
136
 
137
 
new/inc/commons/class-ht-ctc-scripts.php CHANGED
@@ -26,11 +26,11 @@ class HT_CTC_Scripts {
26
  $load_app_js_bottom = apply_filters( 'ht_ctc_fh_load_app_js_bottom', true );
27
 
28
  // js
29
- $js = 'app.js';
30
  $group_js = 'group.js';
31
  $share_js = 'share.js';
32
 
33
- if ( isset($os['debug_mode']) || 'production' !== HT_CTC_ENVIRONMENT ) {
34
  $js = 'dev/app.dev.js';
35
  $group_js = 'dev/group.dev.js';
36
  $share_js = 'dev/share.dev.js';
26
  $load_app_js_bottom = apply_filters( 'ht_ctc_fh_load_app_js_bottom', true );
27
 
28
  // js
29
+ $js = '325.app.js';
30
  $group_js = 'group.js';
31
  $share_js = 'share.js';
32
 
33
+ if ( isset($os['debug_mode']) ) {
34
  $js = 'dev/app.dev.js';
35
  $group_js = 'dev/group.dev.js';
36
  $share_js = 'dev/share.dev.js';
new/inc/group/class-ht-ctc-group.php CHANGED
@@ -22,7 +22,18 @@ class HT_CTC_Group {
22
  $othersettings = get_option('ht_ctc_othersettings');
23
  $type = "group";
24
 
25
- // TODO: If db values are not correct - similar to chat
 
 
 
 
 
 
 
 
 
 
 
26
 
27
  $ht_ctc_group = array();
28
  $ht_ctc_os = array();
@@ -55,8 +66,6 @@ class HT_CTC_Group {
55
 
56
  $page_id = get_the_ID();
57
 
58
- do_action('ht_ctc_ah_previous_metabox');
59
-
60
  // At page level
61
  $ht_ctc_pagelevel = get_post_meta( $page_id, 'ht_ctc_pagelevel', true );
62
 
22
  $othersettings = get_option('ht_ctc_othersettings');
23
  $type = "group";
24
 
25
+ // If db values are not correct
26
+ if ( !is_array($options) || !isset($options['group_id']) ) {
27
+
28
+ // in debug mode
29
+ if ( isset($othersettings['debug_mode']) ) {
30
+ ?>
31
+ <script>console.log('please check plugin settings and save changes')</script>
32
+ <?php
33
+ }
34
+
35
+ return;
36
+ }
37
 
38
  $ht_ctc_group = array();
39
  $ht_ctc_os = array();
66
 
67
  $page_id = get_the_ID();
68
 
 
 
69
  // At page level
70
  $ht_ctc_pagelevel = get_post_meta( $page_id, 'ht_ctc_pagelevel', true );
71
 
new/inc/share/class-ht-ctc-share.php CHANGED
@@ -22,7 +22,18 @@ class HT_CTC_Share {
22
  $othersettings = get_option('ht_ctc_othersettings');
23
  $type = "share";
24
 
25
- // TODO: If db values are not correct - similar to chat
 
 
 
 
 
 
 
 
 
 
 
26
 
27
  $ht_ctc_share = array();
28
  $ht_ctc_os = array();
@@ -126,7 +137,6 @@ class HT_CTC_Share {
126
 
127
  if ( is_file( $path ) ) {
128
  do_action('ht_ctc_ah_before_fixed_position');
129
- // onclick="ht_ctc_share_click(this);"
130
  ?>
131
  <div class="<?php echo $ht_ctc_share['class_names'] ?>"
132
  style="display: none;"
22
  $othersettings = get_option('ht_ctc_othersettings');
23
  $type = "share";
24
 
25
+ // If db values are not correct
26
+ if ( !is_array($options) || !isset($options['share_text']) ) {
27
+
28
+ // in debug mode
29
+ if ( isset($othersettings['debug_mode']) ) {
30
+ ?>
31
+ <script>console.log('please check plugin settings and save changes')</script>
32
+ <?php
33
+ }
34
+
35
+ return;
36
+ }
37
 
38
  $ht_ctc_share = array();
39
  $ht_ctc_os = array();
137
 
138
  if ( is_file( $path ) ) {
139
  do_action('ht_ctc_ah_before_fixed_position');
 
140
  ?>
141
  <div class="<?php echo $ht_ctc_share['class_names'] ?>"
142
  style="display: none;"
prev/admin/admin.php CHANGED
@@ -19,49 +19,4 @@ include_once('commons/class-ht-ccw-admin-lists.php');
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');
23
-
24
-
25
- // as translation text added only in admin - so done here
26
- // function load_ht_ccw_textdomain() {
27
- // load_plugin_textdomain( 'click-to-chat-for-whatsapp', FALSE, HT_CTC_PLUGIN_BASENAME . 'prev/languages/' );
28
- // }
29
-
30
- // add_action( 'plugins_loaded', 'load_ht_ccw_textdomain' );
31
-
32
-
33
-
34
- /**
35
- * ccw_admin_sidebar_card - by default there is no option ..
36
- * so when no option exists .. so it not equal to 'hide'
37
- * so in admin sidebar the card will display . .
38
- * if clicks on hide card ..
39
- * then an option update will happen ( create an option )
40
- *
41
- */
42
- add_action( 'wp_ajax_ccw_admin_sidebar', 'ht_ccw_admin_sidebar_ajax' );
43
-
44
- function ht_ccw_admin_sidebar_ajax() {
45
-
46
- $wca_card = get_option( 'ccw_admin_sidebar_card' );
47
-
48
- // wp_localize_script can use - but this may be easy, as only one value ..
49
- echo $wca_card;
50
-
51
- wp_die();
52
- }
53
-
54
-
55
-
56
- // action - ccw_hide_admin_sidebar_card
57
- // update the option ccw_admin_sidebar_card to hide
58
- add_action( 'wp_ajax_ccw_hide_admin_sidebar_card', 'ht_ccw_hide_admin_sidebar_card_ajax' );
59
-
60
- function ht_ccw_hide_admin_sidebar_card_ajax() {
61
-
62
- $wca_card = get_option( 'ccw_admin_sidebar_card' );
63
-
64
- update_option( 'ccw_admin_sidebar_card', 'hide' );
65
-
66
- wp_die();
67
- }
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');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
prev/admin/commons/admin-sidebar.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
- /**
3
- * sidebar in admin area - plugin settings page.
4
- * @uses at settings_page.php
5
- * plan to use in sp_customize_styles.php
6
- */
7
-
8
- if ( ! defined( 'ABSPATH' ) ) exit;
9
-
10
- ?>
11
-
12
- <div class="wca-plugin">
13
-
14
- <div class="col s10 offset-s2 offset-m3 offset-xl2">
15
- <div class="card blue-grey darken-1" style="margin-bottom: 0;">
16
- <div class="card-content white-text">
17
- <span class="card-title">Next Version - New interface - Beta</span>
18
- <br>
19
- <p>We developed a new Interface, plannnig to release soon. </p>
20
- <br>
21
- <p>Please <a href="https://holithemes.com/go/ctc-1-8">Download</a> the beta version and reinstall the plugin</p><br>
22
- <!-- <p>After downloading, please delete the current version and reinstall the latest version.</p><br> -->
23
- <br>
24
- </div>
25
- <div class="card-action">
26
- <a href="https://holithemes.com/go/ctc-1-8">Download</a>
27
- <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/">Documentation</a>
28
- </div>
29
- </div>
30
- <small class="admin_sidebar_hide_option" onclick="ccw_hide_admin_sidebar_card()" style="cursor: pointer;">Hide this card</small>
31
- </div>
32
-
33
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
prev/assets/js/admin_app.js CHANGED
@@ -78,43 +78,4 @@ jQuery(document).ready(function () {
78
 
79
  });
80
 
81
- });
82
-
83
-
84
- // makes an ajax call
85
- // if ccw_admin_sidebar_card option is not set or not equal to hide
86
- // then show the card - set display: block
87
- jQuery.post(
88
- ajaxurl,
89
- {
90
- 'action': 'ccw_admin_sidebar',
91
- },
92
- function(response){
93
- if ( 'hide' !== response ) {
94
- var wca_card = document.querySelector(".wca_card");
95
- if ( wca_card ) {
96
- wca_card.style.display = "block";
97
- }
98
- }
99
- }
100
- );
101
-
102
-
103
- // when clicked on hide card at admin sidebar
104
- // makes an ajax call an update / create the ccw_admin_sidebar_card option to hide
105
- function ccw_hide_admin_sidebar_card() {
106
-
107
- jQuery.post(
108
- ajaxurl,
109
- {
110
- 'action': 'ccw_hide_admin_sidebar_card',
111
- },
112
- );
113
-
114
- var wca_card = document.querySelector(".wca_card");
115
-
116
- if ( wca_card ) {
117
- wca_card.style.display = "none";
118
- }
119
-
120
- }
78
 
79
  });
80
 
81
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Requires at least: 4.6
3
  Tested up to: 5.6
4
  Requires PHP: 5.6
5
  Contributors: holithemes
6
- Stable tag: 3.2.4
7
  Tags: whatsapp, whatsapp business, click to chat, whatsapp chat, whatsapp support, whatsapp group, whatsapp message, social chat, whatsapp wordpress, whatsapp floating button, whatsapp icon, holithemes
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -395,6 +395,12 @@ After Activate the plugin, add WhatsApp Number at plugin settings.
395
 
396
  == Changelog ==
397
 
 
 
 
 
 
 
398
  = 3.2.4 =
399
  * AMP Compatibility - 1st version
400
  * Updated: Positions to place
3
  Tested up to: 5.6
4
  Requires PHP: 5.6
5
  Contributors: holithemes
6
+ Stable tag: 3.2.5
7
  Tags: whatsapp, whatsapp business, click to chat, whatsapp chat, whatsapp support, whatsapp group, whatsapp message, social chat, whatsapp wordpress, whatsapp floating button, whatsapp icon, holithemes
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
395
 
396
  == Changelog ==
397
 
398
+ = 3.2.5 =
399
+ * Showcase - [Add your website to Click-to-Chat portfolio](https://docs.google.com/forms/d/e/1FAIpQLSdPgUgjaZLxfEk-jRQUd8efV-SNh5eOgc2Qe5Xl9uz0ti8tEw/viewform?usp=sf_link)
400
+ * Show/Hide settings at page level
401
+ * Fix: Shortcode navigation, if loaded dynamically.
402
+ * Updated JavaScript File name. (to fix cache issues)
403
+
404
  = 3.2.4 =
405
  * AMP Compatibility - 1st version
406
  * Updated: Positions to place