Click to Chat for WhatsApp Chat - Version 3.0.3

Version Description

  • Updated Animations
  • Fixed: {url} variable at WooCommerce Pre-filled message.
Download this release

Release Info

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

Code changes from version 2.12.1 to 3.0.3

Files changed (46) hide show
  1. click-to-chat.php +3 -3
  2. new/admin/admin.php +3 -0
  3. new/admin/admin_assets/js/admin.js +0 -22
  4. new/admin/admin_commons/admin-after-settings-page.php +1 -1
  5. new/admin/admin_commons/admin-desktop.php +5 -1
  6. new/admin/admin_commons/admin-mobile.php +3 -1
  7. new/admin/admin_commons/admin-sidebar-content.php +2 -2
  8. new/admin/class-ht-ctc-admin-customize-styles.php +516 -245
  9. new/admin/class-ht-ctc-admin-group-page.php +1 -1
  10. new/admin/class-ht-ctc-admin-main-page.php +7 -96
  11. new/admin/class-ht-ctc-admin-other-settings.php +436 -0
  12. new/admin/class-ht-ctc-admin-scripts.php +1 -1
  13. new/admin/class-ht-ctc-db.php +523 -280
  14. new/inc/assets/img/ht-ctc-svg-images.php +111 -0
  15. new/inc/assets/img/svg-style-2.php +0 -24
  16. new/inc/assets/img/svg-style-3.php +0 -51
  17. new/inc/assets/js/app.js +1 -1
  18. new/inc/assets/js/{app.dev.js → dev/app.dev.js} +78 -57
  19. new/inc/assets/js/{app.test.js → dev/app.test.js} +0 -0
  20. new/inc/assets/js/dev/group.dev.js +138 -0
  21. new/inc/assets/js/dev/share.dev.js +147 -0
  22. new/inc/assets/js/group.js +1 -0
  23. new/inc/assets/js/share.js +1 -0
  24. new/inc/chat/class-ht-ctc-chat.php +72 -54
  25. new/inc/class-ht-ctc-register.php +2 -3
  26. new/inc/commons/class-ht-ctc-animations.php +50 -0
  27. new/inc/commons/class-ht-ctc-hooks.php +53 -16
  28. new/inc/commons/class-ht-ctc-scripts.php +21 -1
  29. new/inc/group/class-ht-ctc-group-shortcode.php +2 -2
  30. new/inc/group/class-ht-ctc-group.php +62 -30
  31. new/inc/share/class-ht-ctc-share-shortcode.php +2 -2
  32. new/inc/share/class-ht-ctc-share.php +65 -41
  33. new/inc/styles-shortcode/sc-style-3.php +3 -57
  34. new/inc/styles-shortcode/sc-style-3_1.php +60 -0
  35. new/inc/styles-shortcode/sc-style-4.php +3 -3
  36. new/inc/styles-shortcode/sc-style-7.php +52 -11
  37. new/inc/styles-shortcode/sc-style-7_1.php +64 -0
  38. new/inc/styles-shortcode/sc-style-8.php +43 -28
  39. new/inc/styles/style-2.php +34 -3
  40. new/inc/styles/style-3.php +36 -43
  41. new/inc/styles/style-3_1.php +81 -0
  42. new/inc/styles/style-4.php +3 -3
  43. new/inc/styles/style-7.php +58 -7
  44. new/inc/styles/style-7_1.php +88 -0
  45. new/inc/styles/style-8.php +39 -32
  46. readme.txt +18 -15
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: 2.12.1
7
  Author: HoliThemes
8
  Author URI: https://holithemes.com/plugins/click-to-chat/
9
  License: GPL2
@@ -15,9 +15,9 @@ if ( ! defined( 'WPINC' ) ) {
15
  die('dont try to call this directly');
16
  }
17
 
18
- // ctc - Version
19
  if ( ! defined( 'HT_CTC_VERSION' ) ) {
20
- define( 'HT_CTC_VERSION', '2.12.1' );
21
  }
22
 
23
  // environment - production, staging, development, test
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.0.3
7
  Author: HoliThemes
8
  Author URI: https://holithemes.com/plugins/click-to-chat/
9
  License: GPL2
15
  die('dont try to call this directly');
16
  }
17
 
18
+ // ctc - Version - update version at readme 'Stable tag'
19
  if ( ! defined( 'HT_CTC_VERSION' ) ) {
20
+ define( 'HT_CTC_VERSION', '3.0.3' );
21
  }
22
 
23
  // environment - production, staging, development, test
new/admin/admin.php CHANGED
@@ -41,5 +41,8 @@ if ( isset ( $ht_ctc_othersettings['enable_share'] ) ) {
41
  // customize
42
  include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-customize-styles.php';
43
 
 
 
 
44
  // meta boxes - change values at page level
45
  include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/class-ht-ctc-metabox.php';
41
  // customize
42
  include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-customize-styles.php';
43
 
44
+ // other settings
45
+ include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-other-settings.php';
46
+
47
  // meta boxes - change values at page level
48
  include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/class-ht-ctc-metabox.php';
new/admin/admin_assets/js/admin.js CHANGED
@@ -58,28 +58,6 @@ jQuery(document).ready(function ($) {
58
  }
59
  ht_ctc_show_hide_options();
60
 
61
- // style-3 type
62
- function ht_ctc_customize_s3() {
63
-
64
- var s3_type_val = $('.select_style_3_type').find(":selected").val();
65
- if (s3_type_val == 'extend') {
66
- $(".s3_type_extend").show();
67
- } else {
68
- $(".s3_type_extend").hide();
69
- }
70
-
71
- // on change
72
- $(".select_style_3_type").on("change", function (e) {
73
- var s3_type_change_val = e.target.value;
74
- if (s3_type_change_val == 'extend') {
75
- $(".s3_type_extend").show(500);
76
- } else {
77
- $(".s3_type_extend").hide();
78
- }
79
- });
80
- }
81
- ht_ctc_customize_s3();
82
-
83
 
84
  // on change - styles
85
  $(".chat_select_style").on("change", function (e) {
58
  }
59
  ht_ctc_show_hide_options();
60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
  // on change - styles
63
  $(".chat_select_style").on("change", function (e) {
new/admin/admin_commons/admin-after-settings-page.php CHANGED
@@ -61,7 +61,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
61
  <div class="collapsible-header"><?php _e( 'Contact Us', 'click-to-chat-for-whatsapp' ); ?></div>
62
  <div class="collapsible-body">
63
  <p class="description"><a href="http://api.whatsapp.com/send?phone=919494429789&text=<?php echo get_bloginfo('url'); ?>%0AHi%20HoliThemes!!" target="_blank"><?php _e( 'WhatsApp', 'click-to-chat-for-whatsapp' ); ?></a></p>
64
- <p class="description"><?php _e( 'mail', 'click-to-chat-for-whatsapp' ); ?>: wp@holithemes.com</p>
65
  </div>
66
  </li>
67
 
61
  <div class="collapsible-header"><?php _e( 'Contact Us', 'click-to-chat-for-whatsapp' ); ?></div>
62
  <div class="collapsible-body">
63
  <p class="description"><a href="http://api.whatsapp.com/send?phone=919494429789&text=<?php echo get_bloginfo('url'); ?>%0AHi%20HoliThemes!!" target="_blank"><?php _e( 'WhatsApp', 'click-to-chat-for-whatsapp' ); ?></a></p>
64
+ <p class="description"><?php _e( 'mail', 'click-to-chat-for-whatsapp' ); ?>: ctc@holithemes.com</p>
65
  </div>
66
  </li>
67
 
new/admin/admin_commons/admin-desktop.php CHANGED
@@ -33,16 +33,20 @@ $side_2_value = ( isset( $options['side_2_value']) ) ? esc_attr( $options['side_
33
  <select name="<?php echo $dbrow ?>[style_desktop]" class="chat_select_style select_style_desktop">
34
  <option value="1" <?php echo $style_desktop == 1 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-1', 'click-to-chat-for-whatsapp' ); ?></option>
35
  <option value="2" <?php echo $style_desktop == 2 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-2', 'click-to-chat-for-whatsapp' ); ?></option>
 
36
  <option value="3" <?php echo $style_desktop == 3 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-3', 'click-to-chat-for-whatsapp' ); ?></option>
 
 
37
  <option value="4" <?php echo $style_desktop == 4 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-4', 'click-to-chat-for-whatsapp' ); ?></option>
38
  <option value="5" <?php echo $style_desktop == 5 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-5', 'click-to-chat-for-whatsapp' ); ?></option>
39
  <option value="6" <?php echo $style_desktop == 6 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-6', 'click-to-chat-for-whatsapp' ); ?></option>
40
  <option value="7" <?php echo $style_desktop == 7 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7', 'click-to-chat-for-whatsapp' ); ?></option>
 
41
  <option value="8" <?php echo $style_desktop == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
42
  <option value="99" <?php echo $style_desktop == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-99 (Add your own image / GIF)', 'click-to-chat-for-whatsapp' ); ?></option>
43
  </select>
44
  <p class="description"><a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/list-of-styles/"><?php _e( 'List of styles', 'click-to-chat-for-whatsapp' ); ?></a> &emsp; | &emsp; <span><?php _e( 'Customize the styles', 'click-to-chat-for-whatsapp' ); ?> <a target="_blank" class="customize_styles_link" href="<?php echo admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">( Click to Chat -> Customize )</a></span> </p>
45
- <p class="description"><span class="check_select_styles" style="font-size: 0.7em;"><?php _e( 'If Styles for desktop, mobile not selected as expected', 'click-to-chat-for-whatsapp' ); ?> <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat-customize-styles#styles_issue' ); ?>"><?php _e( 'Check this', 'click-to-chat-for-whatsapp' ); ?></a>, - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/select-styles/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a></span></p>
46
  <!-- <span class="check_select_styles" style="font-size: 0.7em;">If Styles for desktop, mobile not selected as expected <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat-customize-styles#:~:text=check%20this, cache)' ); ?>">Check this</a>, - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/select-styles/">more info</a></span></p> -->
47
  </div>
48
  </div>
33
  <select name="<?php echo $dbrow ?>[style_desktop]" class="chat_select_style select_style_desktop">
34
  <option value="1" <?php echo $style_desktop == 1 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-1', 'click-to-chat-for-whatsapp' ); ?></option>
35
  <option value="2" <?php echo $style_desktop == 2 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-2', 'click-to-chat-for-whatsapp' ); ?></option>
36
+ <!-- <optgroup label="Style 3"> -->
37
  <option value="3" <?php echo $style_desktop == 3 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-3', 'click-to-chat-for-whatsapp' ); ?></option>
38
+ <option value="3_1" <?php echo $style_desktop == '3_1' ? 'SELECTED' : ''; ?> ><?php _e( 'Style-3 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
39
+ <!-- </optgroup> -->
40
  <option value="4" <?php echo $style_desktop == 4 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-4', 'click-to-chat-for-whatsapp' ); ?></option>
41
  <option value="5" <?php echo $style_desktop == 5 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-5', 'click-to-chat-for-whatsapp' ); ?></option>
42
  <option value="6" <?php echo $style_desktop == 6 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-6', 'click-to-chat-for-whatsapp' ); ?></option>
43
  <option value="7" <?php echo $style_desktop == 7 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7', 'click-to-chat-for-whatsapp' ); ?></option>
44
+ <option value="7_1" <?php echo $style_desktop == '7_1' ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
45
  <option value="8" <?php echo $style_desktop == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
46
  <option value="99" <?php echo $style_desktop == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-99 (Add your own image / GIF)', 'click-to-chat-for-whatsapp' ); ?></option>
47
  </select>
48
  <p class="description"><a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/list-of-styles/"><?php _e( 'List of styles', 'click-to-chat-for-whatsapp' ); ?></a> &emsp; | &emsp; <span><?php _e( 'Customize the styles', 'click-to-chat-for-whatsapp' ); ?> <a target="_blank" class="customize_styles_link" href="<?php echo admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">( Click to Chat -> Customize )</a></span> </p>
49
+ <p class="description"><span class="check_select_styles" style="font-size: 0.7em;"><?php _e( 'If Styles for desktop, mobile not selected as expected', 'click-to-chat-for-whatsapp' ); ?> <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat-other-settings#styles_issue:~:text=Check,cache)' ); ?>"><?php _e( 'Check this', 'click-to-chat-for-whatsapp' ); ?></a>, - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/select-styles/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a></span></p>
50
  <!-- <span class="check_select_styles" style="font-size: 0.7em;">If Styles for desktop, mobile not selected as expected <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat-customize-styles#:~:text=check%20this, cache)' ); ?>">Check this</a>, - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/select-styles/">more info</a></span></p> -->
51
  </div>
52
  </div>
new/admin/admin_commons/admin-mobile.php CHANGED
@@ -33,15 +33,17 @@ $mobile_side_2_value = ( isset( $options['mobile_side_2_value'])) ? esc_attr( $o
33
  <option value="1" <?php echo $style_mobile == 1 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-1', 'click-to-chat-for-whatsapp' ); ?></option>
34
  <option value="2" <?php echo $style_mobile == 2 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-2', 'click-to-chat-for-whatsapp' ); ?></option>
35
  <option value="3" <?php echo $style_mobile == 3 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-3', 'click-to-chat-for-whatsapp' ); ?></option>
 
36
  <option value="4" <?php echo $style_mobile == 4 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-4', 'click-to-chat-for-whatsapp' ); ?></option>
37
  <option value="5" <?php echo $style_mobile == 5 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-5', 'click-to-chat-for-whatsapp' ); ?></option>
38
  <option value="6" <?php echo $style_mobile == 6 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-6', 'click-to-chat-for-whatsapp' ); ?></option>
39
  <option value="7" <?php echo $style_mobile == 7 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7', 'click-to-chat-for-whatsapp' ); ?></option>
 
40
  <option value="8" <?php echo $style_mobile == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
41
  <option value="99" <?php echo $style_mobile == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-99 (Add your own image / GIF)', 'click-to-chat-for-whatsapp' ); ?></option>
42
  </select>
43
  <p class="description"><a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/list-of-styles/"><?php _e( 'List of styles', 'click-to-chat-for-whatsapp' ); ?></a> &emsp; | &emsp; <span><?php _e( 'Customize the styles', 'click-to-chat-for-whatsapp' ); ?> <a target="_blank" class="customize_styles_link" href="<?php echo admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">( Click to Chat -> Customize )</a></span> </p>
44
- <p class="description"><span class="check_select_styles" style="font-size: 0.7em;">If Styles for desktop, mobile not selected as expected <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat-customize-styles#styles_issue' ); ?>">Check this</a>, - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/select-styles/">more info</a></span></p>
45
  </div>
46
  </div>
47
 
33
  <option value="1" <?php echo $style_mobile == 1 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-1', 'click-to-chat-for-whatsapp' ); ?></option>
34
  <option value="2" <?php echo $style_mobile == 2 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-2', 'click-to-chat-for-whatsapp' ); ?></option>
35
  <option value="3" <?php echo $style_mobile == 3 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-3', 'click-to-chat-for-whatsapp' ); ?></option>
36
+ <option value="3_1" <?php echo $style_mobile == '3_1' ? 'SELECTED' : ''; ?> ><?php _e( 'Style-3 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
37
  <option value="4" <?php echo $style_mobile == 4 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-4', 'click-to-chat-for-whatsapp' ); ?></option>
38
  <option value="5" <?php echo $style_mobile == 5 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-5', 'click-to-chat-for-whatsapp' ); ?></option>
39
  <option value="6" <?php echo $style_mobile == 6 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-6', 'click-to-chat-for-whatsapp' ); ?></option>
40
  <option value="7" <?php echo $style_mobile == 7 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7', 'click-to-chat-for-whatsapp' ); ?></option>
41
+ <option value="7_1" <?php echo $style_mobile == '7_1' ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
42
  <option value="8" <?php echo $style_mobile == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
43
  <option value="99" <?php echo $style_mobile == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-99 (Add your own image / GIF)', 'click-to-chat-for-whatsapp' ); ?></option>
44
  </select>
45
  <p class="description"><a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/list-of-styles/"><?php _e( 'List of styles', 'click-to-chat-for-whatsapp' ); ?></a> &emsp; | &emsp; <span><?php _e( 'Customize the styles', 'click-to-chat-for-whatsapp' ); ?> <a target="_blank" class="customize_styles_link" href="<?php echo admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">( Click to Chat -> Customize )</a></span> </p>
46
+ <p class="description"><span class="check_select_styles" style="font-size: 0.7em;">If Styles for desktop, mobile not selected as expected <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat-other-settings#styles_issue:~:text=Check,cache)' ); ?>">Check this</a>, - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/select-styles/">more info</a></span></p>
47
  </div>
48
  </div>
49
 
new/admin/admin_commons/admin-sidebar-content.php CHANGED
@@ -8,7 +8,7 @@
8
  <!-- <p>
9
  Please let us know if you have any suggestions or feedback!! <br>
10
  <a href="http://api.whatsapp.com/send?phone=919494429789&text=<?php echo get_bloginfo('url'); ?>%0AHi%20HoliThemes,%0AI%20have%20a%20Suggestion/Feedback:" target="_blank">WhatsApp</a> <br>
11
- mail: wp@holithemes.com
12
  </p> -->
13
 
14
  <div class="col s12 m8 l12 xl12">
@@ -48,7 +48,7 @@ mail: wp@holithemes.com
48
  <div class="collapsible-header"><?php _e( 'Contact Us', 'click-to-chat-for-whatsapp' ); ?></div>
49
  <div class="collapsible-body">
50
  <p class="description"><?php _e( 'Please let us know if you have any suggestions or feedback!!', 'click-to-chat-for-whatsapp' ); ?> <br><br> <a href="http://api.whatsapp.com/send?phone=919494429789&text=<?php echo get_bloginfo('url'); ?>%0AHi%20HoliThemes,%0AI%20have%20a%20Suggestion/Feedback:" target="_blank"><?php _e( 'WhatsApp', 'click-to-chat-for-whatsapp' ); ?></a></p>
51
- <p class="description"><?php _e( 'mail', 'click-to-chat-for-whatsapp' ); ?>: wp@holithemes.com</p>
52
  </div>
53
  </li>
54
 
8
  <!-- <p>
9
  Please let us know if you have any suggestions or feedback!! <br>
10
  <a href="http://api.whatsapp.com/send?phone=919494429789&text=<?php echo get_bloginfo('url'); ?>%0AHi%20HoliThemes,%0AI%20have%20a%20Suggestion/Feedback:" target="_blank">WhatsApp</a> <br>
11
+ mail: ctc@holithemes.com
12
  </p> -->
13
 
14
  <div class="col s12 m8 l12 xl12">
48
  <div class="collapsible-header"><?php _e( 'Contact Us', 'click-to-chat-for-whatsapp' ); ?></div>
49
  <div class="collapsible-body">
50
  <p class="description"><?php _e( 'Please let us know if you have any suggestions or feedback!!', 'click-to-chat-for-whatsapp' ); ?> <br><br> <a href="http://api.whatsapp.com/send?phone=919494429789&text=<?php echo get_bloginfo('url'); ?>%0AHi%20HoliThemes,%0AI%20have%20a%20Suggestion/Feedback:" target="_blank"><?php _e( 'WhatsApp', 'click-to-chat-for-whatsapp' ); ?></a></p>
51
+ <p class="description"><?php _e( 'mail', 'click-to-chat-for-whatsapp' ); ?>: ctc@holithemes.com</p>
52
  </div>
53
  </li>
54
 
new/admin/class-ht-ctc-admin-customize-styles.php CHANGED
@@ -12,8 +12,69 @@ if ( ! class_exists( 'HT_CTC_Admin_Customize_Styles' ) ) :
12
 
13
  class HT_CTC_Admin_Customize_Styles {
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  public function menu() {
16
 
 
 
17
  add_submenu_page(
18
  'click-to-chat',
19
  'Customize',
@@ -61,26 +122,30 @@ class HT_CTC_Admin_Customize_Styles {
61
  register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s1' , array( $this, 'options_sanitize' ) );
62
  register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s2' , array( $this, 'options_sanitize' ) );
63
  register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s3' , array( $this, 'options_sanitize' ) );
 
64
  register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s4' , array( $this, 'options_sanitize' ) );
65
  register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s5' , array( $this, 'options_sanitize' ) );
66
  register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s6' , array( $this, 'options_sanitize' ) );
67
  register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s7' , array( $this, 'options_sanitize' ) );
 
68
  register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s8' , array( $this, 'options_sanitize' ) );
69
  register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s99' , array( $this, 'options_sanitize' ) );
70
- register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_othersettings' , array( $this, 'options_sanitize' ) );
71
 
72
  add_settings_section( 'ht_ctc_cs_settings_sections_add', '', array( $this, 'main_settings_section_cb' ), 'ht_ctc_cs_page_settings_sections_do' );
73
 
74
- add_settings_field( 'ht_ctc_s1', 'Style-1', array( $this, 'ht_ctc_s1_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add' );
75
- add_settings_field( 'ht_ctc_s2', 'Style-2', array( $this, 'ht_ctc_s2_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add' );
76
- add_settings_field( 'ht_ctc_s3', 'Style-3', array( $this, 'ht_ctc_s3_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add' );
77
- add_settings_field( 'ht_ctc_s4', 'Style-4', array( $this, 'ht_ctc_s4_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add' );
78
- add_settings_field( 'ht_ctc_s5', 'Style-5', array( $this, 'ht_ctc_s5_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add' );
79
- add_settings_field( 'ht_ctc_s6', 'Style-6', array( $this, 'ht_ctc_s6_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add' );
80
- add_settings_field( 'ht_ctc_s7', 'Style-7', array( $this, 'ht_ctc_s7_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add' );
81
- add_settings_field( 'ht_ctc_s8', 'Style-8', array( $this, 'ht_ctc_s8_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add' );
82
- add_settings_field( 'ht_ctc_s99', 'Style-99', array( $this, 'ht_ctc_s99_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add' );
83
- add_settings_field( 'ht_ctc_othersettings', 'Other settings', array( $this, 'ht_ctc_othersettings_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add' );
 
 
84
 
85
 
86
  }
@@ -88,7 +153,46 @@ class HT_CTC_Admin_Customize_Styles {
88
  public function main_settings_section_cb() {
89
  ?>
90
  <h1>Customize</h1>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  }
93
 
94
 
@@ -121,7 +225,10 @@ class HT_CTC_Admin_Customize_Styles {
121
  function ht_ctc_s2_cb() {
122
 
123
  $options = get_option('ht_ctc_s2');
 
 
124
  $s2_img_size = ( isset( $options['s2_img_size']) ) ? esc_attr( $options['s2_img_size'] ) : '';
 
125
  ?>
126
  <ul class="collapsible" data-collapsible="accordion">
127
  <li>
@@ -135,11 +242,63 @@ class HT_CTC_Admin_Customize_Styles {
135
  <p><?php _e( 'Image Size', 'click-to-chat-for-whatsapp' ); ?></p>
136
  </div>
137
  <div class="input-field col s6">
138
- <input name="ht_ctc_s2[s2_img_size]" value="<?php echo $s2_img_size ?>" id="s2_img_size" type="text" class="" >
139
  <label for="s2_img_size"><?php _e( 'Image Size', 'click-to-chat-for-whatsapp' ); ?></label>
140
  </div>
141
  </div>
142
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
 
144
  </div>
145
  </div>
@@ -155,6 +314,8 @@ class HT_CTC_Admin_Customize_Styles {
155
  function ht_ctc_s3_cb() {
156
 
157
  $options = get_option('ht_ctc_s3');
 
 
158
 
159
  $select_s3_type = ( isset( $options['s3_type']) ) ? esc_attr( $options['s3_type'] ) : '1';
160
 
@@ -166,32 +327,101 @@ class HT_CTC_Admin_Customize_Styles {
166
  $s3_bg_color = ( isset( $options['s3_bg_color']) ) ? esc_attr( $options['s3_bg_color'] ) : '';
167
  $s3_bg_color_hover = ( isset( $options['s3_bg_color_hover']) ) ? esc_attr( $options['s3_bg_color_hover'] ) : '';
168
 
169
- // has sometimes js in not updating - can remove this later
170
- $s3_extend_display = "";
171
- if ( 'simple' == $select_s3_type ) {
172
- // hide extend features
173
- $s3_extend_display = "display: none;";
174
- }
175
-
176
  ?>
177
  <ul class="collapsible" data-collapsible="accordion">
178
  <li>
179
  <div class="collapsible-header"><?php _e( 'Style 3', 'click-to-chat-for-whatsapp' ); ?></div>
180
  <div class="collapsible-body">
181
 
182
- <!-- Simple / Extend -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  <div class="row">
184
  <div class="col s6">
185
- <p><?php _e( 'Style-3: Simple/Extend', 'click-to-chat-for-whatsapp' ); ?></p>
186
  </div>
187
  <div class="input-field col s6">
188
- <select name="ht_ctc_s3[s3_type]" class="select_style_3_type">
189
- <option value="simple" <?php echo $select_s3_type == 'simple' ? 'SELECTED' : ''; ?> >Simple</option>
190
- <option value="extend" <?php echo $select_s3_type == 'extend' ? 'SELECTED' : ''; ?> >Extend</option>
 
 
 
 
 
 
 
 
191
  </select>
192
  </div>
193
  </div>
194
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
 
196
  <!-- img size -->
197
  <div class="row">
@@ -199,91 +429,139 @@ class HT_CTC_Admin_Customize_Styles {
199
  <p><?php _e( 'Image Size', 'click-to-chat-for-whatsapp' ); ?></p>
200
  </div>
201
  <div class="input-field col s6">
202
- <input name="ht_ctc_s3[s3_img_size]" value="<?php echo $s3_img_size ?>" id="s3_img_size" type="text" class="" >
203
- <label for="s3_img_size"><?php _e( 'Image Size (Default: 50px )', 'click-to-chat-for-whatsapp' ); ?></label>
204
  </div>
205
  </div>
206
 
207
- <!-- extend settings -->
208
- <div class="s3_type_extend" style="<?php echo $s3_extend_display ?>">
209
 
210
- <!-- padding -->
211
- <div class="row">
212
- <div class="col s6">
213
- <p><?php _e( 'Padding', 'click-to-chat-for-whatsapp' ); ?></p>
214
- </div>
215
- <div class="input-field col s6">
216
- <input name="ht_ctc_s3[s3_padding]" value="<?php echo $s3_padding ?>" id="s3_padding" type="text" class="" >
217
- <label for="s3_padding"><?php _e( 'Padding (Default: 20px )', 'click-to-chat-for-whatsapp' ); ?></label>
218
- </div>
219
  </div>
 
220
 
221
- <!-- background color -->
222
- <div class="row">
223
- <div class="col s6">
224
- <p><?php _e( 'Background Color', 'click-to-chat-for-whatsapp' ); ?></p>
225
- </div>
226
- <div class="input-field col s6">
227
- <input class="ht-ctc-color" name="ht_ctc_s3[s3_bg_color]" data-default-color="#25D366" value="<?php echo $s3_bg_color ?>" id="s3_bg_color" type="text">
228
- </div>
229
  </div>
 
230
 
231
- <!-- background color hover -->
232
- <div class="row">
233
- <div class="col s6">
234
- <p><?php _e( 'Background Color on Hover', 'click-to-chat-for-whatsapp' ); ?></p>
235
- </div>
236
- <div class="input-field col s6">
237
- <input class="ht-ctc-color" name="ht_ctc_s3[s3_bg_color_hover]" data-default-color="#25D366" value="<?php echo $s3_bg_color_hover ?>" id="s3_bg_color_hover" type="text">
238
- <p class="description"><?php _e( 'E.g. Colors: #25D366, #20b038', 'click-to-chat-for-whatsapp' ); ?> </p>
239
- </div>
240
  </div>
241
- <?php
 
 
 
 
 
242
 
243
- // shadow
244
- if ( isset( $options['s3_box_shadow'] ) ) {
 
 
 
 
 
 
 
 
 
245
  ?>
246
  <p>
247
  <label>
248
- <input name="ht_ctc_s3[s3_box_shadow]" type="checkbox" value="1" <?php checked( $options['s3_box_shadow'], 1 ); ?> id="s3_box_shadow" />
249
  <span><?php _e( 'Shadow', 'click-to-chat-for-whatsapp' ); ?></span>
250
  </label>
251
  </p>
252
  <?php
253
- } else {
254
- ?>
255
- <p>
256
- <label>
257
- <input name="ht_ctc_s3[s3_box_shadow]" type="checkbox" value="1" id="s3_box_shadow" />
258
- <span><?php _e( 'Shadow', 'click-to-chat-for-whatsapp' ); ?></span>
259
- </label>
260
- </p>
261
- <?php
262
- }
263
 
264
- // shadow on hover
265
- if ( isset( $options['s3_box_shadow_hover'] ) ) {
 
 
 
 
 
 
 
 
 
266
  ?>
267
  <p>
268
  <label>
269
- <input name="ht_ctc_s3[s3_box_shadow_hover]" type="checkbox" value="1" <?php checked( $options['s3_box_shadow_hover'], 1 ); ?> id="s3_box_shadow_hover" />
270
  <span><?php _e( 'Shadow on Hover', 'click-to-chat-for-whatsapp' ); ?></span>
271
  </label>
272
  </p>
273
  <?php
274
- } else {
275
- ?>
276
- <p>
277
- <label>
278
- <input name="ht_ctc_s3[s3_box_shadow_hover]" type="checkbox" value="1" id="s3_box_shadow_hover" />
279
- <span><?php _e( 'Shadow on Hover', 'click-to-chat-for-whatsapp' ); ?></span>
280
- </label>
281
- </p>
282
- <?php
283
- }
284
- ?>
285
 
 
286
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  </div>
288
 
289
  </div>
@@ -627,6 +905,9 @@ class HT_CTC_Admin_Customize_Styles {
627
  function ht_ctc_s7_cb() {
628
 
629
  $options = get_option('ht_ctc_s7');
 
 
 
630
  $s7_icon_size = ( isset( $options['s7_icon_size']) ) ? esc_attr( $options['s7_icon_size'] ) : '';
631
  $s7_icon_color = ( isset( $options['s7_icon_color']) ) ? esc_attr( $options['s7_icon_color'] ) : '';
632
  $s7_icon_color_hover = ( isset( $options['s7_icon_color_hover']) ) ? esc_attr( $options['s7_icon_color_hover'] ) : '';
@@ -634,6 +915,13 @@ class HT_CTC_Admin_Customize_Styles {
634
  $s7_border_color = ( isset( $options['s7_border_color']) ) ? esc_attr( $options['s7_border_color'] ) : '';
635
  $s7_border_color_hover = ( isset( $options['s7_border_color_hover']) ) ? esc_attr( $options['s7_border_color_hover'] ) : '';
636
  $s7_border_radius = ( isset( $options['s7_border_radius']) ) ? esc_attr( $options['s7_border_radius'] ) : '';
 
 
 
 
 
 
 
637
  ?>
638
  <ul class="collapsible" data-collapsible="accordion">
639
  <li>
@@ -667,7 +955,7 @@ class HT_CTC_Admin_Customize_Styles {
667
  <p><?php _e( 'Icon Color on Hover', 'click-to-chat-for-whatsapp' ); ?></p>
668
  </div>
669
  <div class="input-field col s6">
670
- <input id="s7_icon_color_hover" class="ht-ctc-color" data-default-color="#6b6b6b" name="ht_ctc_s7[s7_icon_color_hover]" value="<?php echo $s7_icon_color_hover ?>" type="text" style="height: 1.375rem;" >
671
  </div>
672
  </div>
673
 
@@ -717,6 +1005,43 @@ class HT_CTC_Admin_Customize_Styles {
717
  <br>
718
  <p class="description"><?php _e( 'To display icon only - clear background-color. (May need to change icon color to display in plain background)', 'click-to-chat-for-whatsapp' ); ?> </p>
719
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
720
  </div>
721
  </div>
722
  </li>
@@ -726,6 +1051,114 @@ class HT_CTC_Admin_Customize_Styles {
726
  }
727
 
728
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
729
 
730
 
731
  // style-8 - ht_ctc_s8 - button with icon
@@ -980,172 +1413,10 @@ class HT_CTC_Admin_Customize_Styles {
980
 
981
 
982
 
983
- // Other settings
984
- // fb analytics
985
- // detect device
986
- function ht_ctc_othersettings_cb() {
987
-
988
- $options = get_option('ht_ctc_othersettings');
989
- $dbrow = 'ht_ctc_othersettings';
990
- ?>
991
 
992
- <ul class="collapsible" data-collapsible="accordion" id="ht_ctc_othersettings">
993
- <li class="active">
994
- <div class="collapsible-header"><?php _e( 'Other settings', 'click-to-chat-for-whatsapp' ); ?></div>
995
- <div class="collapsible-body">
996
-
997
- <!-- not make empty table -->
998
- <input name="ht_ctc_othersettings[hello]" value="hello" id="" type="hidden" class="hide" >
999
-
1000
- <?php
1001
- // cache issue while selecting styles
1002
- if ( isset( $options['select_styles_issue'] ) ) {
1003
- ?>
1004
- <p id="styles_issue">
1005
- <label>
1006
- <input name="<?php echo $dbrow ?>[select_styles_issue]" type="checkbox" value="1" <?php checked( $options['select_styles_issue'], 1 ); ?> id="select_styles_issue" />
1007
- <!-- <span>Style for device is not as expected(due to cache)</span> -->
1008
- <span><?php _e( 'Check this only, If styles for mobile, desktop not selected as expected(due to cache)', 'click-to-chat-for-whatsapp' ); ?></span>
1009
- </label>
1010
- </p>
1011
- <?php
1012
- } else {
1013
- ?>
1014
- <p id="styles_issue">
1015
- <label>
1016
- <input name="<?php echo $dbrow ?>[select_styles_issue]" type="checkbox" value="1" id="select_styles_issue" />
1017
- <span><?php _e( 'Check this only, If styles for mobile, desktop not selected as expected(due to cache)', 'click-to-chat-for-whatsapp' ); ?></span>
1018
- </label>
1019
- </p>
1020
- <?php
1021
- }
1022
- ?>
1023
- <p class="description"> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/select-styles/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
1024
- <br>
1025
- <?php
1026
 
1027
- // enable group
1028
- if ( isset( $options['enable_group'] ) ) {
1029
- ?>
1030
- <p>
1031
- <label>
1032
- <input name="ht_ctc_othersettings[enable_group]" type="checkbox" value="1" <?php checked( $options['enable_group'], 1 ); ?> id="enable_group" />
1033
- <span><?php _e( 'Enable Group Features', 'click-to-chat-for-whatsapp' ); ?></span>
1034
- </label>
1035
- <p class="description"> - <a href="<?php echo admin_url( 'admin.php?page=click-to-chat-group-feature' ); ?>"><?php _e( 'Group Settings page', 'click-to-chat-for-whatsapp' ); ?></a> </p>
1036
- </p>
1037
- <?php
1038
- } else {
1039
- ?>
1040
- <p>
1041
- <label>
1042
- <input name="ht_ctc_othersettings[enable_group]" type="checkbox" value="1" id="enable_group" />
1043
- <span><?php _e( 'Enable Group Features', 'click-to-chat-for-whatsapp' ); ?></span>
1044
- </label>
1045
- </p>
1046
- <p class="description"> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/enable-group"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
1047
- <?php
1048
- }
1049
- ?>
1050
- <br>
1051
- <?php
1052
 
1053
 
1054
- // enable share
1055
- if ( isset( $options['enable_share'] ) ) {
1056
- ?>
1057
- <p>
1058
- <label>
1059
- <input name="ht_ctc_othersettings[enable_share]" type="checkbox" value="1" <?php checked( $options['enable_share'], 1 ); ?> id="enable_share" />
1060
- <span><?php _e( 'Enable Share Features', 'click-to-chat-for-whatsapp' ); ?></span>
1061
- </label>
1062
- <p class="description"> - <a href="<?php echo admin_url( 'admin.php?page=click-to-chat-share-feature' ); ?>"><?php _e( 'Share Settings page', 'click-to-chat-for-whatsapp' ); ?></a> </p>
1063
- </p>
1064
- <?php
1065
- } else {
1066
- ?>
1067
- <p>
1068
- <label>
1069
- <input name="ht_ctc_othersettings[enable_share]" type="checkbox" value="1" id="enable_share" />
1070
- <span><?php _e( 'Enable Share Features', 'click-to-chat-for-whatsapp' ); ?></span>
1071
- </label>
1072
- </p>
1073
- <p class="description"> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/enable-share"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
1074
- <?php
1075
- }
1076
- ?>
1077
- <br>
1078
-
1079
- <!-- chat -->
1080
- <p class="description"><?php _e( "Chat settings are enabled by default and can't disbale. If like to hide chat on all pages select", 'click-to-chat-for-whatsapp' ); ?> <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat#showhide_settings' ); ?>"><?php _e( 'show on selected pages', 'click-to-chat-for-whatsapp' ); ?></a> </p>
1081
- <p class="description"> - <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat' ); ?>"><?php _e( 'Chat Settings page', 'click-to-chat-for-whatsapp' ); ?></a> <br> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/enable-chat"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
1082
- </p>
1083
- <br>
1084
-
1085
- <?php
1086
- // Facebook Analytics
1087
- if ( isset( $options['fb_analytics'] ) ) {
1088
- ?>
1089
- <p>
1090
- <label>
1091
- <input name="ht_ctc_othersettings[fb_analytics]" type="checkbox" value="1" <?php checked( $options['fb_analytics'], 1 ); ?> id="fb_analytics" />
1092
- <span><?php _e( 'Facebook Analytics', 'click-to-chat-for-whatsapp' ); ?></span>
1093
- </label>
1094
- </p>
1095
- <?php
1096
- } else {
1097
- ?>
1098
- <p>
1099
- <label>
1100
- <input name="ht_ctc_othersettings[fb_analytics]" type="checkbox" value="1" id="fb_analytics" />
1101
- <span><?php _e( 'Facebook Analytics', 'click-to-chat-for-whatsapp' ); ?></span>
1102
- </label>
1103
- </p>
1104
- <?php
1105
- }
1106
- ?>
1107
- <p class="description"> <?php _e( 'This feature is', 'click-to-chat-for-whatsapp' ); ?> <b><?php _e( 'depreacted', 'click-to-chat-for-whatsapp' ); ?></b> <?php _e( 'in the favor of Facebook Pixel', 'click-to-chat-for-whatsapp' ); ?></p>
1108
- <p class="description"> <?php _e( 'If Facebook Analytics installed - creates an Event there', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/facebook-analytics/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
1109
- <br><br><br>
1110
-
1111
- <?php
1112
-
1113
- // delete options
1114
- if ( isset( $options['delete_options'] ) ) {
1115
- ?>
1116
- <p>
1117
- <label>
1118
- <input name="ht_ctc_othersettings[delete_options]" type="checkbox" value="1" <?php checked( $options['delete_options'], 1 ); ?> id="delete_options" />
1119
- <span><?php _e( 'Delete this plugin settings when uninstalls', 'click-to-chat-for-whatsapp' ); ?></span>
1120
- </label>
1121
- </p>
1122
- <?php
1123
- } else {
1124
- ?>
1125
- <p>
1126
- <label>
1127
- <input name="ht_ctc_othersettings[delete_options]" type="checkbox" value="1" id="delete_options" />
1128
- <span><?php _e( 'Delete this plugin settings when uninstalls', 'click-to-chat-for-whatsapp' ); ?></span>
1129
- </label>
1130
- </p>
1131
- <?php
1132
- }
1133
-
1134
- ?>
1135
-
1136
-
1137
-
1138
-
1139
- </div>
1140
- </li>
1141
- </ul>
1142
-
1143
- <?php
1144
- }
1145
-
1146
-
1147
-
1148
-
1149
 
1150
  /**
1151
  * Sanitize each setting field as needed
12
 
13
  class HT_CTC_Admin_Customize_Styles {
14
 
15
+ /**
16
+ * class name to use at add_settings_field
17
+ * sf_class - settings field class names
18
+ */
19
+ public $s1_class = '';
20
+ public $s2_class = '';
21
+ public $s3_class = '';
22
+ public $s3_1_class = '';
23
+ public $s4_class = '';
24
+ public $s5_class = '';
25
+ public $s6_class = '';
26
+ public $s7_class = '';
27
+ public $s7_1_class = '';
28
+ public $s8_class = '';
29
+ public $s99_class = '';
30
+ public $cs_class = '';
31
+
32
+ // public function __construct() {
33
+ // $this->this_variables();
34
+ // }
35
+
36
+ public function this_variables() {
37
+
38
+ $ht_ctc_othersettings = get_option('ht_ctc_othersettings');
39
+ $ht_ctc_chat = get_option('ht_ctc_chat_options');
40
+ $ht_ctc_cs = get_option('ht_ctc_cs_options');
41
+
42
+ // if group or share enable display on all.
43
+ if ( isset($ht_ctc_othersettings['enable_group']) || isset($ht_ctc_othersettings['enable_share']) ) {
44
+ $this->sf_class = "ht_ctc_display";
45
+ $this->cs_class .= 'ht_ctc_display_none';
46
+ } else {
47
+ // only chat enabled.
48
+
49
+ if ( !isset( $ht_ctc_cs['display_allstyles'] ) ) {
50
+
51
+ $style_d = $ht_ctc_chat['style_desktop'];
52
+ $style_m = $ht_ctc_chat['style_mobile'];
53
+
54
+ $this->s1_class .= ( '1' == $style_d || '1' == $style_m ) ? '' : 'ht_ctc_display_none';
55
+ $this->s2_class .= ( '2' == $style_d || '2' == $style_m ) ? '' : 'ht_ctc_display_none';
56
+ $this->s3_class .= ( '3' == $style_d || '3' == $style_m ) ? '' : 'ht_ctc_display_none';
57
+ $this->s3_1_class .= ( '3_1' == $style_d || '3_1' == $style_m ) ? '' : 'ht_ctc_display_none';
58
+ $this->s4_class .= ( '4' == $style_d || '4' == $style_m ) ? '' : 'ht_ctc_display_none';
59
+ $this->s5_class .= ( '5' == $style_d || '5' == $style_m ) ? '' : 'ht_ctc_display_none';
60
+ $this->s6_class .= ( '6' == $style_d || '6' == $style_m ) ? '' : 'ht_ctc_display_none';
61
+ $this->s7_class .= ( '7' == $style_d || '7' == $style_m ) ? '' : 'ht_ctc_display_none';
62
+ $this->s7_1_class .= ( '7_1' == $style_d || '7_1' == $style_m ) ? '' : 'ht_ctc_display_none';
63
+ $this->s8_class .= ( '8' == $style_d || '8' == $style_m ) ? '' : 'ht_ctc_display_none';
64
+ $this->s99_class .= ( '99' == $style_d || '99' == $style_m ) ? '' : 'ht_ctc_display_none';
65
+ }
66
+
67
+
68
+ }
69
+
70
+
71
+
72
+ }
73
+
74
  public function menu() {
75
 
76
+ $this->this_variables();
77
+
78
  add_submenu_page(
79
  'click-to-chat',
80
  'Customize',
122
  register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s1' , array( $this, 'options_sanitize' ) );
123
  register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s2' , array( $this, 'options_sanitize' ) );
124
  register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s3' , array( $this, 'options_sanitize' ) );
125
+ register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s3_1' , array( $this, 'options_sanitize' ) );
126
  register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s4' , array( $this, 'options_sanitize' ) );
127
  register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s5' , array( $this, 'options_sanitize' ) );
128
  register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s6' , array( $this, 'options_sanitize' ) );
129
  register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s7' , array( $this, 'options_sanitize' ) );
130
+ register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s7_1' , array( $this, 'options_sanitize' ) );
131
  register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s8' , array( $this, 'options_sanitize' ) );
132
  register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_s99' , array( $this, 'options_sanitize' ) );
133
+ register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_cs_options' , array( $this, 'options_sanitize' ) );
134
 
135
  add_settings_section( 'ht_ctc_cs_settings_sections_add', '', array( $this, 'main_settings_section_cb' ), 'ht_ctc_cs_page_settings_sections_do' );
136
 
137
+ add_settings_field( 'ht_ctc_s1', 'Style-1', array( $this, 'ht_ctc_s1_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add', array('class' => $this->s1_class ) );
138
+ add_settings_field( 'ht_ctc_s2', 'Style-2', array( $this, 'ht_ctc_s2_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add', array('class' => $this->s2_class ) );
139
+ add_settings_field( 'ht_ctc_s3', 'Style-3', array( $this, 'ht_ctc_s3_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add', array('class' => $this->s3_class ) );
140
+ add_settings_field( 'ht_ctc_s3_1', 'Style-3 Extend', array( $this, 'ht_ctc_s3_1_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add', array('class' => $this->s3_1_class ) );
141
+ add_settings_field( 'ht_ctc_s4', 'Style-4', array( $this, 'ht_ctc_s4_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add', array('class' => $this->s4_class ) );
142
+ add_settings_field( 'ht_ctc_s5', 'Style-5', array( $this, 'ht_ctc_s5_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add', array('class' => $this->s5_class ) );
143
+ add_settings_field( 'ht_ctc_s6', 'Style-6', array( $this, 'ht_ctc_s6_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add', array('class' => $this->s6_class ) );
144
+ add_settings_field( 'ht_ctc_s7', 'Style-7', array( $this, 'ht_ctc_s7_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add', array('class' => $this->s7_class ) );
145
+ add_settings_field( 'ht_ctc_s7_1', 'Style-7 Extend', array( $this, 'ht_ctc_s7_1_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add', array('class' => $this->s7_1_class ) );
146
+ add_settings_field( 'ht_ctc_s8', 'Style-8', array( $this, 'ht_ctc_s8_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add', array('class' => $this->s8_class ) );
147
+ add_settings_field( 'ht_ctc_s99', 'Style-99', array( $this, 'ht_ctc_s99_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add', array('class' => $this->s99_class ) );
148
+ add_settings_field( 'ht_ctc_cs', '', array( $this, 'ht_ctc_cs_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add', array('class' => $this->cs_class ) );
149
 
150
 
151
  }
153
  public function main_settings_section_cb() {
154
  ?>
155
  <h1>Customize</h1>
156
+ <!-- styles -->
157
+ <style id="ht-ctc-admin-cs">
158
+ .ht_ctc_display_none {
159
+ display: none;
160
+ }
161
+ </style>
162
+ <?php
163
+ }
164
+
165
+ // display all styles
166
+ public function ht_ctc_cs_cb() {
167
+
168
+ $options = get_option('ht_ctc_cs_options');
169
+ $dbrow = 'ht_ctc_cs_options';
170
+
171
+ ?>
172
+ <!-- not make empty table -->
173
+ <input name="<?php echo $dbrow ?>[hello]" value="world" id="" type="hidden" class="hide" >
174
+
175
  <?php
176
+ // Display all Styles
177
+ if ( isset( $options['display_allstyles'] ) ) {
178
+ ?>
179
+ <p>
180
+ <label>
181
+ <input name="<?php echo $dbrow ?>[display_allstyles]" type="checkbox" value="1" <?php checked( $options['display_allstyles'], 1 ); ?> id="display_allstyles" />
182
+ <span><?php _e( 'Display all Styles', 'click-to-chat-for-whatsapp' ); ?></span>
183
+ </label>
184
+ </p>
185
+ <?php
186
+ } else {
187
+ ?>
188
+ <p>
189
+ <label>
190
+ <input name="<?php echo $dbrow ?>[display_allstyles]" type="checkbox" value="1" id="display_allstyles" />
191
+ <span><?php _e( 'Display all Styles', 'click-to-chat-for-whatsapp' ); ?></span>
192
+ </label>
193
+ </p>
194
+ <?php
195
+ }
196
  }
197
 
198
 
225
  function ht_ctc_s2_cb() {
226
 
227
  $options = get_option('ht_ctc_s2');
228
+ $dbrow = 'ht_ctc_s2';
229
+ $style = "s2";
230
  $s2_img_size = ( isset( $options['s2_img_size']) ) ? esc_attr( $options['s2_img_size'] ) : '';
231
+
232
  ?>
233
  <ul class="collapsible" data-collapsible="accordion">
234
  <li>
242
  <p><?php _e( 'Image Size', 'click-to-chat-for-whatsapp' ); ?></p>
243
  </div>
244
  <div class="input-field col s6">
245
+ <input name="<?php echo $dbrow ?>[s2_img_size]" value="<?php echo $s2_img_size ?>" id="s2_img_size" type="text" class="" >
246
  <label for="s2_img_size"><?php _e( 'Image Size', 'click-to-chat-for-whatsapp' ); ?></label>
247
  </div>
248
  </div>
249
 
250
+ <?php
251
+ $select_cta_type = ( isset( $options['cta_type']) ) ? esc_attr( $options['cta_type'] ) : '';
252
+
253
+ $cta_textcolor = ( isset( $options['cta_textcolor']) ) ? esc_attr( $options['cta_textcolor'] ) : '';
254
+ $cta_bgcolor = ( isset( $options['cta_bgcolor']) ) ? esc_attr( $options['cta_bgcolor'] ) : '';
255
+
256
+ ?>
257
+
258
+ <h5 style="display: inline-block;">Call to Action </h5><span> (beta)</span>
259
+ <hr>
260
+ <!-- call to action - hover / show / hide -->
261
+ <div class="row">
262
+ <div class="col s6">
263
+ <p><?php _e( 'Display - Call to Action', 'click-to-chat-for-whatsapp' ); ?></p>
264
+ </div>
265
+ <div class="input-field col s6">
266
+ <select name="<?php echo $dbrow ?>[cta_type]" class="select_style_2_cta_type">
267
+ <option value="hover" <?php echo $select_cta_type == 'hover' ? 'SELECTED' : ''; ?> >On Hover</option>
268
+ <option value="show" <?php echo $select_cta_type == 'show' ? 'SELECTED' : ''; ?> >Show</option>
269
+ <option value="hide" <?php echo $select_cta_type == 'hide' ? 'SELECTED' : ''; ?> >Hide</option>
270
+ <?php
271
+ if ( 's7' == $style) {
272
+ ?>
273
+ <option value="inside" <?php echo $select_cta_type == 'inside' ? 'SELECTED' : ''; ?> >Inside padding</option>
274
+ <?php
275
+ }
276
+ ?>
277
+ </select>
278
+ </div>
279
+ </div>
280
+
281
+ <!-- call to action - Text color -->
282
+ <div class="row">
283
+ <div class="col s6">
284
+ <p><?php _e( 'Call to Action - Text Color', 'click-to-chat-for-whatsapp' ); ?></p>
285
+ </div>
286
+ <div class="input-field col s6">
287
+ <input class="ht-ctc-color" name="<?php echo $dbrow ?>[cta_textcolor]" data-default-color="#ffffff" value="<?php echo $cta_textcolor ?>" type="text">
288
+ </div>
289
+ </div>
290
+
291
+ <!-- call to action - background color -->
292
+ <div class="row">
293
+ <div class="col s6">
294
+ <p><?php _e( 'Call to Action - Background Color', 'click-to-chat-for-whatsapp' ); ?></p>
295
+ </div>
296
+ <div class="input-field col s6">
297
+ <input class="ht-ctc-color" name="<?php echo $dbrow ?>[cta_bgcolor]" data-default-color="#25D366" value="<?php echo $cta_bgcolor ?>" id="cta_bgcolor" type="text">
298
+ </div>
299
+ </div>
300
+
301
+
302
 
303
  </div>
304
  </div>
314
  function ht_ctc_s3_cb() {
315
 
316
  $options = get_option('ht_ctc_s3');
317
+ $dbrow = 'ht_ctc_s3';
318
+ $style = "s3";
319
 
320
  $select_s3_type = ( isset( $options['s3_type']) ) ? esc_attr( $options['s3_type'] ) : '1';
321
 
327
  $s3_bg_color = ( isset( $options['s3_bg_color']) ) ? esc_attr( $options['s3_bg_color'] ) : '';
328
  $s3_bg_color_hover = ( isset( $options['s3_bg_color_hover']) ) ? esc_attr( $options['s3_bg_color_hover'] ) : '';
329
 
330
+ $select_cta_type = ( isset( $options['cta_type']) ) ? esc_attr( $options['cta_type'] ) : '';
331
+ $cta_textcolor = ( isset( $options['cta_textcolor']) ) ? esc_attr( $options['cta_textcolor'] ) : '';
332
+ $cta_bgcolor = ( isset( $options['cta_bgcolor']) ) ? esc_attr( $options['cta_bgcolor'] ) : '';
 
 
 
 
333
  ?>
334
  <ul class="collapsible" data-collapsible="accordion">
335
  <li>
336
  <div class="collapsible-header"><?php _e( 'Style 3', 'click-to-chat-for-whatsapp' ); ?></div>
337
  <div class="collapsible-body">
338
 
339
+ <!-- img size -->
340
+ <div class="row">
341
+ <div class="col s6">
342
+ <p><?php _e( 'Image Size', 'click-to-chat-for-whatsapp' ); ?></p>
343
+ </div>
344
+ <div class="input-field col s6">
345
+ <input name="ht_ctc_s3[s3_img_size]" value="<?php echo $s3_img_size ?>" id="s3_img_size" type="text" class="" >
346
+ <label for="s3_img_size"><?php _e( 'Image Size (Default: 50px )', 'click-to-chat-for-whatsapp' ); ?></label>
347
+ </div>
348
+ </div>
349
+
350
+
351
+ <h5 style="display: inline-block;">Call to Action </h5><span> (beta)</span>
352
+ <!-- call to action - hover / show / hide -->
353
+ <hr>
354
  <div class="row">
355
  <div class="col s6">
356
+ <p><?php _e( 'Display - Call to Action', 'click-to-chat-for-whatsapp' ); ?></p>
357
  </div>
358
  <div class="input-field col s6">
359
+ <select name="<?php echo $dbrow ?>[cta_type]" class="select_style_3_cta_type">
360
+ <option value="hover" <?php echo $select_cta_type == 'hover' ? 'SELECTED' : ''; ?> >On Hover</option>
361
+ <option value="show" <?php echo $select_cta_type == 'show' ? 'SELECTED' : ''; ?> >Show</option>
362
+ <option value="hide" <?php echo $select_cta_type == 'hide' ? 'SELECTED' : ''; ?> >Hide</option>
363
+ <?php
364
+ if ( 's7' == $style) {
365
+ ?>
366
+ <option value="inside" <?php echo $select_cta_type == 'inside' ? 'SELECTED' : ''; ?> >Inside padding</option>
367
+ <?php
368
+ }
369
+ ?>
370
  </select>
371
  </div>
372
  </div>
373
 
374
+ <!-- call to action - Text color -->
375
+ <div class="row">
376
+ <div class="col s6">
377
+ <p><?php _e( 'Call to Action - Text Color', 'click-to-chat-for-whatsapp' ); ?></p>
378
+ </div>
379
+ <div class="input-field col s6">
380
+ <input class="ht-ctc-color" name="<?php echo $dbrow ?>[cta_textcolor]" data-default-color="#ffffff" value="<?php echo $cta_textcolor ?>" type="text">
381
+ </div>
382
+ </div>
383
+
384
+ <!-- call to action - background color -->
385
+ <div class="row">
386
+ <div class="col s6">
387
+ <p><?php _e( 'Call to Action - Background Color', 'click-to-chat-for-whatsapp' ); ?></p>
388
+ </div>
389
+ <div class="input-field col s6">
390
+ <input class="ht-ctc-color" name="<?php echo $dbrow ?>[cta_bgcolor]" data-default-color="#25D366" value="<?php echo $cta_bgcolor ?>" id="cta_bgcolor" type="text">
391
+ </div>
392
+ </div>
393
+
394
+ </div>
395
+ </div>
396
+ </li>
397
+ </ul>
398
+
399
+ <?php
400
+ }
401
+
402
+
403
+ // style-3_1 Extend - ht_ctc_s3_1 - full icon..
404
+ function ht_ctc_s3_1_cb() {
405
+
406
+ $options = get_option('ht_ctc_s3_1');
407
+ $dbrow = 'ht_ctc_s3_1';
408
+ $style = "s3";
409
+ $select_s3_type = ( isset( $options['s3_type']) ) ? esc_attr( $options['s3_type'] ) : '1';
410
+
411
+ $s3_img_size = ( isset( $options['s3_img_size']) ) ? esc_attr( $options['s3_img_size'] ) : '';
412
+
413
+ $s3_extend_img_size = ( isset( $options['s3_extend_img_size']) ) ? esc_attr( $options['s3_extend_img_size'] ) : '';
414
+ $s3_padding = ( isset( $options['s3_padding']) ) ? esc_attr( $options['s3_padding'] ) : '';
415
+
416
+ $s3_bg_color = ( isset( $options['s3_bg_color']) ) ? esc_attr( $options['s3_bg_color'] ) : '';
417
+ $s3_bg_color_hover = ( isset( $options['s3_bg_color_hover']) ) ? esc_attr( $options['s3_bg_color_hover'] ) : '';
418
+
419
+ ?>
420
+ <ul class="collapsible" data-collapsible="accordion">
421
+ <li>
422
+ <div class="collapsible-header"><?php _e( 'Style 3 Extend', 'click-to-chat-for-whatsapp' ); ?></div>
423
+ <div class="collapsible-body">
424
+
425
 
426
  <!-- img size -->
427
  <div class="row">
429
  <p><?php _e( 'Image Size', 'click-to-chat-for-whatsapp' ); ?></p>
430
  </div>
431
  <div class="input-field col s6">
432
+ <input name="ht_ctc_s3_1[s3_img_size]" value="<?php echo $s3_img_size ?>" id="s3_img_size" type="text" class="" >
433
+ <label for="s3_img_size"><?php _e( 'Image Size (Default: 40px )', 'click-to-chat-for-whatsapp' ); ?></label>
434
  </div>
435
  </div>
436
 
 
 
437
 
438
+ <!-- padding -->
439
+ <div class="row">
440
+ <div class="col s6">
441
+ <p><?php _e( 'Padding', 'click-to-chat-for-whatsapp' ); ?></p>
442
+ </div>
443
+ <div class="input-field col s6">
444
+ <input name="ht_ctc_s3_1[s3_padding]" value="<?php echo $s3_padding ?>" id="s3_padding" type="text" class="" >
445
+ <label for="s3_padding"><?php _e( 'Padding (Default: 20px )', 'click-to-chat-for-whatsapp' ); ?></label>
 
446
  </div>
447
+ </div>
448
 
449
+ <!-- background color -->
450
+ <div class="row">
451
+ <div class="col s6">
452
+ <p><?php _e( 'Background Color', 'click-to-chat-for-whatsapp' ); ?></p>
453
+ </div>
454
+ <div class="input-field col s6">
455
+ <input class="ht-ctc-color" name="ht_ctc_s3_1[s3_bg_color]" data-default-color="#25D366" value="<?php echo $s3_bg_color ?>" id="s3_bg_color" type="text">
 
456
  </div>
457
+ </div>
458
 
459
+ <!-- background color hover -->
460
+ <div class="row">
461
+ <div class="col s6">
462
+ <p><?php _e( 'Background Color on Hover', 'click-to-chat-for-whatsapp' ); ?></p>
 
 
 
 
 
463
  </div>
464
+ <div class="input-field col s6">
465
+ <input class="ht-ctc-color" name="ht_ctc_s3_1[s3_bg_color_hover]" data-default-color="#25D366" value="<?php echo $s3_bg_color_hover ?>" id="s3_bg_color_hover" type="text">
466
+ <p class="description"><?php _e( 'E.g. Colors: #25D366, #20b038', 'click-to-chat-for-whatsapp' ); ?> </p>
467
+ </div>
468
+ </div>
469
+ <?php
470
 
471
+ // shadow
472
+ if ( isset( $options['s3_box_shadow'] ) ) {
473
+ ?>
474
+ <p>
475
+ <label>
476
+ <input name="ht_ctc_s3_1[s3_box_shadow]" type="checkbox" value="1" <?php checked( $options['s3_box_shadow'], 1 ); ?> id="s3_box_shadow" />
477
+ <span><?php _e( 'Shadow', 'click-to-chat-for-whatsapp' ); ?></span>
478
+ </label>
479
+ </p>
480
+ <?php
481
+ } else {
482
  ?>
483
  <p>
484
  <label>
485
+ <input name="ht_ctc_s3_1[s3_box_shadow]" type="checkbox" value="1" id="s3_box_shadow" />
486
  <span><?php _e( 'Shadow', 'click-to-chat-for-whatsapp' ); ?></span>
487
  </label>
488
  </p>
489
  <?php
490
+ }
 
 
 
 
 
 
 
 
 
491
 
492
+ // shadow on hover
493
+ if ( isset( $options['s3_box_shadow_hover'] ) ) {
494
+ ?>
495
+ <p>
496
+ <label>
497
+ <input name="ht_ctc_s3_1[s3_box_shadow_hover]" type="checkbox" value="1" <?php checked( $options['s3_box_shadow_hover'], 1 ); ?> id="s3_box_shadow_hover" />
498
+ <span><?php _e( 'Shadow on Hover', 'click-to-chat-for-whatsapp' ); ?></span>
499
+ </label>
500
+ </p>
501
+ <?php
502
+ } else {
503
  ?>
504
  <p>
505
  <label>
506
+ <input name="ht_ctc_s3_1[s3_box_shadow_hover]" type="checkbox" value="1" id="s3_box_shadow_hover" />
507
  <span><?php _e( 'Shadow on Hover', 'click-to-chat-for-whatsapp' ); ?></span>
508
  </label>
509
  </p>
510
  <?php
511
+ }
512
+ ?>
 
 
 
 
 
 
 
 
 
513
 
514
+ <br><br>
515
 
516
+ <?php
517
+ $select_cta_type = ( isset( $options['cta_type']) ) ? esc_attr( $options['cta_type'] ) : '';
518
+
519
+ $cta_textcolor = ( isset( $options['cta_textcolor']) ) ? esc_attr( $options['cta_textcolor'] ) : '';
520
+ $cta_bgcolor = ( isset( $options['cta_bgcolor']) ) ? esc_attr( $options['cta_bgcolor'] ) : '';
521
+
522
+ ?>
523
+
524
+ <h5 style="display: inline-block;">Call to Action </h5><span> (beta)</span>
525
+ <hr>
526
+ <!-- call to action - hover / show / hide -->
527
+ <div class="row">
528
+ <div class="col s6">
529
+ <p><?php _e( 'Display - Call to Action', 'click-to-chat-for-whatsapp' ); ?></p>
530
+ </div>
531
+ <div class="input-field col s6">
532
+ <select name="<?php echo $dbrow ?>[cta_type]" class="select_style_3_cta_type">
533
+ <option value="hover" <?php echo $select_cta_type == 'hover' ? 'SELECTED' : ''; ?> >On Hover</option>
534
+ <option value="show" <?php echo $select_cta_type == 'show' ? 'SELECTED' : ''; ?> >Show</option>
535
+ <option value="hide" <?php echo $select_cta_type == 'hide' ? 'SELECTED' : ''; ?> >Hide</option>
536
+ <?php
537
+ if ( 's7' == $style) {
538
+ ?>
539
+ <option value="inside" <?php echo $select_cta_type == 'inside' ? 'SELECTED' : ''; ?> >Inside padding</option>
540
+ <?php
541
+ }
542
+ ?>
543
+ </select>
544
+ </div>
545
+ </div>
546
+
547
+ <!-- call to action - Text color -->
548
+ <div class="row">
549
+ <div class="col s6">
550
+ <p><?php _e( 'Call to Action - Text Color', 'click-to-chat-for-whatsapp' ); ?></p>
551
+ </div>
552
+ <div class="input-field col s6">
553
+ <input class="ht-ctc-color" name="<?php echo $dbrow ?>[cta_textcolor]" data-default-color="#ffffff" value="<?php echo $cta_textcolor ?>" type="text">
554
+ </div>
555
+ </div>
556
+
557
+ <!-- call to action - background color -->
558
+ <div class="row">
559
+ <div class="col s6">
560
+ <p><?php _e( 'Call to Action - Background Color', 'click-to-chat-for-whatsapp' ); ?></p>
561
+ </div>
562
+ <div class="input-field col s6">
563
+ <input class="ht-ctc-color" name="<?php echo $dbrow ?>[cta_bgcolor]" data-default-color="#25D366" value="<?php echo $cta_bgcolor ?>" id="cta_bgcolor" type="text">
564
+ </div>
565
  </div>
566
 
567
  </div>
905
  function ht_ctc_s7_cb() {
906
 
907
  $options = get_option('ht_ctc_s7');
908
+ $dbrow = 'ht_ctc_s7';
909
+ $style = "s7";
910
+
911
  $s7_icon_size = ( isset( $options['s7_icon_size']) ) ? esc_attr( $options['s7_icon_size'] ) : '';
912
  $s7_icon_color = ( isset( $options['s7_icon_color']) ) ? esc_attr( $options['s7_icon_color'] ) : '';
913
  $s7_icon_color_hover = ( isset( $options['s7_icon_color_hover']) ) ? esc_attr( $options['s7_icon_color_hover'] ) : '';
915
  $s7_border_color = ( isset( $options['s7_border_color']) ) ? esc_attr( $options['s7_border_color'] ) : '';
916
  $s7_border_color_hover = ( isset( $options['s7_border_color_hover']) ) ? esc_attr( $options['s7_border_color_hover'] ) : '';
917
  $s7_border_radius = ( isset( $options['s7_border_radius']) ) ? esc_attr( $options['s7_border_radius'] ) : '';
918
+
919
+ $select_cta_type = ( isset( $options['cta_type']) ) ? esc_attr( $options['cta_type'] ) : '';
920
+
921
+ $cta_textcolor = ( isset( $options['cta_textcolor']) ) ? esc_attr( $options['cta_textcolor'] ) : '';
922
+ $cta_textcolor_hover = ( isset( $options['cta_textcolor_hover']) ) ? esc_attr( $options['cta_textcolor_hover'] ) : '';
923
+ $cta_bgcolor = ( isset( $options['cta_bgcolor']) ) ? esc_attr( $options['cta_bgcolor'] ) : '';
924
+ $cta_bgcolor_hover = ( isset( $options['cta_bgcolor_hover']) ) ? esc_attr( $options['cta_bgcolor_hover'] ) : '';
925
  ?>
926
  <ul class="collapsible" data-collapsible="accordion">
927
  <li>
955
  <p><?php _e( 'Icon Color on Hover', 'click-to-chat-for-whatsapp' ); ?></p>
956
  </div>
957
  <div class="input-field col s6">
958
+ <input id="s7_icon_color_hover" class="ht-ctc-color" data-default-color="#fffff" name="ht_ctc_s7[s7_icon_color_hover]" value="<?php echo $s7_icon_color_hover ?>" type="text" style="height: 1.375rem;" >
959
  </div>
960
  </div>
961
 
1005
  <br>
1006
  <p class="description"><?php _e( 'To display icon only - clear background-color. (May need to change icon color to display in plain background)', 'click-to-chat-for-whatsapp' ); ?> </p>
1007
 
1008
+ <br><br>
1009
+
1010
+ <h5 style="display: inline-block;">Call to Action </h5><span> (beta)</span>
1011
+ <hr>
1012
+ <!-- call to action - hover / show / hide -->
1013
+ <div class="row">
1014
+ <div class="col s6">
1015
+ <p><?php _e( 'Display - Call to Action', 'click-to-chat-for-whatsapp' ); ?></p>
1016
+ </div>
1017
+ <div class="input-field col s6">
1018
+ <select name="<?php echo $dbrow ?>[cta_type]" class="select_s7_cta_type">
1019
+ <option value="hover" <?php echo $select_cta_type == 'hover' ? 'SELECTED' : ''; ?> >On Hover</option>
1020
+ <option value="show" <?php echo $select_cta_type == 'show' ? 'SELECTED' : ''; ?> >Show</option>
1021
+ <option value="hide" <?php echo $select_cta_type == 'hide' ? 'SELECTED' : ''; ?> >Hide</option>
1022
+ </select>
1023
+ </div>
1024
+ </div>
1025
+ <!-- call to action - Text color -->
1026
+ <div class="row">
1027
+ <div class="col s6">
1028
+ <p><?php _e( 'Text Color', 'click-to-chat-for-whatsapp' ); ?></p>
1029
+ </div>
1030
+ <div class="input-field col s6">
1031
+ <input class="ht-ctc-color" name="<?php echo $dbrow ?>[cta_textcolor]" data-default-color="#ffffff" value="<?php echo $cta_textcolor ?>" type="text">
1032
+ </div>
1033
+ </div>
1034
+
1035
+ <!-- call to action - background color -->
1036
+ <div class="row">
1037
+ <div class="col s6">
1038
+ <p><?php _e( 'Background Color', 'click-to-chat-for-whatsapp' ); ?></p>
1039
+ </div>
1040
+ <div class="input-field col s6">
1041
+ <input class="ht-ctc-color" name="<?php echo $dbrow ?>[cta_bgcolor]" data-default-color="#25d366" value="<?php echo $cta_bgcolor ?>" id="cta_bgcolor" type="text">
1042
+ </div>
1043
+ </div>
1044
+
1045
  </div>
1046
  </div>
1047
  </li>
1051
  }
1052
 
1053
 
1054
+ // style-7_1 Extend - ht_ctc_s7_1
1055
+ function ht_ctc_s7_1_cb() {
1056
+
1057
+ $options = get_option('ht_ctc_s7_1');
1058
+ $dbrow = 'ht_ctc_s7_1';
1059
+ $style = "s7";
1060
+
1061
+ $s7_icon_size = ( isset( $options['s7_icon_size']) ) ? esc_attr( $options['s7_icon_size'] ) : '';
1062
+ $s7_icon_color = ( isset( $options['s7_icon_color']) ) ? esc_attr( $options['s7_icon_color'] ) : '';
1063
+ $s7_icon_color_hover = ( isset( $options['s7_icon_color_hover']) ) ? esc_attr( $options['s7_icon_color_hover'] ) : '';
1064
+ $s7_border_size = ( isset( $options['s7_border_size']) ) ? esc_attr( $options['s7_border_size'] ) : '';
1065
+ $s7_bgcolor = ( isset( $options['s7_bgcolor']) ) ? esc_attr( $options['s7_bgcolor'] ) : '';
1066
+ $s7_bgcolor_hover = ( isset( $options['s7_bgcolor_hover']) ) ? esc_attr( $options['s7_bgcolor_hover'] ) : '';
1067
+
1068
+ $select_cta_type = ( isset( $options['cta_type']) ) ? esc_attr( $options['cta_type'] ) : '';
1069
+
1070
+ ?>
1071
+ <ul class="collapsible" data-collapsible="accordion">
1072
+ <li>
1073
+ <div class="collapsible-header"><?php _e( 'Style 7 Extend', 'click-to-chat-for-whatsapp' ); ?></div>
1074
+ <div class="collapsible-body">
1075
+
1076
+ <!-- call to action - hover / show -->
1077
+ <div class="row">
1078
+ <div class="col s6">
1079
+ <p><?php _e( 'Display - Call to Action', 'click-to-chat-for-whatsapp' ); ?></p>
1080
+ </div>
1081
+ <div class="input-field col s6">
1082
+ <select name="<?php echo $dbrow ?>[cta_type]" class="select_s7_cta_type">
1083
+ <option value="hover" <?php echo $select_cta_type == 'hover' ? 'SELECTED' : ''; ?> >On Hover</option>
1084
+ <option value="show" <?php echo $select_cta_type == 'show' ? 'SELECTED' : ''; ?> >Show</option>
1085
+ </select>
1086
+ </div>
1087
+ </div>
1088
+
1089
+
1090
+ <!-- s7_icon_size -->
1091
+ <div class="row">
1092
+ <div class="col s6">
1093
+ <p><?php _e( 'Icon Size', 'click-to-chat-for-whatsapp' ); ?></p>
1094
+ </div>
1095
+ <div class="input-field col s6">
1096
+ <input name="<?php echo $dbrow ?>[s7_icon_size]" value="<?php echo $s7_icon_size ?>" id="s7_icon_size" type="text" class="" >
1097
+ <label for="s7_icon_size"><?php _e( 'Icon Size', 'click-to-chat-for-whatsapp' ); ?></label>
1098
+ </div>
1099
+ </div>
1100
+
1101
+ <!-- s7_border_size icon padding size -->
1102
+ <div class="row">
1103
+ <div class="col s6">
1104
+ <p><?php _e( 'Icon Border Padding Size', 'click-to-chat-for-whatsapp' ); ?></p>
1105
+ </div>
1106
+ <div class="input-field col s6">
1107
+ <input name="<?php echo $dbrow ?>[s7_border_size]" value="<?php echo $s7_border_size ?>" id="s7_border_size" type="text" class="" >
1108
+ <label for="s7_border_size"><?php _e( 'Border Padding Size', 'click-to-chat-for-whatsapp' ); ?></label>
1109
+ <p class="description"><?php _e( 'E.g. 12px', 'click-to-chat-for-whatsapp' ); ?></p>
1110
+ </div>
1111
+ </div>
1112
+
1113
+ <!-- s7_icon_color -->
1114
+ <div class="row">
1115
+ <div class="col s6">
1116
+ <p><?php _e( 'Icon,Text Color', 'click-to-chat-for-whatsapp' ); ?></p>
1117
+ </div>
1118
+ <div class="input-field col s6">
1119
+ <input id="s7_icon_color" class="ht-ctc-color" data-default-color="#ffffff" name="<?php echo $dbrow ?>[s7_icon_color]" value="<?php echo $s7_icon_color ?>" type="text" style="height: 1.375rem;" >
1120
+ </div>
1121
+ </div>
1122
+
1123
+ <!-- s7_icon_color_hover -->
1124
+ <div class="row">
1125
+ <div class="col s6">
1126
+ <p><?php _e( 'Icon,Text Color on Hover', 'click-to-chat-for-whatsapp' ); ?></p>
1127
+ </div>
1128
+ <div class="input-field col s6">
1129
+ <input id="s7_icon_color_hover" class="ht-ctc-color" data-default-color="#f4f4f4" name="<?php echo $dbrow ?>[s7_icon_color_hover]" value="<?php echo $s7_icon_color_hover ?>" type="text" style="height: 1.375rem;" >
1130
+ </div>
1131
+ </div>
1132
+
1133
+ <!-- s7_bgcolor -->
1134
+ <div class="row">
1135
+ <div class="col s6">
1136
+ <p><?php _e( 'Background Color', 'click-to-chat-for-whatsapp' ); ?></p>
1137
+ </div>
1138
+ <div class="input-field col s6">
1139
+ <input id="s7_bgcolor" class="ht-ctc-color" data-default-color="#25d366" name="<?php echo $dbrow ?>[s7_bgcolor]" value="<?php echo $s7_bgcolor ?>" type="text" style="height: 1.375rem;" >
1140
+ </div>
1141
+ </div>
1142
+
1143
+ <!-- s7_bgcolor_hover -->
1144
+ <div class="row">
1145
+ <div class="col s6">
1146
+ <p><?php _e( 'Background Color on Hover', 'click-to-chat-for-whatsapp' ); ?></p>
1147
+ </div>
1148
+ <div class="input-field col s6">
1149
+ <input id="s7_bgcolor_hover" class="ht-ctc-color" data-default-color="#25d366" name="<?php echo $dbrow ?>[s7_bgcolor_hover]" value="<?php echo $s7_bgcolor_hover ?>" type="text" style="height: 1.375rem;" >
1150
+ </div>
1151
+ </div>
1152
+
1153
+
1154
+ </div>
1155
+ </div>
1156
+ </li>
1157
+ </ul>
1158
+
1159
+ <?php
1160
+ }
1161
+
1162
 
1163
 
1164
  // style-8 - ht_ctc_s8 - button with icon
1413
 
1414
 
1415
 
 
 
 
 
 
 
 
 
1416
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1417
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1418
 
1419
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1420
 
1421
  /**
1422
  * Sanitize each setting field as needed
new/admin/class-ht-ctc-admin-group-page.php CHANGED
@@ -208,4 +208,4 @@ $ht_ctc_admin_group_page = new HT_CTC_Admin_Group_Page();
208
  add_action('admin_menu', array($ht_ctc_admin_group_page, 'menu') );
209
  add_action('admin_init', array($ht_ctc_admin_group_page, 'settings') );
210
 
211
- endif; // END class_exists check
208
  add_action('admin_menu', array($ht_ctc_admin_group_page, 'menu') );
209
  add_action('admin_init', array($ht_ctc_admin_group_page, 'settings') );
210
 
211
+ endif; // END class_exists check
new/admin/class-ht-ctc-admin-main-page.php CHANGED
@@ -98,20 +98,15 @@ class HT_CTC_Admin_Main_Page {
98
  if ( class_exists( 'WooCommerce' ) ) {
99
  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' );
100
  }
101
- add_settings_field( 'chat_shortcode', '', array( $this, 'chat_shortcode_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
102
 
103
 
104
- // main settings - global options - analytics ..
105
- register_setting( 'ht_ctc_main_page_settings_fields', 'ht_ctc_main_options' , array( $this, 'options_sanitize' ) );
106
- add_settings_section( 'ht_ctc_main_page_settings_sections_add', '', array( $this, 'main_settings_section_cb' ), 'ht_ctc_main_page_settings_sections_do' );
107
-
108
- add_settings_field( 'ctc_enable_features', 'Enable Features', array( $this, 'ctc_enable_features_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
109
-
110
  // switch options
111
  $ccw_options = get_option('ccw_options');
112
  if ( isset( $ccw_options['number'] ) ) {
113
  // display this setting page only if user switched from previous interface.. ( for new users no switch option )
114
  register_setting( 'ht_ctc_main_page_settings_fields', 'ht_ctc_switch' , array( $this, 'options_sanitize' ) );
 
115
  add_settings_field( 'ht_ctc_switch', '', array( $this, 'ht_ctc_switch_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
116
  }
117
 
@@ -178,7 +173,6 @@ class HT_CTC_Admin_Main_Page {
178
  <input name="ht_ctc_chat_options[call_to_action]" value="<?php echo $value ?>" id="call_to_action" type="text" class="input-margin">
179
  <label for="call_to_action"><?php _e( 'Call to Action', 'click-to-chat-for-whatsapp' ); ?></label>
180
  <p class="description"><?php _e( 'Text that appears along with WhatsApp icon/button', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/call-to-action/">more info</a> </p>
181
- <p class="description"><?php _e( 'Style 1, 4, 6, 8 displays by default, Style 2, 5, 7 displays only on hover. Style-99 its your own image', 'click-to-chat-for-whatsapp' ); ?></p>
182
  </div>
183
  </div>
184
  <?php
@@ -246,8 +240,10 @@ class HT_CTC_Admin_Main_Page {
246
 
247
 
248
 
249
- function chat_shortcode_cb() {
250
  ?>
 
 
251
  <p class="description card-panel" style="padding: 18px;"> <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/shortcodes-chat">Shortcodes for Chat: </a>[ht-ctc-chat]</p>
252
  <?php
253
  }
@@ -260,7 +256,7 @@ class HT_CTC_Admin_Main_Page {
260
  * Enable featues ..
261
  *
262
  */
263
- public function main_settings_section_cb() {
264
  ?>
265
  <h1><?php _e( 'Enable features', 'click-to-chat-for-whatsapp' ); ?></h1>
266
  <?php
@@ -268,91 +264,6 @@ class HT_CTC_Admin_Main_Page {
268
 
269
 
270
 
271
-
272
- // Enable Features
273
- function ctc_enable_features_cb() {
274
-
275
- $options = get_option('ht_ctc_main_options');
276
-
277
- ?>
278
-
279
- <ul class="collapsible">
280
- <li>
281
- <div class="collapsible-header"><?php _e( 'Enable features', 'click-to-chat-for-whatsapp' ); ?></div>
282
- <div class="collapsible-body">
283
-
284
- <!-- not make empty table -->
285
- <input name="ht_ctc_main_options[hello]" value="hello" id="" type="text" class="hide" >
286
-
287
- <?php
288
-
289
- do_action('ht_ctc_ah_admin_main_before_enable');
290
-
291
- // Google Analytics
292
- if ( isset( $options['google_analytics'] ) ) {
293
- ?>
294
- <p>
295
- <label>
296
- <input name="ht_ctc_main_options[google_analytics]" type="checkbox" value="1" <?php checked( $options['google_analytics'], 1 ); ?> id="google_analytics" />
297
- <span><?php _e( 'Google Analytics', 'click-to-chat-for-whatsapp' ); ?></span>
298
- </label>
299
- </p>
300
- <?php
301
- } else {
302
- ?>
303
- <p>
304
- <label>
305
- <input name="ht_ctc_main_options[google_analytics]" type="checkbox" value="1" id="google_analytics" />
306
- <span><?php _e( 'Google Analytics', 'click-to-chat-for-whatsapp' ); ?></span>
307
- </label>
308
- </p>
309
- <?php
310
- }
311
- ?>
312
- <p class="description"><?php _e( 'If Google Analytics installed creates an Event there', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/google-analytics/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
313
- <br>
314
-
315
-
316
- <?php
317
-
318
- // Facebook Pixel
319
- if ( isset( $options['fb_pixel'] ) ) {
320
- ?>
321
- <p>
322
- <label>
323
- <input name="ht_ctc_main_options[fb_pixel]" type="checkbox" value="1" <?php checked( $options['fb_pixel'], 1 ); ?> id="fb_pixel" />
324
- <span><?php _e( 'Facebook Pixel', 'click-to-chat-for-whatsapp' ); ?></span>
325
- </label>
326
- </p>
327
- <?php
328
- } else {
329
- ?>
330
- <p>
331
- <label>
332
- <input name="ht_ctc_main_options[fb_pixel]" type="checkbox" value="1" id="fb_pixel" />
333
- <span><?php _e( 'Facebook Pixel', 'click-to-chat-for-whatsapp' ); ?></span>
334
- </label>
335
- </p>
336
- <?php
337
- }
338
- ?>
339
- <p class="description"><?php _e( 'If Facebook Pixel installed creates an Event there', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/facebook-pixel/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
340
- <br>
341
-
342
- <?php
343
- do_action('ht_ctc_ah_admin_main_after_enable');
344
- ?>
345
-
346
- </div>
347
- </div>
348
- </li>
349
- <ul>
350
-
351
- <?php
352
- }
353
-
354
-
355
-
356
  // switch interface
357
  function ht_ctc_switch_cb() {
358
  $options = get_option('ht_ctc_switch');
@@ -441,4 +352,4 @@ $ht_ctc_admin_main_page = new HT_CTC_Admin_Main_Page();
441
  add_action('admin_menu', array($ht_ctc_admin_main_page, 'menu') );
442
  add_action('admin_init', array($ht_ctc_admin_main_page, 'settings') );
443
 
444
- endif; // END class_exists check
98
  if ( class_exists( 'WooCommerce' ) ) {
99
  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' );
100
  }
101
+ add_settings_field( 'ctc_notes', '', array( $this, 'ctc_notes_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
102
 
103
 
 
 
 
 
 
 
104
  // switch options
105
  $ccw_options = get_option('ccw_options');
106
  if ( isset( $ccw_options['number'] ) ) {
107
  // display this setting page only if user switched from previous interface.. ( for new users no switch option )
108
  register_setting( 'ht_ctc_main_page_settings_fields', 'ht_ctc_switch' , array( $this, 'options_sanitize' ) );
109
+ add_settings_section( 'ht_ctc_main_page_settings_sections_add', '', '', 'ht_ctc_main_page_settings_sections_do' );
110
  add_settings_field( 'ht_ctc_switch', '', array( $this, 'ht_ctc_switch_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
111
  }
112
 
173
  <input name="ht_ctc_chat_options[call_to_action]" value="<?php echo $value ?>" id="call_to_action" type="text" class="input-margin">
174
  <label for="call_to_action"><?php _e( 'Call to Action', 'click-to-chat-for-whatsapp' ); ?></label>
175
  <p class="description"><?php _e( 'Text that appears along with WhatsApp icon/button', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/call-to-action/">more info</a> </p>
 
176
  </div>
177
  </div>
178
  <?php
240
 
241
 
242
 
243
+ function ctc_notes_cb() {
244
  ?>
245
+ <p class="description card-panel" style="padding: 18px;"> <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">Customize Styles</a></p>
246
+ <p class="description card-panel" style="padding: 18px;"> <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat-other-settings' ); ?>">Other Settings</a></p>
247
  <p class="description card-panel" style="padding: 18px;"> <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/shortcodes-chat">Shortcodes for Chat: </a>[ht-ctc-chat]</p>
248
  <?php
249
  }
256
  * Enable featues ..
257
  *
258
  */
259
+ public function switch_interface_cb() {
260
  ?>
261
  <h1><?php _e( 'Enable features', 'click-to-chat-for-whatsapp' ); ?></h1>
262
  <?php
264
 
265
 
266
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
267
  // switch interface
268
  function ht_ctc_switch_cb() {
269
  $options = get_option('ht_ctc_switch');
352
  add_action('admin_menu', array($ht_ctc_admin_main_page, 'menu') );
353
  add_action('admin_init', array($ht_ctc_admin_main_page, 'settings') );
354
 
355
+ endif; // END class_exists check
new/admin/class-ht-ctc-admin-other-settings.php ADDED
@@ -0,0 +1,436 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Other settings page - admin
4
+ *
5
+ * this main settings page contains ..
6
+ *
7
+ * Analytics, ..
8
+ *
9
+ * @package ctc
10
+ * @subpackage admin
11
+ * @since 3.0
12
+ */
13
+
14
+ if ( ! defined( 'ABSPATH' ) ) exit;
15
+
16
+ if ( ! class_exists( 'HT_CTC_Admin_Other_Settings' ) ) :
17
+
18
+ class HT_CTC_Admin_Other_Settings {
19
+
20
+ public function menu() {
21
+
22
+ add_submenu_page(
23
+ 'click-to-chat',
24
+ 'Other-Settings',
25
+ 'Other Settings',
26
+ 'manage_options',
27
+ 'click-to-chat-other-settings',
28
+ array( $this, 'settings_page' )
29
+ );
30
+ }
31
+
32
+ public function settings_page() {
33
+
34
+ if ( ! current_user_can('manage_options') ) {
35
+ return;
36
+ }
37
+
38
+ ?>
39
+
40
+ <div class="wrap">
41
+
42
+ <?php settings_errors(); ?>
43
+
44
+ <div class="row">
45
+ <div class="col s12 m12 xl8 options">
46
+ <form action="options.php" method="post" class="">
47
+ <?php settings_fields( 'ht_ctc_os_page_settings_fields' ); ?>
48
+ <?php do_settings_sections( 'ht_ctc_os_page_settings_sections_do' ) ?>
49
+ <?php submit_button() ?>
50
+ </form>
51
+ </div>
52
+ <!-- <div class="col s12 m12 xl6 ht-cc-admin-sidebar">
53
+ </div> -->
54
+ </div>
55
+
56
+ </div>
57
+
58
+ <?php
59
+
60
+ }
61
+
62
+ public function settings() {
63
+
64
+ register_setting( 'ht_ctc_os_page_settings_fields', 'ht_ctc_othersettings' , array( $this, 'options_sanitize' ) );
65
+
66
+ add_settings_section( 'ht_ctc_os_settings_sections_add', '', array( $this, 'main_settings_section_cb' ), 'ht_ctc_os_page_settings_sections_do' );
67
+
68
+ add_settings_field( 'ht_ctc_analytics', 'Analytics', array( $this, 'ht_ctc_analytics_cb' ), 'ht_ctc_os_page_settings_sections_do', 'ht_ctc_os_settings_sections_add' );
69
+ add_settings_field( 'ht_ctc_animations', 'Animations', array( $this, 'ht_ctc_animations_cb' ), 'ht_ctc_os_page_settings_sections_do', 'ht_ctc_os_settings_sections_add' );
70
+ add_settings_field( 'ht_ctc_othersettings', 'Other Settings', array( $this, 'ht_ctc_othersettings_cb' ), 'ht_ctc_os_page_settings_sections_do', 'ht_ctc_os_settings_sections_add' );
71
+
72
+ }
73
+
74
+ public function main_settings_section_cb() {
75
+ ?>
76
+ <h1>Other Settings</h1>
77
+ <?php
78
+ }
79
+
80
+ function ht_ctc_analytics_cb() {
81
+
82
+ $options = get_option('ht_ctc_othersettings');
83
+ $dbrow = 'ht_ctc_othersettings';
84
+
85
+ ?>
86
+ <ul class="collapsible" data-collapsible="accordion" id="ht_ctc_analytics">
87
+ <li class="active">
88
+ <div class="collapsible-header"><?php _e( 'Analytics', 'click-to-chat-for-whatsapp' ); ?></div>
89
+ <div class="collapsible-body">
90
+
91
+ <?php
92
+
93
+ // Google Analytics
94
+ if ( isset( $options['google_analytics'] ) ) {
95
+ ?>
96
+ <p>
97
+ <label>
98
+ <input name="<?php echo $dbrow ?>[google_analytics]" type="checkbox" value="1" <?php checked( $options['google_analytics'], 1 ); ?> id="google_analytics" />
99
+ <span><?php _e( 'Google Analytics', 'click-to-chat-for-whatsapp' ); ?></span>
100
+ </label>
101
+ </p>
102
+ <?php
103
+ } else {
104
+ ?>
105
+ <p>
106
+ <label>
107
+ <input name="<?php echo $dbrow ?>[google_analytics]" type="checkbox" value="1" id="google_analytics" />
108
+ <span><?php _e( 'Google Analytics', 'click-to-chat-for-whatsapp' ); ?></span>
109
+ </label>
110
+ </p>
111
+ <?php
112
+ }
113
+ ?>
114
+ <p class="description"><?php _e( 'If Google Analytics installed creates an Event there', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/google-analytics/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
115
+ <br>
116
+
117
+
118
+ <?php
119
+
120
+ // Facebook Pixel
121
+ if ( isset( $options['fb_pixel'] ) ) {
122
+ ?>
123
+ <p>
124
+ <label>
125
+ <input name="<?php echo $dbrow ?>[fb_pixel]" type="checkbox" value="1" <?php checked( $options['fb_pixel'], 1 ); ?> id="fb_pixel" />
126
+ <span><?php _e( 'Facebook Pixel', 'click-to-chat-for-whatsapp' ); ?></span>
127
+ </label>
128
+ </p>
129
+ <?php
130
+ } else {
131
+ ?>
132
+ <p>
133
+ <label>
134
+ <input name="<?php echo $dbrow ?>[fb_pixel]" type="checkbox" value="1" id="fb_pixel" />
135
+ <span><?php _e( 'Facebook Pixel', 'click-to-chat-for-whatsapp' ); ?></span>
136
+ </label>
137
+ </p>
138
+ <?php
139
+ }
140
+ ?>
141
+ <p class="description"><?php _e( 'If Facebook Pixel installed creates an Event there', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/facebook-pixel/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
142
+ <br>
143
+
144
+
145
+ </div>
146
+ </li>
147
+ </ul>
148
+ <?php
149
+ }
150
+
151
+ function ht_ctc_animations_cb() {
152
+ $options = get_option('ht_ctc_othersettings');
153
+ $dbrow = 'ht_ctc_othersettings';
154
+
155
+ $show_effect = ( isset( $options['show_effect']) ) ? esc_attr( $options['show_effect'] ) : 'no-show-effects';
156
+ $show_effect_list = array(
157
+ 'no-show-effects',
158
+ 'From Center',
159
+ 'From Corner',
160
+ );
161
+
162
+ $an_type = ( isset( $options['an_type']) ) ? esc_attr( $options['an_type'] ) : '';
163
+
164
+ $an_list = array(
165
+ 'no-animation',
166
+ 'bounce',
167
+ 'flash',
168
+ 'pulse',
169
+ );
170
+
171
+ ?>
172
+ <ul class="collapsible" data-collapsible="accordion" id="ht_ctc_animations">
173
+ <li class="active">
174
+ <div class="collapsible-header"><?php _e( 'Animations', 'click-to-chat-for-whatsapp' ); ?> (beta)</div>
175
+ <div class="collapsible-body">
176
+
177
+ <!-- <p class="description"><?php _e( "Animations for floating styles", 'click-to-chat-for-whatsapp' ); ?> -->
178
+ <p class="description"><?php _e( "Beta stage - We are planning to improve this feature. please contact us, for any suggestions.", 'click-to-chat-for-whatsapp' ); ?>
179
+ <p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/animations/">Animations</a></p>
180
+ <br><br><br><br>
181
+
182
+
183
+ <!-- animation on load -->
184
+ <div class="row">
185
+ <div class="col s6">
186
+ <p><?php _e( 'Animations', 'click-to-chat-for-whatsapp' ); ?></p>
187
+ </div>
188
+ <div class="input-field col s6">
189
+ <select name="ht_ctc_othersettings[an_type]" class="an_type">
190
+ <?php
191
+
192
+ foreach ( $an_list as $value ) {
193
+ ?>
194
+ <option value="<?php echo $value ?>" <?php echo $an_type == $value ? 'SELECTED' : ''; ?> ><?php echo $value ?></option>
195
+ <?php
196
+ }
197
+
198
+ ?>
199
+ </select>
200
+ <label><?php _e( 'Animations', 'click-to-chat-for-whatsapp' ); ?></label>
201
+ </div>
202
+ </div>
203
+
204
+ <hr style="width: 50%;">
205
+ <br><br>
206
+
207
+ <!-- Show effect -->
208
+ <div class="row">
209
+ <div class="col s6">
210
+ <p><?php _e( 'Show Effects', 'click-to-chat-for-whatsapp' ); ?></p>
211
+ </div>
212
+ <div class="input-field col s6">
213
+ <select name="ht_ctc_othersettings[show_effect]" class="show_effect">
214
+ <?php
215
+
216
+ foreach ( $show_effect_list as $value ) {
217
+ ?>
218
+ <option value="<?php echo $value ?>" <?php echo $show_effect == $value ? 'SELECTED' : ''; ?> ><?php echo $value ?></option>
219
+ <?php
220
+ }
221
+
222
+ ?>
223
+ </select>
224
+ <label><?php _e( 'How to display', 'click-to-chat-for-whatsapp' ); ?></label>
225
+ <p class="description" style="font-size: 0.9em">(<?php _e( 'Looks good for some styles or if no-animation', 'click-to-chat-for-whatsapp' ); ?>)</p>
226
+ </div>
227
+ </div>
228
+
229
+ </div>
230
+ </li>
231
+ </ul>
232
+ <?php
233
+ }
234
+
235
+ // Other settings
236
+ // fb analytics
237
+ // detect device
238
+ function ht_ctc_othersettings_cb() {
239
+
240
+ $options = get_option('ht_ctc_othersettings');
241
+ $dbrow = 'ht_ctc_othersettings';
242
+ ?>
243
+
244
+ <ul class="collapsible" data-collapsible="accordion" id="ht_ctc_othersettings">
245
+ <li class="active">
246
+ <div class="collapsible-header"><?php _e( 'Other Settings', 'click-to-chat-for-whatsapp' ); ?></div>
247
+ <div class="collapsible-body">
248
+
249
+ <!-- not make empty table -->
250
+ <input name="ht_ctc_othersettings[hello]" value="hello" id="" type="hidden" class="hide" >
251
+
252
+ <?php
253
+ // cache issue while selecting styles
254
+ if ( isset( $options['select_styles_issue'] ) ) {
255
+ ?>
256
+ <p id="styles_issue">
257
+ <label>
258
+ <input name="<?php echo $dbrow ?>[select_styles_issue]" type="checkbox" value="1" <?php checked( $options['select_styles_issue'], 1 ); ?> id="select_styles_issue" />
259
+ <!-- <span>Style for device is not as expected(due to cache)</span> -->
260
+ <span><?php _e( 'Check this only, If styles for mobile, desktop not selected as expected(due to cache)', 'click-to-chat-for-whatsapp' ); ?></span>
261
+ </label>
262
+ </p>
263
+ <?php
264
+ } else {
265
+ ?>
266
+ <p id="styles_issue">
267
+ <label>
268
+ <input name="<?php echo $dbrow ?>[select_styles_issue]" type="checkbox" value="1" id="select_styles_issue" />
269
+ <span><?php _e( 'Check this only, If styles for mobile, desktop not selected as expected(due to cache)', 'click-to-chat-for-whatsapp' ); ?></span>
270
+ </label>
271
+ </p>
272
+ <?php
273
+ }
274
+ ?>
275
+ <p class="description"> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/select-styles/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
276
+ <br>
277
+ <?php
278
+
279
+ // enable group
280
+ if ( isset( $options['enable_group'] ) ) {
281
+ ?>
282
+ <p>
283
+ <label>
284
+ <input name="ht_ctc_othersettings[enable_group]" type="checkbox" value="1" <?php checked( $options['enable_group'], 1 ); ?> id="enable_group" />
285
+ <span><?php _e( 'Enable Group Features', 'click-to-chat-for-whatsapp' ); ?></span>
286
+ </label>
287
+ <p class="description"> - <a href="<?php echo admin_url( 'admin.php?page=click-to-chat-group-feature' ); ?>"><?php _e( 'Group Settings page', 'click-to-chat-for-whatsapp' ); ?></a> </p>
288
+ </p>
289
+ <?php
290
+ } else {
291
+ ?>
292
+ <p>
293
+ <label>
294
+ <input name="ht_ctc_othersettings[enable_group]" type="checkbox" value="1" id="enable_group" />
295
+ <span><?php _e( 'Enable Group Features', 'click-to-chat-for-whatsapp' ); ?></span>
296
+ </label>
297
+ </p>
298
+ <p class="description"> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/enable-group"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
299
+ <?php
300
+ }
301
+ ?>
302
+ <br>
303
+ <?php
304
+
305
+
306
+ // enable share
307
+ if ( isset( $options['enable_share'] ) ) {
308
+ ?>
309
+ <p>
310
+ <label>
311
+ <input name="ht_ctc_othersettings[enable_share]" type="checkbox" value="1" <?php checked( $options['enable_share'], 1 ); ?> id="enable_share" />
312
+ <span><?php _e( 'Enable Share Features', 'click-to-chat-for-whatsapp' ); ?></span>
313
+ </label>
314
+ <p class="description"> - <a href="<?php echo admin_url( 'admin.php?page=click-to-chat-share-feature' ); ?>"><?php _e( 'Share Settings page', 'click-to-chat-for-whatsapp' ); ?></a> </p>
315
+ </p>
316
+ <?php
317
+ } else {
318
+ ?>
319
+ <p>
320
+ <label>
321
+ <input name="ht_ctc_othersettings[enable_share]" type="checkbox" value="1" id="enable_share" />
322
+ <span><?php _e( 'Enable Share Features', 'click-to-chat-for-whatsapp' ); ?></span>
323
+ </label>
324
+ </p>
325
+ <p class="description"> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/enable-share"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
326
+ <?php
327
+ }
328
+ ?>
329
+ <br>
330
+
331
+ <!-- chat -->
332
+ <p class="description"><?php _e( "Chat settings are enabled by default and can't disbale. If like to hide chat on all pages select", 'click-to-chat-for-whatsapp' ); ?> <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat#showhide_settings' ); ?>"><?php _e( 'show on selected pages', 'click-to-chat-for-whatsapp' ); ?></a> </p>
333
+ <p class="description"> - <a target="_blank" href="<?php echo admin_url( 'admin.php?page=click-to-chat' ); ?>"><?php _e( 'Chat Settings page', 'click-to-chat-for-whatsapp' ); ?></a> <br> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/enable-chat"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
334
+ </p>
335
+ <br>
336
+
337
+ <?php
338
+ // Facebook Analytics
339
+ if ( isset( $options['fb_analytics'] ) ) {
340
+ ?>
341
+ <p>
342
+ <label>
343
+ <input name="ht_ctc_othersettings[fb_analytics]" type="checkbox" value="1" <?php checked( $options['fb_analytics'], 1 ); ?> id="fb_analytics" />
344
+ <span><?php _e( 'Facebook Analytics', 'click-to-chat-for-whatsapp' ); ?></span>
345
+ </label>
346
+ </p>
347
+ <?php
348
+ } else {
349
+ ?>
350
+ <p>
351
+ <label>
352
+ <input name="ht_ctc_othersettings[fb_analytics]" type="checkbox" value="1" id="fb_analytics" />
353
+ <span><?php _e( 'Facebook Analytics', 'click-to-chat-for-whatsapp' ); ?></span>
354
+ </label>
355
+ </p>
356
+ <?php
357
+ }
358
+ ?>
359
+ <p class="description"> <?php _e( 'This feature is', 'click-to-chat-for-whatsapp' ); ?> <b><?php _e( 'depreacted', 'click-to-chat-for-whatsapp' ); ?></b> <?php _e( 'in the favor of Facebook Pixel', 'click-to-chat-for-whatsapp' ); ?></p>
360
+ <p class="description"> <?php _e( 'If Facebook Analytics installed - creates an Event there', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://www.holithemes.com/plugins/click-to-chat/facebook-analytics/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
361
+ <br><br><br>
362
+
363
+ <?php
364
+
365
+ // delete options
366
+ if ( isset( $options['delete_options'] ) ) {
367
+ ?>
368
+ <p>
369
+ <label>
370
+ <input name="ht_ctc_othersettings[delete_options]" type="checkbox" value="1" <?php checked( $options['delete_options'], 1 ); ?> id="delete_options" />
371
+ <span><?php _e( 'Delete this plugin settings when uninstalls', 'click-to-chat-for-whatsapp' ); ?></span>
372
+ </label>
373
+ </p>
374
+ <?php
375
+ } else {
376
+ ?>
377
+ <p>
378
+ <label>
379
+ <input name="ht_ctc_othersettings[delete_options]" type="checkbox" value="1" id="delete_options" />
380
+ <span><?php _e( 'Delete this plugin settings when uninstalls', 'click-to-chat-for-whatsapp' ); ?></span>
381
+ </label>
382
+ </p>
383
+ <?php
384
+ }
385
+
386
+ ?>
387
+
388
+
389
+
390
+
391
+ </div>
392
+ </li>
393
+ </ul>
394
+
395
+ <?php
396
+ }
397
+
398
+
399
+ /**
400
+ * Sanitize each setting field as needed
401
+ *
402
+ * @param array $input Contains all settings fields as array keys
403
+ */
404
+ public function options_sanitize( $input ) {
405
+
406
+ if ( ! current_user_can( 'manage_options' ) ) {
407
+ wp_die( 'not allowed to modify - please contact admin ' );
408
+ }
409
+
410
+ $new_input = array();
411
+
412
+ foreach ($input as $key => $value) {
413
+
414
+ if ( 'placeholder' == $key ) {
415
+ $new_input[$key] = sanitize_textarea_field( $input[$key] );
416
+ } elseif ( isset( $input[$key] ) ) {
417
+ $new_input[$key] = sanitize_text_field( $input[$key] );
418
+ }
419
+
420
+ }
421
+
422
+ return $new_input;
423
+ }
424
+
425
+
426
+
427
+
428
+
429
+ }
430
+
431
+ $ht_ctc_admin_other_settings = new HT_CTC_Admin_Other_Settings();
432
+
433
+ add_action('admin_menu', array($ht_ctc_admin_other_settings, 'menu') );
434
+ add_action('admin_init', array($ht_ctc_admin_other_settings, 'settings') );
435
+
436
+ endif; // END class_exists check
new/admin/class-ht-ctc-admin-scripts.php CHANGED
@@ -21,7 +21,7 @@ class HT_CTC_Admin_Scripts {
21
  $load_js_bottom = apply_filters( 'ht_ctc_fh_load_js_bottom', false );
22
 
23
  // hook ..
24
- if( 'toplevel_page_click-to-chat' == $hook || 'click-to-chat_page_click-to-chat-chat-feature' == $hook || 'click-to-chat_page_click-to-chat-group-feature' == $hook || 'click-to-chat_page_click-to-chat-share-feature' == $hook || 'click-to-chat_page_click-to-chat-customize-styles' == $hook ) {
25
 
26
  wp_enqueue_style( 'wp-color-picker' );
27
  wp_enqueue_style('ctc_admin_md_css', plugins_url( 'new/admin/admin_assets/css/materialize.min.css', HT_CTC_PLUGIN_FILE ) , '', HT_CTC_VERSION );
21
  $load_js_bottom = apply_filters( 'ht_ctc_fh_load_js_bottom', false );
22
 
23
  // hook ..
24
+ if( 'toplevel_page_click-to-chat' == $hook || 'click-to-chat_page_click-to-chat-chat-feature' == $hook || 'click-to-chat_page_click-to-chat-group-feature' == $hook || 'click-to-chat_page_click-to-chat-share-feature' == $hook || 'click-to-chat_page_click-to-chat-customize-styles' == $hook || 'click-to-chat_page_click-to-chat-other-settings' == $hook ) {
25
 
26
  wp_enqueue_style( 'wp-color-picker' );
27
  wp_enqueue_style('ctc_admin_md_css', plugins_url( 'new/admin/admin_assets/css/materialize.min.css', HT_CTC_PLUGIN_FILE ) , '', HT_CTC_VERSION );
new/admin/class-ht-ctc-db.php CHANGED
@@ -28,97 +28,105 @@ class HT_CTC_DB {
28
  */
29
  public function db() {
30
 
 
 
 
31
  $this->ht_ctc_othersettings();
32
 
33
- $this->ht_ctc_main_options();
34
  $this->ht_ctc_chat_options();
35
- $this->ht_ctc_plugin_details();
36
  $this->ht_ctc_group();
37
  $this->ht_ctc_share();
38
- $this->ht_ctc_one_time();
39
 
40
  $this->ht_ctc_switch();
41
 
42
  // $this->ht_ctc_s1();
43
  $this->ht_ctc_s2();
44
  $this->ht_ctc_s3();
 
45
  $this->ht_ctc_s4();
46
  $this->ht_ctc_s5();
47
  $this->ht_ctc_s6();
48
  $this->ht_ctc_s7();
 
49
  $this->ht_ctc_s8();
50
-
51
  $this->ht_ctc_s99();
 
 
 
 
 
 
52
 
53
  }
54
 
55
 
56
-
57
  /**
58
- * table name: "ht_ctc_othersettings"
59
- *
60
- * other settings
61
- *
62
- * checkboxes ..
63
- * enable_group enable_group chat
64
- * enable_share enable_share
65
- * fb_analytics facebook analytics using js sdk
66
  *
67
  */
68
- public function ht_ctc_othersettings() {
 
 
 
 
 
69
 
70
- $values = array(
71
- 'hello' => 'world',
72
- );
73
 
74
- $ht_ctc_main_options = get_option('ht_ctc_main_options');
75
- if ( isset ( $ht_ctc_main_options['fb_analytics'] ) ) {
76
- $values['fb_analytics'] = '1';
77
- }
78
 
79
- if ( isset ( $ht_ctc_main_options['enable_group'] ) ) {
80
- $values['enable_group'] = '1';
81
- }
82
- if ( isset ( $ht_ctc_main_options['enable_share'] ) ) {
83
- $values['enable_share'] = '1';
84
  }
85
 
86
- $db_values = get_option( 'ht_ctc_othersettings', array() );
87
- $update_values = array_merge($values, $db_values);
88
- update_option('ht_ctc_othersettings', $update_values);
89
 
90
  }
91
 
92
 
93
 
94
-
95
  /**
96
- * table name: "ht_ctc_main_options"
97
  *
98
- * enable options ..
99
  *
100
  * checkboxes ..
101
- *
102
- *
103
- * google_analytics enable Google analytics
104
- * fb_pixel enable Facebook Pixel
 
 
 
105
  *
106
  */
107
- public function ht_ctc_main_options() {
108
 
109
  $values = array(
110
- 'hello' => 'world',
 
111
  );
112
 
113
- $db_values = get_option( 'ht_ctc_main_options', array() );
 
 
 
 
 
 
 
 
114
  $update_values = array_merge($values, $db_values);
115
- update_option('ht_ctc_main_options', $update_values);
116
 
117
  }
118
 
119
 
120
 
121
 
 
122
  /**
123
  * table name: "ht_ctc_chat_options"
124
  *
@@ -272,342 +280,577 @@ class HT_CTC_DB {
272
 
273
 
274
 
 
 
 
275
  /**
276
- * name: ht_ctc_plugin_details
277
  *
278
- * don't preseve already existing values
279
- * Always use update_option - override new values ..
280
  *
281
- * Add plugin Details to db
282
- * Add plugin version to db - useful while updating plugin
283
  */
284
- public function ht_ctc_plugin_details() {
 
 
285
 
286
- // plugin details
287
  $values = array(
288
- 'version' => HT_CTC_VERSION,
289
  );
290
 
291
- // Always use update_option - override new values .. don't preseve already existing values
292
- update_option( 'ht_ctc_plugin_details', $values );
 
 
 
293
  }
294
 
295
 
 
 
 
 
 
 
 
 
 
296
  /**
297
- * name: ht_ctc_one_time
298
- *
299
- * ***** caution *****
300
- * when using this values always check if exists..
301
- * as some new values may add in other versions..
302
- * and thoose values may not exists if this option is added before
303
- * ( it add_option not update_option )
304
  *
305
- * dont update values. .. one time values ..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
306
  *
307
- * first_version - first version installed
 
308
  *
309
- * Add plugin Details to db
310
- * Add plugin version to db - useful while updating plugin
311
  */
312
- public function ht_ctc_one_time() {
313
-
314
- // plugin details
315
- $values = array(
316
- 'first_version' => HT_CTC_VERSION,
 
 
 
317
  );
318
 
319
- // dont update values. .. one time values ..
320
- add_option( 'ht_ctc_one_time', $values );
 
 
 
 
 
 
 
 
 
 
321
  }
322
 
323
 
324
  /**
325
- * name: ht_ctc_switch
326
  *
327
- * interface - option - 1 new interface, 2 previous interface
328
- * 'yes' 'no'
329
  *
 
 
330
  */
331
- public function ht_ctc_switch() {
332
-
333
- $interface = 'yes';
334
 
335
- $values = array(
336
- 'interface' => $interface,
 
 
337
  );
338
 
 
339
 
340
- $db_values = get_option( 'ht_ctc_switch', array() );
341
- $update_values = array_merge($values, $db_values);
342
- update_option('ht_ctc_switch', $update_values);
 
 
 
343
 
344
- }
345
 
 
 
 
 
 
 
 
 
 
 
 
346
 
 
 
 
347
 
 
348
 
349
 
350
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
351
 
352
- // styles
353
 
 
 
 
 
 
 
354
 
 
 
 
355
 
356
- /**
357
- * name: ht_ctc_s1
358
- *
359
- * Style-1
360
- * style-1 is default button, nothing to modify..
361
- */
362
- // public function ht_ctc_s1() {
363
-
364
- // $style_1 = array(
365
 
366
- // 's1_img' => '',
367
-
368
- // );
369
 
370
- // $db_values = get_option( 'ht_ctc_s1', array() );
371
- // $update_values = array_merge($style_1, $db_values);
372
- // update_option('ht_ctc_s1', $update_values);
373
 
374
- // }
 
 
 
 
 
 
375
 
 
376
 
 
 
 
 
 
 
377
 
 
 
 
378
 
 
379
 
380
 
381
- /**
382
- * name: ht_ctc_s2
383
- *
384
- * Style-2
385
- * green square icon
386
- */
387
- public function ht_ctc_s2() {
388
-
389
- $style_2 = array(
390
 
391
- 's2_img_size' => '50px',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
392
 
393
- );
394
 
395
- $db_values = get_option( 'ht_ctc_s2', array() );
396
- $update_values = array_merge($style_2, $db_values);
397
- update_option('ht_ctc_s2', $update_values);
 
 
 
398
 
399
- }
 
 
400
 
 
401
 
402
- /**
403
- * name: ht_ctc_s3
404
- *
405
- * s3_type - simple / extend
406
- * simple - only image size setting.
407
- *
408
- * Style-3
409
- * icon
410
- */
411
- public function ht_ctc_s3() {
412
-
413
- $style_3 = array(
414
 
415
- 's3_bg_color' => '#25D366',
416
- 's3_bg_color_hover' => '#25D366',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
417
 
418
- );
419
-
420
- // =v2.11+ -> s3_type - extend, img size 40px else 50px
421
- $options = get_option('ht_ctc_s3');
422
- if ( isset ( $options['s3_img_size'] ) && !isset ( $options['s3_type'] ) ) {
423
- $style_3['s3_img_size'] = '50px';
424
- $style_3['s3_type'] = 'simple';
425
- $style_3['s3_padding'] = '20px';
426
- } else {
427
- $style_3['s3_img_size'] = '40px';
428
- $style_3['s3_type'] = 'extend';
429
- $style_3['s3_padding'] = '16px';
430
  }
431
 
432
- $db_values = get_option( 'ht_ctc_s3', array() );
433
- $update_values = array_merge($style_3, $db_values);
434
- update_option('ht_ctc_s3', $update_values);
435
 
436
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
437
 
 
 
 
438
 
 
439
 
440
- /**
441
- * name: ht_ctc_s4
442
- *
443
- * Style-4
444
- * chip
445
- */
446
- public function ht_ctc_s4() {
447
 
448
- $style_4 = array(
449
 
450
- 's4_text_color' => '#7f7d7d',
451
- 's4_bg_color' => '#e4e4e4',
452
- 's4_img_url' => '',
453
- 's4_img_position' => 'left',
454
- 's4_img_size' => '32px',
455
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
456
 
457
- $db_values = get_option( 'ht_ctc_s4', array() );
458
- $update_values = array_merge($style_4, $db_values);
459
- update_option('ht_ctc_s4', $update_values);
 
 
 
 
460
 
461
- }
 
 
462
 
 
463
 
464
 
465
- /**
466
- * name: ht_ctc_s5
467
- *
468
- * Style-5
469
- * chip
470
- */
471
- public function ht_ctc_s5() {
472
-
473
- $style_5 = array(
474
-
475
- 's5_line_1' => '',
476
- 's5_line_2' => 'We will respond as soon as possible',
477
- 's5_line_1_color' => '#000000',
478
- 's5_line_2_color' => '#000000',
479
- 's5_background_color' => '#ffffff',
480
- 's5_border_color' => '#dddddd',
481
- 's5_img' => '',
482
- 's5_img_height' => '70px',
483
- 's5_img_width' => '70px',
484
- 's5_content_height' => '70px',
485
- 's5_content_width' => '270px',
486
- 's5_img_position' => 'right', // left means nothing - right means - order: 1
487
 
488
- );
 
 
 
 
 
 
 
 
 
489
 
490
- $db_values = get_option( 'ht_ctc_s5', array() );
491
- $update_values = array_merge($style_5, $db_values);
492
- update_option('ht_ctc_s5', $update_values);
493
 
494
- }
495
 
 
 
 
 
 
 
 
 
 
 
496
 
497
- /**
498
- * name: ht_ctc_s6
499
- *
500
- * Style-6
501
- *
502
- * #006ccc
503
- * #0073aa
504
- * #005177
505
- */
506
- public function ht_ctc_s6() {
507
-
508
- $style_6 = array(
509
 
510
- 's6_txt_color' => '',
511
- 's6_txt_color_on_hover' => '',
512
- 's6_txt_decoration' => '',
513
- 's6_txt_decoration_on_hover' => '',
514
-
515
- );
516
 
517
- $db_values = get_option( 'ht_ctc_s6', array() );
518
- $update_values = array_merge($style_6, $db_values);
519
- update_option('ht_ctc_s6', $update_values);
520
 
521
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
522
 
 
 
 
 
 
523
 
524
- /**
525
- * name: ht_ctc_s7
526
- *
527
- * Style-7
528
- *
529
- * border is padding
530
- * 's7_icon_color_hover' => '#6b6b6b', #262626, #455a64
531
- */
532
- public function ht_ctc_s7() {
533
-
534
- $style_7 = array(
535
-
536
- 's7_icon_size' => '28px',
537
- 's7_icon_color' => '#ffffff',
538
- 's7_icon_color_hover' => '#455a64',
539
- 's7_border_size' => '12px',
540
- 's7_border_color' => '#25D366',
541
- 's7_border_color_hover' => '#25D366',
542
- 's7_border_radius' => '50%',
543
-
544
- );
545
 
546
- $db_values = get_option( 'ht_ctc_s7', array() );
547
- $update_values = array_merge($style_7, $db_values);
548
- update_option('ht_ctc_s7', $update_values);
549
 
550
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
551
 
 
 
 
 
552
 
 
 
 
553
 
554
- /**
555
- * name: ht_ctc_s8
556
- *
557
- * Style-8
558
- */
559
- public function ht_ctc_s8() {
560
-
561
- $style_8 = array(
562
-
563
- 's8_txt_color' => '#ffffff',
564
- 's8_txt_color_on_hover' => '#ffffff',
565
- 's8_bg_color' => '#26a69a',
566
- 's8_bg_color_on_hover' => '#26a69a',
567
- 's8_icon_color' => '#ffffff',
568
- 's8_icon_color_on_hover' => '#ffffff',
569
- 's8_icon_position' => 'left',
570
- 's8_text_size' => '',
571
- 's8_icon_size' => '',
572
- 's8_btn_size' => 'btn',
573
-
574
- );
575
 
576
- $db_values = get_option( 'ht_ctc_s8', array() );
577
- $update_values = array_merge($style_8, $db_values);
578
- update_option('ht_ctc_s8', $update_values);
579
 
580
- }
581
 
 
 
 
582
 
583
- /**
584
- * name: ht_ctc_s99
585
- *
586
- * Style-99
587
- */
588
- public function ht_ctc_s99() {
589
-
590
- $style_99 = array(
591
-
592
- 's99_dekstop_img_url' => '',
593
- 's99_mobile_img_url' => '',
594
- 's99_desktop_img_height' => '50px',
595
- 's99_desktop_img_width' => '',
596
- 's99_mobile_img_height' => '50px',
597
- 's99_mobile_img_width' => '',
598
-
599
- );
600
 
601
- $db_values = get_option( 'ht_ctc_s99', array() );
602
- $update_values = array_merge($style_99, $db_values);
603
- update_option('ht_ctc_s99', $update_values);
 
 
 
604
 
605
- }
606
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
607
 
 
 
608
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
609
 
 
610
 
 
611
 
612
 
613
 
28
  */
29
  public function db() {
30
 
31
+ // to update db value before
32
+ $this->ht_ctc_updatedb();
33
+
34
  $this->ht_ctc_othersettings();
35
 
 
36
  $this->ht_ctc_chat_options();
 
37
  $this->ht_ctc_group();
38
  $this->ht_ctc_share();
 
39
 
40
  $this->ht_ctc_switch();
41
 
42
  // $this->ht_ctc_s1();
43
  $this->ht_ctc_s2();
44
  $this->ht_ctc_s3();
45
+ $this->ht_ctc_s3_1();
46
  $this->ht_ctc_s4();
47
  $this->ht_ctc_s5();
48
  $this->ht_ctc_s6();
49
  $this->ht_ctc_s7();
50
+ $this->ht_ctc_s7_1();
51
  $this->ht_ctc_s8();
 
52
  $this->ht_ctc_s99();
53
+ $this->ht_ctc_cs_options();
54
+
55
+ $this->ht_ctc_plugin_details();
56
+ $this->ht_ctc_one_time();
57
+
58
+ // $this->ht_ctc_updatedb_last();
59
 
60
  }
61
 
62
 
 
63
  /**
64
+ * update db - First
 
 
 
 
 
 
 
65
  *
66
  */
67
+ public function ht_ctc_updatedb() {
68
+
69
+ $ht_ctc_plugin_details = get_option('ht_ctc_plugin_details');
70
+ $ht_ctc_chat_options = get_option('ht_ctc_chat_options');
71
+ $ht_ctc_group = get_option('ht_ctc_group');
72
+ $ht_ctc_share = get_option('ht_ctc_share');
73
 
74
+ // only if already installed.
75
+ if ( isset( $ht_ctc_plugin_details['version'] ) ) {
 
76
 
77
+ // v3: if not yet updated to v3 or above (in v3 $ht_ctc_plugin_details['v3'] is added)
78
+ if ( !isset( $ht_ctc_plugin_details['v3'] ) ) {
79
+ $this->v3_update();
80
+ }
81
 
 
 
 
 
 
82
  }
83
 
 
 
 
84
 
85
  }
86
 
87
 
88
 
89
+
90
  /**
91
+ * table name: "ht_ctc_othersettings"
92
  *
93
+ * other settings
94
  *
95
  * checkboxes ..
96
+ * select_styles_issue
97
+ * enable_group enable_group chat
98
+ * enable_share enable_share
99
+ * google_analytics
100
+ * fb_pixel
101
+ * fb_analytics facebook analytics using js sdk
102
+ * delete options on plugin uninstall
103
  *
104
  */
105
+ public function ht_ctc_othersettings() {
106
 
107
  $values = array(
108
+ 'an_type' => 'no-animation',
109
+ 'show_effect' => 'no-show-effects',
110
  );
111
 
112
+ $ht_ctc_plugin_details = get_option('ht_ctc_plugin_details');
113
+
114
+ // enable by default for new installs.
115
+ if ( !isset ( $ht_ctc_plugin_details['version'] ) ) {
116
+ $values['google_analytics'] = '1';
117
+ $values['fb_pixel'] = '1';
118
+ }
119
+
120
+ $db_values = get_option( 'ht_ctc_othersettings', array() );
121
  $update_values = array_merge($values, $db_values);
122
+ update_option('ht_ctc_othersettings', $update_values);
123
 
124
  }
125
 
126
 
127
 
128
 
129
+
130
  /**
131
  * table name: "ht_ctc_chat_options"
132
  *
280
 
281
 
282
 
283
+
284
+
285
+
286
  /**
287
+ * name: ht_ctc_switch
288
  *
289
+ * interface - option - 1 new interface, 2 previous interface
290
+ * 'yes' 'no'
291
  *
 
 
292
  */
293
+ public function ht_ctc_switch() {
294
+
295
+ $interface = 'yes';
296
 
 
297
  $values = array(
298
+ 'interface' => $interface,
299
  );
300
 
301
+
302
+ $db_values = get_option( 'ht_ctc_switch', array() );
303
+ $update_values = array_merge($values, $db_values);
304
+ update_option('ht_ctc_switch', $update_values);
305
+
306
  }
307
 
308
 
309
+
310
+
311
+
312
+
313
+
314
+ // styles
315
+
316
+
317
+
318
  /**
319
+ * name: ht_ctc_s1
 
 
 
 
 
 
320
  *
321
+ * Style-1
322
+ * style-1 is default button, nothing to modify..
323
+ */
324
+ // public function ht_ctc_s1() {
325
+
326
+ // $style_1 = array(
327
+
328
+ // 's1_img' => '',
329
+
330
+ // );
331
+
332
+ // $db_values = get_option( 'ht_ctc_s1', array() );
333
+ // $update_values = array_merge($style_1, $db_values);
334
+ // update_option('ht_ctc_s1', $update_values);
335
+
336
+ // }
337
+
338
+
339
+
340
+
341
+
342
+
343
+ /**
344
+ * name: ht_ctc_s2
345
  *
346
+ * Style-2
347
+ * green square icon
348
  *
349
+ * cta_type - hover only, show, hide - if new install dispaly on hover.
 
350
  */
351
+ public function ht_ctc_s2() {
352
+
353
+ $style_2 = array(
354
+
355
+ 's2_img_size' => '50px',
356
+ 'cta_textcolor' => '#ffffff',
357
+ 'cta_bgcolor' => '#25D366',
358
+
359
  );
360
 
361
+ $ht_ctc_plugin_details = get_option('ht_ctc_plugin_details');
362
+
363
+ if ( !isset ( $ht_ctc_plugin_details['version'] ) ) {
364
+ $style_2['cta_type'] = 'hover';
365
+ } else {
366
+ $style_2['cta_type'] = 'hide';
367
+ }
368
+
369
+ $db_values = get_option( 'ht_ctc_s2', array() );
370
+ $update_values = array_merge($style_2, $db_values);
371
+ update_option('ht_ctc_s2', $update_values);
372
+
373
  }
374
 
375
 
376
  /**
377
+ * name: ht_ctc_s3
378
  *
379
+ * s3_type - simple / extend
380
+ * simple - only image size setting.
381
  *
382
+ * Style-3
383
+ * icon
384
  */
385
+ public function ht_ctc_s3() {
386
+
387
+ $style_3 = array(
388
 
389
+ 's3_img_size' => '50px',
390
+ 'cta_textcolor' => '#ffffff',
391
+ 'cta_bgcolor' => '#25d366',
392
+
393
  );
394
 
395
+ $ht_ctc_plugin_details = get_option('ht_ctc_plugin_details');
396
 
397
+ // @since 3.0 cta
398
+ if ( !isset ( $ht_ctc_plugin_details['version'] ) ) {
399
+ $style_3['cta_type'] = 'hover';
400
+ } else {
401
+ $style_3['cta_type'] = 'hide';
402
+ }
403
 
 
404
 
405
+ // type: extend is moving to Style-3_1 Extend
406
+ $s3 = get_option('ht_ctc_s3');
407
+ $s3_1 = get_option('ht_ctc_s3_1');
408
+ // if 3_1 not yet created - run only once.
409
+ if ( !isset($s3_1['s3_1_img_size']) ) {
410
+ // if type: extend
411
+ if ( isset($s3['s3_type']) && 'extend' == $s3['s3_type'] ) {
412
+ // then add table s3_1 with s3 values
413
+ update_option('ht_ctc_s3_1', $s3);
414
+ }
415
+ }
416
 
417
+ $db_values = get_option( 'ht_ctc_s3', array() );
418
+ $update_values = array_merge($style_3, $db_values);
419
+ update_option('ht_ctc_s3', $update_values);
420
 
421
+ }
422
 
423
 
424
 
425
+ /**
426
+ * name: ht_ctc_s3_1
427
+ *
428
+ * Style-3 Extend
429
+ *
430
+ * icon
431
+ * @since 3.0 (in v2.11 s3 type extend created and since 3.0 created as a new style 3_1 i.e. s3 Extend)
432
+ */
433
+ public function ht_ctc_s3_1() {
434
+
435
+ $style_3_1 = array(
436
+
437
+ 's3_img_size' => '40px',
438
+ 's3_bg_color' => '#25D366',
439
+ 's3_bg_color_hover' => '#25D366',
440
+ 's3_padding' => '16px',
441
+ 's3_box_shadow' => '1',
442
+ 's3_box_shadow_hover' => '1',
443
+ 'cta_textcolor' => '#ffffff',
444
+ 'cta_bgcolor' => '#25d366',
445
+
446
+ );
447
 
448
+ $ht_ctc_plugin_details = get_option('ht_ctc_plugin_details');
449
 
450
+ // cta
451
+ if ( !isset ( $ht_ctc_plugin_details['version'] ) ) {
452
+ $style_3_1['cta_type'] = 'hover';
453
+ } else {
454
+ $style_3_1['cta_type'] = 'hide';
455
+ }
456
 
457
+ $db_values = get_option( 'ht_ctc_s3_1', array() );
458
+ $update_values = array_merge($style_3_1, $db_values);
459
+ update_option('ht_ctc_s3_1', $update_values);
460
 
461
+ }
 
 
 
 
 
 
 
 
462
 
 
 
 
463
 
 
 
 
464
 
465
+ /**
466
+ * name: ht_ctc_s4
467
+ *
468
+ * Style-4
469
+ * chip
470
+ */
471
+ public function ht_ctc_s4() {
472
 
473
+ $style_4 = array(
474
 
475
+ 's4_text_color' => '#7f7d7d',
476
+ 's4_bg_color' => '#e4e4e4',
477
+ 's4_img_url' => '',
478
+ 's4_img_position' => 'left',
479
+ 's4_img_size' => '32px',
480
+ );
481
 
482
+ $db_values = get_option( 'ht_ctc_s4', array() );
483
+ $update_values = array_merge($style_4, $db_values);
484
+ update_option('ht_ctc_s4', $update_values);
485
 
486
+ }
487
 
488
 
489
+
490
+ /**
491
+ * name: ht_ctc_s5
492
+ *
493
+ * Style-5
494
+ * chip
495
+ */
496
+ public function ht_ctc_s5() {
 
497
 
498
+ $style_5 = array(
499
+
500
+ 's5_line_1' => '',
501
+ 's5_line_2' => 'We will respond as soon as possible',
502
+ 's5_line_1_color' => '#000000',
503
+ 's5_line_2_color' => '#000000',
504
+ 's5_background_color' => '#ffffff',
505
+ 's5_border_color' => '#dddddd',
506
+ 's5_img' => '',
507
+ 's5_img_height' => '70px',
508
+ 's5_img_width' => '70px',
509
+ 's5_content_height' => '70px',
510
+ 's5_content_width' => '270px',
511
+ 's5_img_position' => 'right', // left means nothing - right means - order: 1
512
+
513
+ );
514
+
515
+ $db_values = get_option( 'ht_ctc_s5', array() );
516
+ $update_values = array_merge($style_5, $db_values);
517
+ update_option('ht_ctc_s5', $update_values);
518
+
519
+ }
520
+
521
+
522
+ /**
523
+ * name: ht_ctc_s6
524
+ *
525
+ * Style-6
526
+ *
527
+ * #006ccc
528
+ * #0073aa
529
+ * #005177
530
+ */
531
+ public function ht_ctc_s6() {
532
 
533
+ $style_6 = array(
534
 
535
+ 's6_txt_color' => '',
536
+ 's6_txt_color_on_hover' => '',
537
+ 's6_txt_decoration' => '',
538
+ 's6_txt_decoration_on_hover' => '',
539
+
540
+ );
541
 
542
+ $db_values = get_option( 'ht_ctc_s6', array() );
543
+ $update_values = array_merge($style_6, $db_values);
544
+ update_option('ht_ctc_s6', $update_values);
545
 
546
+ }
547
 
 
 
 
 
 
 
 
 
 
 
 
 
548
 
549
+ /**
550
+ * name: ht_ctc_s7
551
+ *
552
+ * Style-7
553
+ *
554
+ * border is padding
555
+ * hover idea - icon #6b6b6b, #262626, #455a64, #f9f9f9, #00d34d
556
+ * hover idea - icon, border #f9f9f9/#f4f4f4, #00d34d
557
+ */
558
+ public function ht_ctc_s7() {
559
+
560
+ $style_7 = array(
561
+
562
+ 's7_icon_size' => '20px',
563
+ 's7_icon_color' => '#ffffff',
564
+ 's7_icon_color_hover' => '#f4f4f4',
565
+ 's7_border_size' => '12px',
566
+ 's7_border_color' => '#25D366',
567
+ 's7_border_color_hover' => '#25d366',
568
+ 's7_border_radius' => '50%',
569
+ 'cta_type' => 'hide',
570
+ 'cta_textcolor' => '#ffffff',
571
+ 'cta_bgcolor' => '#25d366',
572
+ );
573
+
574
+ $ht_ctc_plugin_details = get_option('ht_ctc_plugin_details');
575
 
576
+ // if new install
577
+ if ( !isset ( $ht_ctc_plugin_details['version'] ) ) {
578
+ $style_7['cta_type'] = 'hover';
579
+ }
580
+
581
+ $db_values = get_option( 'ht_ctc_s7', array() );
582
+ $update_values = array_merge($style_7, $db_values);
583
+ update_option('ht_ctc_s7', $update_values);
584
+
 
 
 
585
  }
586
 
 
 
 
587
 
588
+ /**
589
+ * name: ht_ctc_s7_1
590
+ *
591
+ * Style-7_1
592
+ *
593
+ * border is padding
594
+ * hover idea - icon #6b6b6b, #262626, #455a64, #f9f9f9, #00d34d
595
+ * hover idea - icon, border #f9f9f9/#f4f4f4, #00d34d
596
+ *
597
+ * cta_type - show / hover (hover is expand)
598
+ */
599
+ public function ht_ctc_s7_1() {
600
+
601
+ $style_7_1 = array(
602
+
603
+ 's7_icon_size' => '20px',
604
+ 's7_icon_color' => '#ffffff',
605
+ 's7_icon_color_hover' => '#f4f4f4',
606
+ 's7_border_size' => '12px',
607
+ 's7_bgcolor' => '#25D366',
608
+ 's7_bgcolor_hover' => '#00d34d',
609
+ 'cta_type' => 'hover',
610
+ );
611
 
612
+ $db_values = get_option( 'ht_ctc_s7_1', array() );
613
+ $update_values = array_merge($style_7_1, $db_values);
614
+ update_option('ht_ctc_s7_1', $update_values);
615
 
616
+ }
617
 
 
 
 
 
 
 
 
618
 
 
619
 
620
+ /**
621
+ * name: ht_ctc_s8
622
+ *
623
+ * Style-8
624
+ *
625
+ * s8_btn_size: btn / btn-large
626
+ */
627
+ public function ht_ctc_s8() {
628
+
629
+ $style_8 = array(
630
+
631
+ 's8_txt_color' => '#ffffff',
632
+ 's8_txt_color_on_hover' => '#ffffff',
633
+ 's8_bg_color' => '#26a69a',
634
+ 's8_bg_color_on_hover' => '#26a69a',
635
+ 's8_icon_color' => '#ffffff',
636
+ 's8_icon_color_on_hover' => '#ffffff',
637
+ 's8_icon_position' => 'left',
638
+ 's8_text_size' => '',
639
+ 's8_icon_size' => '',
640
+ 's8_btn_size' => 'btn',
641
+
642
+ );
643
 
644
+ $ht_ctc_plugin_details = get_option('ht_ctc_plugin_details');
645
+
646
+ // if new install
647
+ if ( !isset ( $ht_ctc_plugin_details['version'] ) ) {
648
+ $style_8['s8_text_size'] = '16px';
649
+ $style_8['s8_icon_size'] = '16px';
650
+ }
651
 
652
+ $db_values = get_option( 'ht_ctc_s8', array() );
653
+ $update_values = array_merge($style_8, $db_values);
654
+ update_option('ht_ctc_s8', $update_values);
655
 
656
+ }
657
 
658
 
659
+ /**
660
+ * name: ht_ctc_s99
661
+ *
662
+ * Style-99
663
+ */
664
+ public function ht_ctc_s99() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
665
 
666
+ $style_99 = array(
667
+
668
+ 's99_dekstop_img_url' => '',
669
+ 's99_mobile_img_url' => '',
670
+ 's99_desktop_img_height' => '50px',
671
+ 's99_desktop_img_width' => '',
672
+ 's99_mobile_img_height' => '50px',
673
+ 's99_mobile_img_width' => '',
674
+
675
+ );
676
 
677
+ $db_values = get_option( 'ht_ctc_s99', array() );
678
+ $update_values = array_merge($style_99, $db_values);
679
+ update_option('ht_ctc_s99', $update_values);
680
 
681
+ }
682
 
683
+ /**
684
+ * name: ht_ctc_cs_options
685
+ *
686
+ * customize styles
687
+ */
688
+ public function ht_ctc_cs_options() {
689
+
690
+ $values = array(
691
+ 'hello' => 'world',
692
+ );
693
 
694
+ $db_values = get_option( 'ht_ctc_cs_options', array() );
695
+ $update_values = array_merge($values, $db_values);
696
+ update_option('ht_ctc_cs_options', $update_values);
 
 
 
 
 
 
 
 
 
697
 
698
+ }
 
 
 
 
 
699
 
 
 
 
700
 
701
+ /**
702
+ * name: ht_ctc_plugin_details
703
+ *
704
+ * don't preseve already existing values
705
+ * Always use update_option - override new values ..
706
+ *
707
+ * Add plugin Details to db
708
+ * Add plugin version to db - useful while updating plugin
709
+ *
710
+ *
711
+ * v_ - from version. 3.0 v3 3.1 as v3_1
712
+ *
713
+ * v3
714
+ * - 'ht_ctc_main_options' option 'google anlayitcs', 'fb pixel' shift to 'ht_ctc_othersettings'
715
+ *
716
+ *
717
+ */
718
+ public function ht_ctc_plugin_details() {
719
 
720
+ // plugin details
721
+ $values = array(
722
+ 'version' => HT_CTC_VERSION,
723
+ 'v3' => 'v3',
724
+ );
725
 
726
+ // Always use update_option - override new values .. don't preseve already existing values
727
+ update_option( 'ht_ctc_plugin_details', $values );
728
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
729
 
 
 
 
730
 
731
+ /**
732
+ * name: ht_ctc_one_time
733
+ *
734
+ * ***** caution *****
735
+ * when using this values always check if exists..
736
+ * as some new values may add in other versions..
737
+ * and thoose values may not exists if this option is added before
738
+ * ( it add_option not update_option )
739
+ *
740
+ * dont update values. .. one time values ..
741
+ *
742
+ * first_version - first version installed
743
+ *
744
+ * Add plugin Details to db
745
+ * Add plugin version to db - useful while updating plugin
746
+ */
747
+ public function ht_ctc_one_time() {
748
 
749
+ // plugin details
750
+ $values = array(
751
+ 'first_version' => HT_CTC_VERSION,
752
+ );
753
 
754
+ // dont update values. .. one time values ..
755
+ add_option( 'ht_ctc_one_time', $values );
756
+ }
757
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
758
 
 
 
 
759
 
 
760
 
761
+ /**
762
+ * Database updates..
763
+ */
764
 
765
+ /**
766
+ * updating to v3 or above.
767
+ * - style 3 Extend to Style-3_1
768
+ * - analytics, .. switch to other settings..
769
+ */
770
+ public function v3_update() {
 
 
 
 
 
 
 
 
 
 
 
771
 
772
+ $ht_ctc_othersettings = get_option('ht_ctc_othersettings');
773
+ $ht_ctc_plugin_details = get_option('ht_ctc_plugin_details');
774
+ $ht_ctc_s3 = get_option('ht_ctc_s3');
775
+
776
+ // ht_ctc_main_options to ht_ctc_othersettings
777
+ $ht_ctc_main_options = get_option('ht_ctc_main_options');
778
 
779
+ if ( $ht_ctc_main_options ) {
780
 
781
+ $os = array(
782
+ 'hello' => 'world',
783
+ );
784
+
785
+ if ( isset ( $ht_ctc_main_options['google_analytics'] ) ) {
786
+ $os['google_analytics'] = '1';
787
+ }
788
+ if ( isset ( $ht_ctc_main_options['fb_pixel'] ) ) {
789
+ $os['fb_pixel'] = '1';
790
+ }
791
+ if ( isset ( $ht_ctc_main_options['fb_analytics'] ) ) {
792
+ $os['fb_analytics'] = '1';
793
+ }
794
+ if ( isset ( $ht_ctc_main_options['enable_group'] ) ) {
795
+ $os['enable_group'] = '1';
796
+ }
797
+ if ( isset ( $ht_ctc_main_options['enable_share'] ) ) {
798
+ $os['enable_share'] = '1';
799
+ }
800
+
801
+ $db_os = get_option( 'ht_ctc_othersettings', array() );
802
+ $update_os = array_merge($os, $db_os);
803
+ update_option('ht_ctc_othersettings', $update_os);
804
+
805
+ // delete ht_ctc_main_options settings, as transfered to other settings
806
+ delete_option( 'ht_ctc_main_options' );
807
+ }
808
+
809
 
810
+ // style-3 type extend is selected.. and if style 3 to 3_1
811
+ if ( isset($ht_ctc_s3['s3_type']) && 'extend' == $ht_ctc_s3['s3_type'] ) {
812
 
813
+ $ht_ctc_chat_options = get_option('ht_ctc_chat_options');
814
+ $ht_ctc_group = get_option('ht_ctc_group');
815
+ $ht_ctc_share = get_option('ht_ctc_share');
816
+
817
+ // this works as s3 type extend came later version of select style dekstop, mobile.
818
+ // chat
819
+ if ( isset($ht_ctc_chat_options['style_desktop']) && isset($ht_ctc_chat_options['style_mobile']) ) {
820
+ if ( '3' == $ht_ctc_chat_options['style_desktop']) {
821
+ $ht_ctc_chat_options['style_desktop'] = '3_1';
822
+ }
823
+ if ( '3' == $ht_ctc_chat_options['style_mobile']) {
824
+ $ht_ctc_chat_options['style_mobile'] = '3_1';
825
+ }
826
+ update_option( 'ht_ctc_chat_options', $ht_ctc_chat_options);
827
+ }
828
+
829
+ // group
830
+ if (isset($ht_ctc_group['style_desktop'])) {
831
+ if ( '3' == $ht_ctc_group['style_desktop']) {
832
+ $ht_ctc_group['style_desktop'] = '3_1';
833
+ }
834
+ if ( '3' == $ht_ctc_group['style_mobile']) {
835
+ $ht_ctc_group['style_mobile'] = '3_1';
836
+ }
837
+ update_option( 'ht_ctc_group', $ht_ctc_group);
838
+ }
839
+
840
+ // share
841
+ if (isset($ht_ctc_share['style_desktop'])) {
842
+ if ( '3' == $ht_ctc_share['style_desktop']) {
843
+ $ht_ctc_share['style_desktop'] = '3_1';
844
+ }
845
+ if ( '3' == $ht_ctc_share['style_mobile']) {
846
+ $ht_ctc_share['style_mobile'] = '3_1';
847
+ }
848
+ update_option( 'ht_ctc_share', $ht_ctc_share);
849
+ }
850
 
851
+ }
852
 
853
+ }
854
 
855
 
856
 
new/inc/assets/img/ht-ctc-svg-images.php ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ht-ctc-svg-images.php
4
+ *
5
+ * s7, 8 svg image
6
+ * simple icon
7
+ */
8
+
9
+
10
+ if ( ! defined( 'ABSPATH' ) ) exit;
11
+
12
+
13
+
14
+ /**
15
+ * s2 svg image
16
+ * square icon
17
+ */
18
+ function ht_ctc_style_2_svg( $img_size, $type, $ht_ctc_svg_css ) {
19
+
20
+ $svg = '<svg style="'.$ht_ctc_svg_css.'" width="'.$img_size.'" height="'.$img_size.'" viewBox="0 0 1024 1024">
21
+ <defs>
22
+ <path id="htwasqicona-'.$type.'" d="M1023.941 765.153c0 5.606-.171 17.766-.508 27.159-.824 22.982-2.646 52.639-5.401 66.151-4.141 20.306-10.392 39.472-18.542 55.425-9.643 18.871-21.943 35.775-36.559 50.364-14.584 14.56-31.472 26.812-50.315 36.416-16.036 8.172-35.322 14.426-55.744 18.549-13.378 2.701-42.812 4.488-65.648 5.3-9.402.336-21.564.505-27.15.505l-504.226-.081c-5.607 0-17.765-.172-27.158-.509-22.983-.824-52.639-2.646-66.152-5.4-20.306-4.142-39.473-10.392-55.425-18.542-18.872-9.644-35.775-21.944-50.364-36.56-14.56-14.584-26.812-31.471-36.415-50.314-8.174-16.037-14.428-35.323-18.551-55.744-2.7-13.378-4.487-42.812-5.3-65.649-.334-9.401-.503-21.563-.503-27.148l.08-504.228c0-5.607.171-17.766.508-27.159.825-22.983 2.646-52.639 5.401-66.151 4.141-20.306 10.391-39.473 18.542-55.426C34.154 93.24 46.455 76.336 61.07 61.747c14.584-14.559 31.472-26.812 50.315-36.416 16.037-8.172 35.324-14.426 55.745-18.549 13.377-2.701 42.812-4.488 65.648-5.3 9.402-.335 21.565-.504 27.149-.504l504.227.081c5.608 0 17.766.171 27.159.508 22.983.825 52.638 2.646 66.152 5.401 20.305 4.141 39.472 10.391 55.425 18.542 18.871 9.643 35.774 21.944 50.363 36.559 14.559 14.584 26.812 31.471 36.415 50.315 8.174 16.037 14.428 35.323 18.551 55.744 2.7 13.378 4.486 42.812 5.3 65.649.335 9.402.504 21.564.504 27.15l-.082 504.226z"/>
23
+ </defs>
24
+ <linearGradient id="htwasqiconb-'.$type.'" gradientUnits="userSpaceOnUse" x1="512.001" y1=".978" x2="512.001" y2="1025.023">
25
+ <stop offset="0" stop-color="#61fd7d"/>
26
+ <stop offset="1" stop-color="#2bb826"/>
27
+ </linearGradient>
28
+ <use xlink:href="#htwasqicona-'.$type.'" overflow="visible" fill="url(#htwasqiconb-'.$type.')"/>
29
+ <g>
30
+ <path fill="#FFF" d="M783.302 243.246c-69.329-69.387-161.529-107.619-259.763-107.658-202.402 0-367.133 164.668-367.214 367.072-.026 64.699 16.883 127.854 49.017 183.522l-52.096 190.229 194.665-51.047c53.636 29.244 114.022 44.656 175.482 44.682h.151c202.382 0 367.128-164.688 367.21-367.094.039-98.087-38.121-190.319-107.452-259.706zM523.544 808.047h-.125c-54.767-.021-108.483-14.729-155.344-42.529l-11.146-6.612-115.517 30.293 30.834-112.592-7.259-11.544c-30.552-48.579-46.688-104.729-46.664-162.379.066-168.229 136.985-305.096 305.339-305.096 81.521.031 158.154 31.811 215.779 89.482s89.342 134.332 89.312 215.859c-.066 168.243-136.984 305.118-305.209 305.118zm167.415-228.515c-9.177-4.591-54.286-26.782-62.697-29.843-8.41-3.062-14.526-4.592-20.645 4.592-6.115 9.182-23.699 29.843-29.053 35.964-5.352 6.122-10.704 6.888-19.879 2.296-9.176-4.591-38.74-14.277-73.786-45.526-27.275-24.319-45.691-54.359-51.043-63.543-5.352-9.183-.569-14.146 4.024-18.72 4.127-4.109 9.175-10.713 13.763-16.069 4.587-5.355 6.117-9.183 9.175-15.304 3.059-6.122 1.529-11.479-.765-16.07-2.293-4.591-20.644-49.739-28.29-68.104-7.447-17.886-15.013-15.466-20.645-15.747-5.346-.266-11.469-.322-17.585-.322s-16.057 2.295-24.467 11.478-32.113 31.374-32.113 76.521c0 45.147 32.877 88.764 37.465 94.885 4.588 6.122 64.699 98.771 156.741 138.502 21.892 9.45 38.982 15.094 52.308 19.322 21.98 6.979 41.982 5.995 57.793 3.634 17.628-2.633 54.284-22.189 61.932-43.615 7.646-21.427 7.646-39.791 5.352-43.617-2.294-3.826-8.41-6.122-17.585-10.714z"/>
31
+ </g>
32
+ </svg>';
33
+
34
+ return $svg;
35
+ }
36
+
37
+
38
+ /**
39
+ * style 3,4 svg image
40
+ * icon
41
+ */
42
+ function ht_ctc_style_3_svg( $img_size, $type, $ht_ctc_svg_css ) {
43
+
44
+ $svg = '<svg style="'.$ht_ctc_svg_css.'" width="'.$img_size.'" height="'.$img_size.'" viewBox="0 0 1219.547 1225.016">
45
+ <path fill="#E0E0E0" d="M1041.858 178.02C927.206 63.289 774.753.07 612.325 0 277.617 0 5.232 272.298 5.098 606.991c-.039 106.986 27.915 211.42 81.048 303.476L0 1225.016l321.898-84.406c88.689 48.368 188.547 73.855 290.166 73.896h.258.003c334.654 0 607.08-272.346 607.222-607.023.056-162.208-63.052-314.724-177.689-429.463zm-429.533 933.963h-.197c-90.578-.048-179.402-24.366-256.878-70.339l-18.438-10.93-191.021 50.083 51-186.176-12.013-19.087c-50.525-80.336-77.198-173.175-77.16-268.504.111-278.186 226.507-504.503 504.898-504.503 134.812.056 261.519 52.604 356.814 147.965 95.289 95.36 147.728 222.128 147.688 356.948-.118 278.195-226.522 504.543-504.693 504.543z"/>
46
+ <linearGradient id="htwaicona-'.$type.'" gradientUnits="userSpaceOnUse" x1="609.77" y1="1190.114" x2="609.77" y2="21.084">
47
+ <stop offset="0" stop-color="#20b038"/>
48
+ <stop offset="1" stop-color="#60d66a"/>
49
+ </linearGradient>
50
+ <path fill="url(#htwaicona-'.$type.')" d="M27.875 1190.114l82.211-300.18c-50.719-87.852-77.391-187.523-77.359-289.602.133-319.398 260.078-579.25 579.469-579.25 155.016.07 300.508 60.398 409.898 169.891 109.414 109.492 169.633 255.031 169.57 409.812-.133 319.406-260.094 579.281-579.445 579.281-.023 0 .016 0 0 0h-.258c-96.977-.031-192.266-24.375-276.898-70.5l-307.188 80.548z"/>
51
+ <image overflow="visible" opacity=".08" width="682" height="639" transform="translate(270.984 291.372)"/>
52
+ <path fill-rule="evenodd" clip-rule="evenodd" fill="#FFF" d="M462.273 349.294c-11.234-24.977-23.062-25.477-33.75-25.914-8.742-.375-18.75-.352-28.742-.352-10 0-26.25 3.758-39.992 18.766-13.75 15.008-52.5 51.289-52.5 125.078 0 73.797 53.75 145.102 61.242 155.117 7.5 10 103.758 166.266 256.203 226.383 126.695 49.961 152.477 40.023 179.977 37.523s88.734-36.273 101.234-71.297c12.5-35.016 12.5-65.031 8.75-71.305-3.75-6.25-13.75-10-28.75-17.5s-88.734-43.789-102.484-48.789-23.75-7.5-33.75 7.516c-10 15-38.727 48.773-47.477 58.773-8.75 10.023-17.5 11.273-32.5 3.773-15-7.523-63.305-23.344-120.609-74.438-44.586-39.75-74.688-88.844-83.438-103.859-8.75-15-.938-23.125 6.586-30.602 6.734-6.719 15-17.508 22.5-26.266 7.484-8.758 9.984-15.008 14.984-25.008 5-10.016 2.5-18.773-1.25-26.273s-32.898-81.67-46.234-111.326z"/>
53
+ <path fill="#FFF" d="M1036.898 176.091C923.562 62.677 772.859.185 612.297.114 281.43.114 12.172 269.286 12.039 600.137 12 705.896 39.633 809.13 92.156 900.13L7 1211.067l318.203-83.438c87.672 47.812 186.383 73.008 286.836 73.047h.255.003c330.812 0 600.109-269.219 600.25-600.055.055-160.343-62.328-311.108-175.649-424.53zm-424.601 923.242h-.195c-89.539-.047-177.344-24.086-253.93-69.531l-18.227-10.805-188.828 49.508 50.414-184.039-11.875-18.867c-49.945-79.414-76.312-171.188-76.273-265.422.109-274.992 223.906-498.711 499.102-498.711 133.266.055 258.516 52 352.719 146.266 94.195 94.266 146.031 219.578 145.992 352.852-.118 274.999-223.923 498.749-498.899 498.749z"/>
54
+ </svg>';
55
+
56
+ return $svg;
57
+ }
58
+
59
+
60
+ /**
61
+ * style-3 extend
62
+ */
63
+ function ht_ctc_style_3_1_svg( $img_size, $type, $ht_ctc_svg_css, $others ) {
64
+
65
+ $stop_color_0 = ( isset( $others['bg_color'] ) ) ? esc_attr( $others['bg_color'] ) : '#20b038';
66
+ $stop_color_1 = ( isset( $others['bg_color'] ) ) ? esc_attr( $others['bg_color'] ) : '#60d66a';
67
+
68
+ if ( '' == $stop_color_0 ) {
69
+ $stop_color_0 = "#20b038";
70
+ $stop_color_1 = "#60d66a";
71
+ }
72
+
73
+ $svg = '<svg style="'.$ht_ctc_svg_css.'" width="'.$img_size.'" height="'.$img_size.'" viewBox="0 0 1219.547 1225.016">
74
+ <path fill="#E0E0E0" d="M1041.858 178.02C927.206 63.289 774.753.07 612.325 0 277.617 0 5.232 272.298 5.098 606.991c-.039 106.986 27.915 211.42 81.048 303.476L0 1225.016l321.898-84.406c88.689 48.368 188.547 73.855 290.166 73.896h.258.003c334.654 0 607.08-272.346 607.222-607.023.056-162.208-63.052-314.724-177.689-429.463zm-429.533 933.963h-.197c-90.578-.048-179.402-24.366-256.878-70.339l-18.438-10.93-191.021 50.083 51-186.176-12.013-19.087c-50.525-80.336-77.198-173.175-77.16-268.504.111-278.186 226.507-504.503 504.898-504.503 134.812.056 261.519 52.604 356.814 147.965 95.289 95.36 147.728 222.128 147.688 356.948-.118 278.195-226.522 504.543-504.693 504.543z"/>
75
+ <linearGradient id="htwaicona-'.$type.'" gradientUnits="userSpaceOnUse" x1="609.77" y1="1190.114" x2="609.77" y2="21.084">
76
+ <stop offset="0" stop-color="'.$stop_color_0.'"/>
77
+ <stop offset="1" stop-color="'.$stop_color_1.'"/>
78
+ </linearGradient>
79
+ <path fill="url(#htwaicona-'.$type.')" d="M27.875 1190.114l82.211-300.18c-50.719-87.852-77.391-187.523-77.359-289.602.133-319.398 260.078-579.25 579.469-579.25 155.016.07 300.508 60.398 409.898 169.891 109.414 109.492 169.633 255.031 169.57 409.812-.133 319.406-260.094 579.281-579.445 579.281-.023 0 .016 0 0 0h-.258c-96.977-.031-192.266-24.375-276.898-70.5l-307.188 80.548z"/>
80
+ <image overflow="visible" opacity=".08" width="682" height="639" transform="translate(270.984 291.372)"/>
81
+ <path fill-rule="evenodd" clip-rule="evenodd" fill="#FFF" d="M462.273 349.294c-11.234-24.977-23.062-25.477-33.75-25.914-8.742-.375-18.75-.352-28.742-.352-10 0-26.25 3.758-39.992 18.766-13.75 15.008-52.5 51.289-52.5 125.078 0 73.797 53.75 145.102 61.242 155.117 7.5 10 103.758 166.266 256.203 226.383 126.695 49.961 152.477 40.023 179.977 37.523s88.734-36.273 101.234-71.297c12.5-35.016 12.5-65.031 8.75-71.305-3.75-6.25-13.75-10-28.75-17.5s-88.734-43.789-102.484-48.789-23.75-7.5-33.75 7.516c-10 15-38.727 48.773-47.477 58.773-8.75 10.023-17.5 11.273-32.5 3.773-15-7.523-63.305-23.344-120.609-74.438-44.586-39.75-74.688-88.844-83.438-103.859-8.75-15-.938-23.125 6.586-30.602 6.734-6.719 15-17.508 22.5-26.266 7.484-8.758 9.984-15.008 14.984-25.008 5-10.016 2.5-18.773-1.25-26.273s-32.898-81.67-46.234-111.326z"/>
82
+ <path fill="#FFF" d="M1036.898 176.091C923.562 62.677 772.859.185 612.297.114 281.43.114 12.172 269.286 12.039 600.137 12 705.896 39.633 809.13 92.156 900.13L7 1211.067l318.203-83.438c87.672 47.812 186.383 73.008 286.836 73.047h.255.003c330.812 0 600.109-269.219 600.25-600.055.055-160.343-62.328-311.108-175.649-424.53zm-424.601 923.242h-.195c-89.539-.047-177.344-24.086-253.93-69.531l-18.227-10.805-188.828 49.508 50.414-184.039-11.875-18.867c-49.945-79.414-76.312-171.188-76.273-265.422.109-274.992 223.906-498.711 499.102-498.711 133.266.055 258.516 52 352.719 146.266 94.195 94.266 146.031 219.578 145.992 352.852-.118 274.999-223.923 498.749-498.899 498.749z"/>
83
+ </svg>';
84
+
85
+ return $svg;
86
+ }
87
+
88
+
89
+
90
+ /**
91
+ * plain icon
92
+ * @uses at style 7, 7_1, 8
93
+ */
94
+ function ht_ctc_singlecolor( $svg_attrs ) {
95
+
96
+ $color = ( isset( $svg_attrs['color'] ) ) ? esc_attr( $svg_attrs['color'] ) : '#ffffff';
97
+ $icon_size = ( isset( $svg_attrs['icon_size'] ) ) ? esc_attr( $svg_attrs['icon_size'] ) : '28';
98
+ $type = ( isset( $svg_attrs['type'] ) ) ? esc_attr( $svg_attrs['type'] ) : 'chat';
99
+ $ht_ctc_svg_css = ( isset( $svg_attrs['ht_ctc_svg_css'] ) ) ? esc_attr( $svg_attrs['ht_ctc_svg_css'] ) : "display:block;";
100
+
101
+ $svg = '<svg style="'.$ht_ctc_svg_css.'" height="'.$icon_size.'" version="1.1" viewBox="0 0 509 512" width="'.$icon_size.'">
102
+ <desc/><defs/>
103
+ <g fill="none" fill-rule="evenodd" id="Page-1" stroke="none" stroke-width="1">
104
+ <path d="M259.253137,0.00180389396 C121.502859,0.00180389396 9.83730687,111.662896 9.83730687,249.413175 C9.83730687,296.530232 22.9142299,340.597122 45.6254897,378.191325 L0.613226597,512.001804 L138.700183,467.787757 C174.430395,487.549184 215.522926,498.811168 259.253137,498.811168 C396.994498,498.811168 508.660049,387.154535 508.660049,249.415405 C508.662279,111.662896 396.996727,0.00180389396 259.253137,0.00180389396 L259.253137,0.00180389396 Z M259.253137,459.089875 C216.65782,459.089875 176.998957,446.313956 143.886359,424.41206 L63.3044195,450.21808 L89.4939401,372.345171 C64.3924908,337.776609 49.5608297,295.299463 49.5608297,249.406486 C49.5608297,133.783298 143.627719,39.7186378 259.253137,39.7186378 C374.871867,39.7186378 468.940986,133.783298 468.940986,249.406486 C468.940986,365.025215 374.874096,459.089875 259.253137,459.089875 Z M200.755924,146.247066 C196.715791,136.510165 193.62103,136.180176 187.380228,135.883632 C185.239759,135.781068 182.918689,135.682963 180.379113,135.682963 C172.338979,135.682963 164.002301,138.050856 158.97889,143.19021 C152.865178,149.44439 137.578667,164.09322 137.578667,194.171258 C137.578667,224.253755 159.487251,253.321759 162.539648,257.402027 C165.600963,261.477835 205.268745,324.111057 266.985579,349.682963 C315.157262,369.636141 329.460495,367.859106 340.450462,365.455539 C356.441543,361.9639 376.521811,350.186865 381.616571,335.917077 C386.711331,321.63837 386.711331,309.399797 385.184018,306.857991 C383.654475,304.305037 379.578667,302.782183 373.464955,299.716408 C367.351242,296.659552 337.288812,281.870254 331.68569,279.83458 C326.080339,277.796676 320.898622,278.418749 316.5887,284.378615 C310.639982,292.612729 304.918689,301.074268 300.180674,306.09099 C296.46161,310.02856 290.477218,310.577055 285.331175,308.389764 C278.564174,305.506821 259.516237,298.869139 236.160607,278.048627 C217.988923,261.847958 205.716906,241.83458 202.149458,235.711949 C198.582011,229.598236 201.835077,225.948292 204.584241,222.621648 C207.719135,218.824546 210.610997,216.097679 213.667853,212.532462 C216.724709,208.960555 218.432625,207.05866 220.470529,202.973933 C222.508433,198.898125 221.137195,194.690767 219.607652,191.629452 C218.07588,188.568136 205.835077,158.494558 200.755924,146.247066 Z"
105
+ fill="'.$color.'" id="htwaicon-'.$type.'"/>
106
+ </g>
107
+ </svg>';
108
+
109
+
110
+ return $svg;
111
+ }
new/inc/assets/img/svg-style-2.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
- /**
3
- * s2 svg image
4
- * square icon
5
- */
6
-
7
- function style_2_svg( $img_size, $type, $ht_ctc_svg_css ) {
8
-
9
- $svg = '<svg style="'.$ht_ctc_svg_css.'" width="'.$img_size.'" height="'.$img_size.'" viewBox="0 0 1024 1024">
10
- <defs>
11
- <path id="htwasqicona-'.$type.'" d="M1023.941 765.153c0 5.606-.171 17.766-.508 27.159-.824 22.982-2.646 52.639-5.401 66.151-4.141 20.306-10.392 39.472-18.542 55.425-9.643 18.871-21.943 35.775-36.559 50.364-14.584 14.56-31.472 26.812-50.315 36.416-16.036 8.172-35.322 14.426-55.744 18.549-13.378 2.701-42.812 4.488-65.648 5.3-9.402.336-21.564.505-27.15.505l-504.226-.081c-5.607 0-17.765-.172-27.158-.509-22.983-.824-52.639-2.646-66.152-5.4-20.306-4.142-39.473-10.392-55.425-18.542-18.872-9.644-35.775-21.944-50.364-36.56-14.56-14.584-26.812-31.471-36.415-50.314-8.174-16.037-14.428-35.323-18.551-55.744-2.7-13.378-4.487-42.812-5.3-65.649-.334-9.401-.503-21.563-.503-27.148l.08-504.228c0-5.607.171-17.766.508-27.159.825-22.983 2.646-52.639 5.401-66.151 4.141-20.306 10.391-39.473 18.542-55.426C34.154 93.24 46.455 76.336 61.07 61.747c14.584-14.559 31.472-26.812 50.315-36.416 16.037-8.172 35.324-14.426 55.745-18.549 13.377-2.701 42.812-4.488 65.648-5.3 9.402-.335 21.565-.504 27.149-.504l504.227.081c5.608 0 17.766.171 27.159.508 22.983.825 52.638 2.646 66.152 5.401 20.305 4.141 39.472 10.391 55.425 18.542 18.871 9.643 35.774 21.944 50.363 36.559 14.559 14.584 26.812 31.471 36.415 50.315 8.174 16.037 14.428 35.323 18.551 55.744 2.7 13.378 4.486 42.812 5.3 65.649.335 9.402.504 21.564.504 27.15l-.082 504.226z"/>
12
- </defs>
13
- <linearGradient id="htwasqiconb-'.$type.'" gradientUnits="userSpaceOnUse" x1="512.001" y1=".978" x2="512.001" y2="1025.023">
14
- <stop offset="0" stop-color="#61fd7d"/>
15
- <stop offset="1" stop-color="#2bb826"/>
16
- </linearGradient>
17
- <use xlink:href="#htwasqicona-'.$type.'" overflow="visible" fill="url(#htwasqiconb-'.$type.')"/>
18
- <g>
19
- <path fill="#FFF" d="M783.302 243.246c-69.329-69.387-161.529-107.619-259.763-107.658-202.402 0-367.133 164.668-367.214 367.072-.026 64.699 16.883 127.854 49.017 183.522l-52.096 190.229 194.665-51.047c53.636 29.244 114.022 44.656 175.482 44.682h.151c202.382 0 367.128-164.688 367.21-367.094.039-98.087-38.121-190.319-107.452-259.706zM523.544 808.047h-.125c-54.767-.021-108.483-14.729-155.344-42.529l-11.146-6.612-115.517 30.293 30.834-112.592-7.259-11.544c-30.552-48.579-46.688-104.729-46.664-162.379.066-168.229 136.985-305.096 305.339-305.096 81.521.031 158.154 31.811 215.779 89.482s89.342 134.332 89.312 215.859c-.066 168.243-136.984 305.118-305.209 305.118zm167.415-228.515c-9.177-4.591-54.286-26.782-62.697-29.843-8.41-3.062-14.526-4.592-20.645 4.592-6.115 9.182-23.699 29.843-29.053 35.964-5.352 6.122-10.704 6.888-19.879 2.296-9.176-4.591-38.74-14.277-73.786-45.526-27.275-24.319-45.691-54.359-51.043-63.543-5.352-9.183-.569-14.146 4.024-18.72 4.127-4.109 9.175-10.713 13.763-16.069 4.587-5.355 6.117-9.183 9.175-15.304 3.059-6.122 1.529-11.479-.765-16.07-2.293-4.591-20.644-49.739-28.29-68.104-7.447-17.886-15.013-15.466-20.645-15.747-5.346-.266-11.469-.322-17.585-.322s-16.057 2.295-24.467 11.478-32.113 31.374-32.113 76.521c0 45.147 32.877 88.764 37.465 94.885 4.588 6.122 64.699 98.771 156.741 138.502 21.892 9.45 38.982 15.094 52.308 19.322 21.98 6.979 41.982 5.995 57.793 3.634 17.628-2.633 54.284-22.189 61.932-43.615 7.646-21.427 7.646-39.791 5.352-43.617-2.294-3.826-8.41-6.122-17.585-10.714z"/>
20
- </g>
21
- </svg>';
22
-
23
- return $svg;
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
new/inc/assets/img/svg-style-3.php DELETED
@@ -1,51 +0,0 @@
1
- <?php
2
- /**
3
- * s3 svg image
4
- * icon
5
- */
6
-
7
- // style-3, style-4
8
- function style_3_svg( $img_size, $type, $ht_ctc_svg_css ) {
9
-
10
- $svg = '<svg style="'.$ht_ctc_svg_css.'" width="'.$img_size.'" height="'.$img_size.'" viewBox="0 0 1219.547 1225.016">
11
- <path fill="#E0E0E0" d="M1041.858 178.02C927.206 63.289 774.753.07 612.325 0 277.617 0 5.232 272.298 5.098 606.991c-.039 106.986 27.915 211.42 81.048 303.476L0 1225.016l321.898-84.406c88.689 48.368 188.547 73.855 290.166 73.896h.258.003c334.654 0 607.08-272.346 607.222-607.023.056-162.208-63.052-314.724-177.689-429.463zm-429.533 933.963h-.197c-90.578-.048-179.402-24.366-256.878-70.339l-18.438-10.93-191.021 50.083 51-186.176-12.013-19.087c-50.525-80.336-77.198-173.175-77.16-268.504.111-278.186 226.507-504.503 504.898-504.503 134.812.056 261.519 52.604 356.814 147.965 95.289 95.36 147.728 222.128 147.688 356.948-.118 278.195-226.522 504.543-504.693 504.543z"/>
12
- <linearGradient id="htwaicona-'.$type.'" gradientUnits="userSpaceOnUse" x1="609.77" y1="1190.114" x2="609.77" y2="21.084">
13
- <stop offset="0" stop-color="#20b038"/>
14
- <stop offset="1" stop-color="#60d66a"/>
15
- </linearGradient>
16
- <path fill="url(#htwaicona-'.$type.')" d="M27.875 1190.114l82.211-300.18c-50.719-87.852-77.391-187.523-77.359-289.602.133-319.398 260.078-579.25 579.469-579.25 155.016.07 300.508 60.398 409.898 169.891 109.414 109.492 169.633 255.031 169.57 409.812-.133 319.406-260.094 579.281-579.445 579.281-.023 0 .016 0 0 0h-.258c-96.977-.031-192.266-24.375-276.898-70.5l-307.188 80.548z"/>
17
- <image overflow="visible" opacity=".08" width="682" height="639" transform="translate(270.984 291.372)"/>
18
- <path fill-rule="evenodd" clip-rule="evenodd" fill="#FFF" d="M462.273 349.294c-11.234-24.977-23.062-25.477-33.75-25.914-8.742-.375-18.75-.352-28.742-.352-10 0-26.25 3.758-39.992 18.766-13.75 15.008-52.5 51.289-52.5 125.078 0 73.797 53.75 145.102 61.242 155.117 7.5 10 103.758 166.266 256.203 226.383 126.695 49.961 152.477 40.023 179.977 37.523s88.734-36.273 101.234-71.297c12.5-35.016 12.5-65.031 8.75-71.305-3.75-6.25-13.75-10-28.75-17.5s-88.734-43.789-102.484-48.789-23.75-7.5-33.75 7.516c-10 15-38.727 48.773-47.477 58.773-8.75 10.023-17.5 11.273-32.5 3.773-15-7.523-63.305-23.344-120.609-74.438-44.586-39.75-74.688-88.844-83.438-103.859-8.75-15-.938-23.125 6.586-30.602 6.734-6.719 15-17.508 22.5-26.266 7.484-8.758 9.984-15.008 14.984-25.008 5-10.016 2.5-18.773-1.25-26.273s-32.898-81.67-46.234-111.326z"/>
19
- <path fill="#FFF" d="M1036.898 176.091C923.562 62.677 772.859.185 612.297.114 281.43.114 12.172 269.286 12.039 600.137 12 705.896 39.633 809.13 92.156 900.13L7 1211.067l318.203-83.438c87.672 47.812 186.383 73.008 286.836 73.047h.255.003c330.812 0 600.109-269.219 600.25-600.055.055-160.343-62.328-311.108-175.649-424.53zm-424.601 923.242h-.195c-89.539-.047-177.344-24.086-253.93-69.531l-18.227-10.805-188.828 49.508 50.414-184.039-11.875-18.867c-49.945-79.414-76.312-171.188-76.273-265.422.109-274.992 223.906-498.711 499.102-498.711 133.266.055 258.516 52 352.719 146.266 94.195 94.266 146.031 219.578 145.992 352.852-.118 274.999-223.923 498.749-498.899 498.749z"/>
20
- </svg>';
21
-
22
- return $svg;
23
- }
24
-
25
-
26
- // style-3 extend
27
- // #25D366 / #20b038 #60d66a
28
- function style_3_extend_svg( $img_size, $type, $ht_ctc_svg_css, $others ) {
29
-
30
- $stop_color_0 = ( isset( $others['bg_color'] ) ) ? esc_attr( $others['bg_color'] ) : '#20b038';
31
- $stop_color_1 = ( isset( $others['bg_color'] ) ) ? esc_attr( $others['bg_color'] ) : '#60d66a';
32
-
33
- if ( '' == $stop_color_0 ) {
34
- $stop_color_0 = "#20b038";
35
- $stop_color_1 = "#60d66a";
36
- }
37
-
38
- $svg = '<svg style="'.$ht_ctc_svg_css.'" width="'.$img_size.'" height="'.$img_size.'" viewBox="0 0 1219.547 1225.016">
39
- <path fill="#E0E0E0" d="M1041.858 178.02C927.206 63.289 774.753.07 612.325 0 277.617 0 5.232 272.298 5.098 606.991c-.039 106.986 27.915 211.42 81.048 303.476L0 1225.016l321.898-84.406c88.689 48.368 188.547 73.855 290.166 73.896h.258.003c334.654 0 607.08-272.346 607.222-607.023.056-162.208-63.052-314.724-177.689-429.463zm-429.533 933.963h-.197c-90.578-.048-179.402-24.366-256.878-70.339l-18.438-10.93-191.021 50.083 51-186.176-12.013-19.087c-50.525-80.336-77.198-173.175-77.16-268.504.111-278.186 226.507-504.503 504.898-504.503 134.812.056 261.519 52.604 356.814 147.965 95.289 95.36 147.728 222.128 147.688 356.948-.118 278.195-226.522 504.543-504.693 504.543z"/>
40
- <linearGradient id="htwaicona-'.$type.'" gradientUnits="userSpaceOnUse" x1="609.77" y1="1190.114" x2="609.77" y2="21.084">
41
- <stop offset="0" stop-color="'.$stop_color_0.'"/>
42
- <stop offset="1" stop-color="'.$stop_color_1.'"/>
43
- </linearGradient>
44
- <path fill="url(#htwaicona-'.$type.')" d="M27.875 1190.114l82.211-300.18c-50.719-87.852-77.391-187.523-77.359-289.602.133-319.398 260.078-579.25 579.469-579.25 155.016.07 300.508 60.398 409.898 169.891 109.414 109.492 169.633 255.031 169.57 409.812-.133 319.406-260.094 579.281-579.445 579.281-.023 0 .016 0 0 0h-.258c-96.977-.031-192.266-24.375-276.898-70.5l-307.188 80.548z"/>
45
- <image overflow="visible" opacity=".08" width="682" height="639" transform="translate(270.984 291.372)"/>
46
- <path fill-rule="evenodd" clip-rule="evenodd" fill="#FFF" d="M462.273 349.294c-11.234-24.977-23.062-25.477-33.75-25.914-8.742-.375-18.75-.352-28.742-.352-10 0-26.25 3.758-39.992 18.766-13.75 15.008-52.5 51.289-52.5 125.078 0 73.797 53.75 145.102 61.242 155.117 7.5 10 103.758 166.266 256.203 226.383 126.695 49.961 152.477 40.023 179.977 37.523s88.734-36.273 101.234-71.297c12.5-35.016 12.5-65.031 8.75-71.305-3.75-6.25-13.75-10-28.75-17.5s-88.734-43.789-102.484-48.789-23.75-7.5-33.75 7.516c-10 15-38.727 48.773-47.477 58.773-8.75 10.023-17.5 11.273-32.5 3.773-15-7.523-63.305-23.344-120.609-74.438-44.586-39.75-74.688-88.844-83.438-103.859-8.75-15-.938-23.125 6.586-30.602 6.734-6.719 15-17.508 22.5-26.266 7.484-8.758 9.984-15.008 14.984-25.008 5-10.016 2.5-18.773-1.25-26.273s-32.898-81.67-46.234-111.326z"/>
47
- <path fill="#FFF" d="M1036.898 176.091C923.562 62.677 772.859.185 612.297.114 281.43.114 12.172 269.286 12.039 600.137 12 705.896 39.633 809.13 92.156 900.13L7 1211.067l318.203-83.438c87.672 47.812 186.383 73.008 286.836 73.047h.255.003c330.812 0 600.109-269.219 600.25-600.055.055-160.343-62.328-311.108-175.649-424.53zm-424.601 923.242h-.195c-89.539-.047-177.344-24.086-253.93-69.531l-18.227-10.805-188.828 49.508 50.414-184.039-11.875-18.867c-49.945-79.414-76.312-171.188-76.273-265.422.109-274.992 223.906-498.711 499.102-498.711 133.266.055 258.516 52 352.719 146.266 94.195 94.266 146.031 219.578 145.992 352.852-.118 274.999-223.923 498.749-498.899 498.749z"/>
48
- </svg>';
49
-
50
- return $svg;
51
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
new/inc/assets/js/app.js CHANGED
@@ -1 +1 @@
1
- var ht_ctc_v="2.12.1",url=window.location.href,is_mobile="yes";void 0!==screen.width&&(is_mobile=1024<screen.width?"no":"yes");var post_title=void 0!==document.title?document.title:"";function afterdom_loaded(){"complete"==document.readyState||"interactive"==document.readyState?ht_ctc():document.addEventListener("DOMContentLoaded",ht_ctc)}function ht_ctc_loaded(){afterdom_loaded()}function ht_ctc(){var t=document.querySelector(".ht-ctc-chat");t&&hide_basedon_device(t);var e=document.querySelector(".ht-ctc-share");e&&hide_basedon_device(e);var a=document.querySelector(".ht-ctc-group");a&&hide_basedon_device(a)}function hide_basedon_device(t){var e,a,n,o;"yes"==is_mobile?"show"==t.getAttribute("data-display_mobile")&&((a=document.querySelector(".ht_ctc_desktop_"+t.getAttribute("data-return_type")))&&a.remove(),n=t.getAttribute("data-css"),e=t.getAttribute("data-position_mobile"),t.style.cssText=e+n,display(t)):"show"==t.getAttribute("data-display_desktop")&&((a=document.querySelector(".ht_ctc_mobile_"+t.getAttribute("data-return_type")))&&a.remove(),n=t.getAttribute("data-css"),o=t.getAttribute("data-position"),t.style.cssText=o+n,display(t))}function display(t){t.style.display="block"}function ht_ctc_shortcode_click(t){data_link=t.getAttribute("data-ctc-link"),data_link=encodeURI(data_link),window.open(data_link,"_blank","noopener"),ht_ctc_analytics(t)}function ht_ctc_click(t){ht_ctc_link(t),ht_ctc_analytics(t)}function ht_ctc_link(t){var e=t.getAttribute("data-return_type");if("group"==e){var a="https://chat.whatsapp.com/",n=t.getAttribute("data-group_id");window.open(a+n,"_blank","noopener")}else if("share"==e){var o=t.getAttribute("data-share_text"),i="api";"webapi"==(c=t.getAttribute("data-webandapi"))&&(i="yes"==is_mobile?"api":"web");a="https://"+i+".whatsapp.com/send";window.open(a+"?text="+o,"_blank","noopener")}else{var r=t.getAttribute("data-number"),d=t.getAttribute("data-pre_filled"),d=encodeURIComponent(d),c=t.getAttribute("data-webandapi");if(""==r&&t.classList.contains("admin"))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>");if(""==r)return void(t.innerHTML="<p>No WhatsApp Number Found!</p>");"webapi"==c?(a="yes"==is_mobile?"https://api.whatsapp.com/send":"https://web.whatsapp.com/send",window.open(a+"?phone="+r+"&text="+d,"_blank","noopener")):(a="https://wa.me/",window.open(a+r+"?text="+d,"_blank","noopener"))}}function ht_ctc_analytics(t){var e=t.getAttribute("data-return_type"),a="";"chat"==e?a=t.getAttribute("data-number"):"group"==e?a=t.getAttribute("data-group_id"):"share"==e&&(a=t.getAttribute("data-share_text")),ht_ctc_ga(e,a,t),"yes"==t.getAttribute("data-is_fb_pixel")&&ht_ctc_fb_pixel(e,a),"yes"==t.getAttribute("data-is_fb_an_enable")&&ht_ctc_fb_an(e,a)}function ht_ctc_ga(t,e,a){var n="Click to Chat for WhatsApp",o=t+": "+e,i=post_title+", "+url;"yes"==a.getAttribute("data-is_ga_enable")&&("undefined"!=typeof gtag?gtag("event",o,{event_category:n,event_label:i}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",n,o,i):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",n,o,i)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",event_category:n,event_label:i,event_action:o})}function ht_ctc_fb_pixel(t,e){"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:t,ID:e,Title:post_title,URL:url})}function ht_ctc_fb_an(t,e){var a={Category:"Click to Chat for WhatsApp"};a.return_type=t,a.ID=e,a.Label=post_title+", "+url,"undefined"!=typeof FB&&FB.AppEvents.logEvent("Click to Chat for WhatsApp",null,a)}afterdom_loaded();
1
+ var ht_ctc_v="3.0.3",url=window.location.href,is_mobile="yes";void 0!==screen.width&&(is_mobile=1024<screen.width?"no":"yes");var post_title=void 0!==document.title?document.title:"";function afterdom_loaded(){"complete"==document.readyState||"interactive"==document.readyState?ht_ctc():document.addEventListener("DOMContentLoaded",ht_ctc)}function ht_ctc_loaded(){afterdom_loaded()}function ht_ctc(){var t=document.querySelector(".ht-ctc-chat");t&&hide_basedon_device(t)}function hide_basedon_device(t){var e,a,c,n;"yes"==is_mobile?"show"==t.getAttribute("data-display_mobile")&&((a=document.querySelector(".ht_ctc_desktop_"+t.getAttribute("data-return_type")))&&a.remove(),c=t.getAttribute("data-css"),e=t.getAttribute("data-position_mobile"),t.style.cssText=e+c,display(t)):"show"==t.getAttribute("data-display_desktop")&&((a=document.querySelector(".ht_ctc_mobile_"+t.getAttribute("data-return_type")))&&a.remove(),c=t.getAttribute("data-css"),n=t.getAttribute("data-position"),t.style.cssText=n+c,display(t))}function display(e){try{var t=parseInt(e.getAttribute("data-show_effect"));jQuery(e).show(t)}catch(t){e.style.display="block"}try{ht_ctc_things(e)}catch(t){}}function ht_ctc_things(t){var e=t.getAttribute("data-an_type");setTimeout(function(){t.classList.add("ht_ctc_animation",e)},120),jQuery(".ht-ctc-chat").hover(function(){jQuery(".ht-ctc-chat .ht-ctc-cta-hover").show(120)},function(){jQuery(".ht-ctc-chat .ht-ctc-cta-hover").hide(100)})}function ht_ctc_shortcode_click(t){data_link=t.getAttribute("data-ctc-link"),data_link=encodeURI(data_link),window.open(data_link,"_blank","noopener"),ht_ctc_analytics(t)}function ht_ctc_click(t){ht_ctc_link(t),ht_ctc_analytics(t)}function ht_ctc_link(t){var e=t.getAttribute("data-number"),a=(a=t.getAttribute("data-pre_filled")).replace(/\[url]/gi,url);a=encodeURIComponent(a);var c,n=t.getAttribute("data-webandapi");""!=e?"webapi"==n?(c="yes"==is_mobile?"https://api.whatsapp.com/send":"https://web.whatsapp.com/send",window.open(c+"?phone="+e+"&text="+a,"_blank","noopener")):(c="https://wa.me/",window.open(c+e+"?text="+a,"_blank","noopener")):t.innerHTML=t.getAttribute("data-no_number")}function ht_ctc_analytics(t){var e=t.getAttribute("data-return_type"),a="";"chat"==e?a=t.getAttribute("data-number"):"group"==e?a=t.getAttribute("data-group_id"):"share"==e&&(a=t.getAttribute("data-share_text")),ht_ctc_ga(e,a,t),"yes"==t.getAttribute("data-is_fb_pixel")&&ht_ctc_fb_pixel(e,a),"yes"==t.getAttribute("data-is_fb_an_enable")&&ht_ctc_fb_an(e,a)}function ht_ctc_ga(t,e,a){var c="Click to Chat for WhatsApp",n=t+": "+e,i=post_title+", "+url;"yes"==a.getAttribute("data-is_ga_enable")&&("undefined"!=typeof gtag?gtag("event",n,{event_category:c,event_label:i}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",c,n,i):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",c,n,i)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",event_category:c,event_label:i,event_action:n})}function ht_ctc_fb_pixel(t,e){"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:t,ID:e,Title:post_title,URL:url})}function ht_ctc_fb_an(t,e){var a={Category:"Click to Chat for WhatsApp"};a.return_type=t,a.ID=e,a.Label=post_title+", "+url,"undefined"!=typeof FB&&FB.AppEvents.logEvent("Click to Chat for WhatsApp",null,a)}afterdom_loaded();
new/inc/assets/js/{app.dev.js → dev/app.dev.js} RENAMED
@@ -1,5 +1,5 @@
1
  // Click to Chat
2
- var ht_ctc_v = '2.11';
3
  var url = window.location.href;
4
 
5
  // is_mobile yes/no, desktop > 1024
@@ -28,12 +28,6 @@ function ht_ctc_loaded() {
28
  function ht_ctc() {
29
  var ht_ctc_chat = document.querySelector('.ht-ctc-chat');
30
  (ht_ctc_chat) ? hide_basedon_device(ht_ctc_chat) : '';
31
-
32
- var ht_ctc_share = document.querySelector('.ht-ctc-share');
33
- (ht_ctc_share) ? hide_basedon_device(ht_ctc_share) : '';
34
-
35
- var ht_ctc_group = document.querySelector('.ht-ctc-group');
36
- (ht_ctc_group) ? hide_basedon_device(ht_ctc_group) : '';
37
  }
38
 
39
  // Hide based on device
@@ -70,14 +64,37 @@ function hide_basedon_device(p) {
70
  function display(p) {
71
  // p.style.removeProperty('display');
72
  // var x = p.style.getPropertyValue("display");
73
- p.style.display = "block";
74
- // try {
75
- // jQuery(p).show(120);
76
- // } catch (e) {
77
- // p.style.display = "block";
78
- // }
 
 
79
  // jQuery(".ht-ctc-chat").show(120);
80
  // jQuery(".ht-ctc-chat").fadeIn();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  }
82
 
83
  // shortcode link
@@ -96,58 +113,45 @@ function ht_ctc_click(values) {
96
  ht_ctc_analytics(values);
97
  }
98
 
99
- // link - chat, share, group
100
  function ht_ctc_link(values) {
101
 
102
- var return_type = values.getAttribute('data-return_type');
 
 
 
 
103
 
104
- if(return_type == 'group') {
105
- // group
106
- var base_link = 'https://chat.whatsapp.com/';
107
- var group_id = values.getAttribute('data-group_id');
108
- window.open(base_link + group_id, '_blank', 'noopener');
109
- } else if (return_type == 'share') {
110
- // share
111
- var share_text = values.getAttribute('data-share_text');
112
- var webandapi = values.getAttribute('data-webandapi');
113
- // web/api.whatsapp or api.whatsapp
114
- var share_nav = "api";
115
- if ( 'webapi' == webandapi ) {
116
- share_nav = ( is_mobile == 'yes' ) ? "api" : "web";
117
- }
118
- var base_link = 'https://'+share_nav+'.whatsapp.com/send';
119
- window.open(base_link + '?text=' + share_text, '_blank', 'noopener');
120
- } else {
121
- // chat
122
- var number = values.getAttribute('data-number');
123
- var pre_filled = values.getAttribute('data-pre_filled');
124
- pre_filled = encodeURIComponent(pre_filled);
125
- var webandapi = values.getAttribute('data-webandapi');
126
-
127
- if ( '' == number && values.classList.contains("admin") ) {
128
- values.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>";
129
- return;
130
- } else if ( '' == number ) {
131
- values.innerHTML = "<p>No WhatsApp Number Found!</p>";
132
- return;
133
- }
134
 
135
- // web/api.whatsapp or wa.me
136
- if ( 'webapi' == webandapi ) {
137
- if (is_mobile == 'yes') {
138
- var base_link = 'https://api.whatsapp.com/send';
139
- } else {
140
- var base_link = 'https://web.whatsapp.com/send';
141
- }
142
- window.open(base_link + '?phone=' + number + '&text=' + pre_filled, '_blank', 'noopener');
143
  } else {
144
- // wa.me
145
- var base_link = 'https://wa.me/';
146
- window.open(base_link + number + '?text=' + pre_filled, '_blank', 'noopener');
147
  }
 
 
 
 
 
148
  }
 
149
  }
150
 
 
 
 
 
 
 
 
 
 
151
  // Analytics
152
  function ht_ctc_analytics(values) {
153
  var return_type = values.getAttribute('data-return_type');
@@ -218,6 +222,18 @@ function ht_ctc_fb_pixel( return_type, id ) {
218
  'URL': url
219
  });
220
  }
 
 
 
 
 
 
 
 
 
 
 
 
221
  }
222
 
223
  // FB Analytics
@@ -231,4 +247,9 @@ function ht_ctc_fb_an( return_type, id ) {
231
  if (typeof FB !== "undefined") {
232
  FB.AppEvents.logEvent( fb_event_name, null, params);
233
  }
234
- }
 
 
 
 
 
1
  // Click to Chat
2
+ var ht_ctc_v = '3.0';
3
  var url = window.location.href;
4
 
5
  // is_mobile yes/no, desktop > 1024
28
  function ht_ctc() {
29
  var ht_ctc_chat = document.querySelector('.ht-ctc-chat');
30
  (ht_ctc_chat) ? hide_basedon_device(ht_ctc_chat) : '';
 
 
 
 
 
 
31
  }
32
 
33
  // Hide based on device
64
  function display(p) {
65
  // p.style.removeProperty('display');
66
  // var x = p.style.getPropertyValue("display");
67
+ // p.style.display = "block";
68
+ try {
69
+ var dt = parseInt(p.getAttribute('data-show_effect'));
70
+ jQuery(p).show(dt);
71
+ // jQuery(p).fadeIn(1000);
72
+ } catch (e) {
73
+ p.style.display = "block";
74
+ }
75
  // jQuery(".ht-ctc-chat").show(120);
76
  // jQuery(".ht-ctc-chat").fadeIn();
77
+
78
+ try {
79
+ ht_ctc_things(p);
80
+ } catch (e) {}
81
+
82
+ }
83
+
84
+ function ht_ctc_things(p) {
85
+
86
+ // animations
87
+ var animateclass = p.getAttribute('data-an_type')
88
+ setTimeout(function () {
89
+ p.classList.add('ht_ctc_animation', animateclass);
90
+ }, 120);
91
+
92
+ // hover effects
93
+ jQuery(".ht-ctc-chat").hover(function () {
94
+ jQuery('.ht-ctc-chat .ht-ctc-cta-hover').show(120);
95
+ }, function () {
96
+ jQuery('.ht-ctc-chat .ht-ctc-cta-hover').hide(100);
97
+ });
98
  }
99
 
100
  // shortcode link
113
  ht_ctc_analytics(values);
114
  }
115
 
116
+ // link - chat
117
  function ht_ctc_link(values) {
118
 
119
+ var number = values.getAttribute('data-number');
120
+ var pre_filled = values.getAttribute('data-pre_filled');
121
+ pre_filled = pre_filled.replace(/\[url]/gi, url);
122
+ pre_filled = encodeURIComponent(pre_filled);
123
+ var webandapi = values.getAttribute('data-webandapi');
124
 
125
+ if ( '' == number ) {
126
+ values.innerHTML = values.getAttribute('data-no_number');
127
+ return;
128
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
 
130
+ // web/api.whatsapp or wa.me
131
+ if ( 'webapi' == webandapi ) {
132
+ if (is_mobile == 'yes') {
133
+ var base_link = 'https://api.whatsapp.com/send';
 
 
 
 
134
  } else {
135
+ var base_link = 'https://web.whatsapp.com/send';
 
 
136
  }
137
+ window.open(base_link + '?phone=' + number + '&text=' + pre_filled, '_blank', 'noopener');
138
+ } else {
139
+ // wa.me
140
+ var base_link = 'https://wa.me/';
141
+ window.open(base_link + number + '?text=' + pre_filled, '_blank', 'noopener');
142
  }
143
+
144
  }
145
 
146
+
147
+
148
+
149
+
150
+
151
+ /**
152
+ * Global
153
+ */
154
+
155
  // Analytics
156
  function ht_ctc_analytics(values) {
157
  var return_type = values.getAttribute('data-return_type');
222
  'URL': url
223
  });
224
  }
225
+
226
+ // if (typeof fbq !== "undefined") {
227
+ // fbq('track', 'Lead', {
228
+ // 'Category': 'Click to Chat for WhatsApp',
229
+ // 'return_type': 'Chat',
230
+ // 'Title': post_title,
231
+ // 'url': url,
232
+ // });
233
+ // }
234
+
235
+
236
+
237
  }
238
 
239
  // FB Analytics
247
  if (typeof FB !== "undefined") {
248
  FB.AppEvents.logEvent( fb_event_name, null, params);
249
  }
250
+ }
251
+
252
+
253
+ // function test_customevent() {
254
+ // console.log('custome event');
255
+ // }
new/inc/assets/js/{app.test.js → dev/app.test.js} RENAMED
File without changes
new/inc/assets/js/dev/group.dev.js ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Click to Chat - Group
2
+ (function ($) {
3
+
4
+ var is_mobile = 'yes';
5
+ if (typeof screen.width !== "undefined") {
6
+ is_mobile = (screen.width > 1024) ? "no" : "yes";
7
+ }
8
+
9
+ function group_afterdom_loaded() {
10
+ if ('complete' == document.readyState || 'interactive' == document.readyState) {
11
+ // call direclty
12
+ group_ht_ctc();
13
+ } else {
14
+ document.addEventListener('DOMContentLoaded', group_ht_ctc);
15
+ }
16
+ }
17
+ group_afterdom_loaded();
18
+
19
+ // function group_ht_ctc_loaded() {
20
+ // group_afterdom_loaded();
21
+ // }
22
+
23
+ function group_ht_ctc() {
24
+ var ht_ctc_group = document.querySelector('.ht-ctc-group');
25
+ if (ht_ctc_group) {
26
+ group_hide_basedon_device(ht_ctc_group);
27
+ ht_ctc_group.addEventListener('click', function () {
28
+ ht_ctc_group_click(ht_ctc_group);
29
+ });
30
+ }
31
+
32
+ // var ht_ctc_group_sc = document.querySelector('.ht-ctc-sc-group');
33
+ // if (ht_ctc_group_sc) {
34
+ // ht_ctc_group_sc.addEventListener('click', function () {
35
+ // ht_ctc_group_sc_click(ht_ctc_group_sc);
36
+ // });
37
+ // }
38
+
39
+ $('.ht-ctc-sc-group').click(function () {
40
+ ht_ctc_group_sc_click(this);
41
+ });
42
+
43
+ }
44
+
45
+ // Hide based on device
46
+ function group_hide_basedon_device(p) {
47
+ if (is_mobile == 'yes') {
48
+ var display_mobile = p.getAttribute('data-display_mobile');
49
+ if ('show' == display_mobile) {
50
+
51
+ // remove desktop style
52
+ var rm = document.querySelector('.ht_ctc_desktop_' + p.getAttribute('data-return_type'));
53
+ (rm) ? rm.remove() : '';
54
+
55
+ var css = p.getAttribute('data-css');
56
+ var position_mobile = p.getAttribute('data-position_mobile');
57
+ p.style.cssText = position_mobile + css;
58
+ group_display(p)
59
+ }
60
+ } else {
61
+ var display_desktop = p.getAttribute('data-display_desktop');
62
+ if ('show' == display_desktop) {
63
+
64
+ // remove mobile style
65
+ var rm = document.querySelector('.ht_ctc_mobile_' + p.getAttribute('data-return_type'));
66
+ (rm) ? rm.remove() : '';
67
+
68
+ var css = p.getAttribute('data-css');
69
+ var position = p.getAttribute('data-position');
70
+ p.style.cssText = position + css;
71
+ group_display(p)
72
+ }
73
+ }
74
+ }
75
+
76
+ function group_display(p) {
77
+ // p.style.display = "block";
78
+ try {
79
+ var dt = parseInt(p.getAttribute('data-show_effect'));
80
+ $(p).show(dt);
81
+ } catch (e) {
82
+ p.style.display = "block";
83
+ }
84
+
85
+ // hover effect
86
+ ht_ctc_group_things(p);
87
+ }
88
+
89
+ function ht_ctc_group_things(p) {
90
+
91
+ // animations
92
+ var animateclass = p.getAttribute('data-an_type')
93
+ setTimeout(function () {
94
+ p.classList.add('ht_ctc_animation', animateclass);
95
+ }, 120);
96
+
97
+ // hover effects
98
+ $(".ht-ctc-group").hover(function () {
99
+ $('.ht-ctc-group .ht-ctc-cta-hover').show(220);
100
+ }, function () {
101
+ $('.ht-ctc-group .ht-ctc-cta-hover').hide(100);
102
+ });
103
+ }
104
+
105
+ // group shortcode link
106
+ function ht_ctc_group_sc_click(values) {
107
+
108
+ data_link = values.getAttribute("data-ctc-link");
109
+ data_link = encodeURI(data_link);
110
+ window.open(data_link, '_blank', 'noopener');
111
+
112
+ try {
113
+ // (app.js fn)
114
+ ht_ctc_analytics(values);
115
+ } catch (e) { }
116
+ }
117
+
118
+ // group floating style - click
119
+ function ht_ctc_group_click(values) {
120
+ // link
121
+ ht_ctc_group_link(values);
122
+
123
+ // analytics
124
+ try {
125
+ // (app.js fn)
126
+ ht_ctc_analytics(values);
127
+ } catch(e){}
128
+ }
129
+
130
+ // link - chat, share, group
131
+ function ht_ctc_group_link(values) {
132
+
133
+ var base_link = 'https://chat.whatsapp.com/';
134
+ var group_id = values.getAttribute('data-group_id');
135
+ window.open(base_link + group_id, '_blank', 'noopener');
136
+ }
137
+
138
+ })(jQuery);
new/inc/assets/js/dev/share.dev.js ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Click to Chat - Share
2
+ (function ($) {
3
+
4
+ var is_mobile = 'yes';
5
+ if (typeof screen.width !== "undefined") {
6
+ is_mobile = (screen.width > 1024) ? "no" : "yes";
7
+ }
8
+
9
+ function share_afterdom_loaded() {
10
+ if ('complete' == document.readyState || 'interactive' == document.readyState) {
11
+ // call direclty
12
+ share_ht_ctc();
13
+ } else {
14
+ document.addEventListener('DOMContentLoaded', share_ht_ctc);
15
+ }
16
+ }
17
+ share_afterdom_loaded();
18
+
19
+ // function share_ht_ctc_loaded() {
20
+ // share_afterdom_loaded();
21
+ // }
22
+
23
+ function share_ht_ctc() {
24
+ var ht_ctc_share = document.querySelector('.ht-ctc-share');
25
+ if (ht_ctc_share) {
26
+ share_hide_basedon_device(ht_ctc_share);
27
+ ht_ctc_share.addEventListener('click', function () {
28
+ ht_ctc_share_click(ht_ctc_share);
29
+ });
30
+ }
31
+
32
+ // ht_ctc_share_sc = document.querySelector('.ht-ctc-sc-share');
33
+ // if (ht_ctc_share_sc) {
34
+ // ht_ctc_share_sc.addEventListener('click', function () {
35
+ // ht_ctc_share_sc_click(ht_ctc_share_sc);
36
+ // });
37
+ // }
38
+
39
+ $('.ht-ctc-sc-share').click(function () {
40
+ ht_ctc_share_sc_click(this);
41
+ });
42
+
43
+
44
+ }
45
+
46
+ // Hide based on device
47
+ function share_hide_basedon_device(p) {
48
+ if (is_mobile == 'yes') {
49
+ var display_mobile = p.getAttribute('data-display_mobile');
50
+ if ('show' == display_mobile) {
51
+
52
+ // remove desktop style
53
+ var rm = document.querySelector('.ht_ctc_desktop_' + p.getAttribute('data-return_type'));
54
+ (rm) ? rm.remove() : '';
55
+
56
+ var css = p.getAttribute('data-css');
57
+ var position_mobile = p.getAttribute('data-position_mobile');
58
+ p.style.cssText = position_mobile + css;
59
+ display(p)
60
+ }
61
+ } else {
62
+ var display_desktop = p.getAttribute('data-display_desktop');
63
+ if ('show' == display_desktop) {
64
+
65
+ // remove mobile style
66
+ var rm = document.querySelector('.ht_ctc_mobile_' + p.getAttribute('data-return_type'));
67
+ (rm) ? rm.remove() : '';
68
+
69
+ var css = p.getAttribute('data-css');
70
+ var position = p.getAttribute('data-position');
71
+ p.style.cssText = position + css;
72
+ display(p)
73
+ }
74
+ }
75
+ }
76
+
77
+ function display(p) {
78
+ // p.style.display = "block";
79
+ try {
80
+ var dt = parseInt(p.getAttribute('data-show_effect'));
81
+ $(p).show(dt);
82
+ } catch (e) {
83
+ p.style.display = "block";
84
+ }
85
+
86
+ // hover effect
87
+ ht_ctc_share_things(p);
88
+ }
89
+
90
+ function ht_ctc_share_things(p) {
91
+
92
+ // animations
93
+ var animateclass = p.getAttribute('data-an_type')
94
+ setTimeout(function () {
95
+ p.classList.add('ht_ctc_animation', animateclass);
96
+ }, 120);
97
+
98
+ // hover effects
99
+ $(".ht-ctc-share").hover(function () {
100
+ $('.ht-ctc-share .ht-ctc-cta-hover').show(220);
101
+ }, function () {
102
+ $('.ht-ctc-share .ht-ctc-cta-hover').hide(100);
103
+ });
104
+ }
105
+
106
+
107
+
108
+ // shortcode link
109
+ function ht_ctc_share_sc_click(values) {
110
+
111
+ data_link = values.getAttribute("data-ctc-link");
112
+ data_link = encodeURI(data_link);
113
+ window.open(data_link, '_blank', 'noopener');
114
+
115
+ try {
116
+ // (app.js fn)
117
+ ht_ctc_analytics(values);
118
+ } catch(e){}
119
+ }
120
+
121
+ // floating style - click
122
+ function ht_ctc_share_click(values) {
123
+ console.log('ht_ctc_share_click');
124
+ // link
125
+ ht_ctc_share_link(values);
126
+ // analytics
127
+ try {
128
+ // (app.js fn)
129
+ ht_ctc_analytics(values);
130
+ } catch(e){}
131
+ }
132
+
133
+ // link - chat, share, group
134
+ function ht_ctc_share_link(values) {
135
+
136
+ var share_text = values.getAttribute('data-share_text');
137
+ var webandapi = values.getAttribute('data-webandapi');
138
+ // web/api.whatsapp or api.whatsapp
139
+ var share_nav = "api";
140
+ if ('webapi' == webandapi) {
141
+ share_nav = (is_mobile == 'yes') ? "api" : "web";
142
+ }
143
+ var base_link = 'https://' + share_nav + '.whatsapp.com/send';
144
+ window.open(base_link + '?text=' + share_text, '_blank', 'noopener');
145
+ }
146
+
147
+ })(jQuery);
new/inc/assets/js/group.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(n){var o="yes";function t(){var t=document.querySelector(".ht-ctc-group");t&&(function(t){{var e,c,a,n;"yes"==o?"show"==t.getAttribute("data-display_mobile")&&((c=document.querySelector(".ht_ctc_desktop_"+t.getAttribute("data-return_type")))&&c.remove(),a=t.getAttribute("data-css"),e=t.getAttribute("data-position_mobile"),t.style.cssText=e+a,i(t)):"show"==t.getAttribute("data-display_desktop")&&((c=document.querySelector(".ht_ctc_mobile_"+t.getAttribute("data-return_type")))&&c.remove(),a=t.getAttribute("data-css"),n=t.getAttribute("data-position"),t.style.cssText=n+a,i(t))}}(t),t.addEventListener("click",function(){!function(t){!function(t){var e=t.getAttribute("data-group_id");window.open("https://chat.whatsapp.com/"+e,"_blank","noopener")}(t);try{ht_ctc_analytics(t)}catch(t){}}(t)})),n(".ht-ctc-sc-group").click(function(){!function(t){data_link=t.getAttribute("data-ctc-link"),data_link=encodeURI(data_link),window.open(data_link,"_blank","noopener");try{ht_ctc_analytics(t)}catch(t){}}(this)})}function i(e){try{var t=parseInt(e.getAttribute("data-show_effect"));n(e).show(t)}catch(t){e.style.display="block"}var c,a;a=(c=e).getAttribute("data-an_type"),setTimeout(function(){c.classList.add("ht_ctc_animation",a)},120),n(".ht-ctc-group").hover(function(){n(".ht-ctc-group .ht-ctc-cta-hover").show(220)},function(){n(".ht-ctc-group .ht-ctc-cta-hover").hide(100)})}void 0!==screen.width&&(o=1024<screen.width?"no":"yes"),"complete"==document.readyState||"interactive"==document.readyState?t():document.addEventListener("DOMContentLoaded",t)}(jQuery);
new/inc/assets/js/share.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(n){var i="yes";function t(){var t=document.querySelector(".ht-ctc-share");t&&(function(t){{var e,a,c,n;"yes"==i?"show"==t.getAttribute("data-display_mobile")&&((a=document.querySelector(".ht_ctc_desktop_"+t.getAttribute("data-return_type")))&&a.remove(),c=t.getAttribute("data-css"),e=t.getAttribute("data-position_mobile"),t.style.cssText=e+c,o(t)):"show"==t.getAttribute("data-display_desktop")&&((a=document.querySelector(".ht_ctc_mobile_"+t.getAttribute("data-return_type")))&&a.remove(),c=t.getAttribute("data-css"),n=t.getAttribute("data-position"),t.style.cssText=n+c,o(t))}}(t),t.addEventListener("click",function(){!function(t){console.log("ht_ctc_share_click"),function(t){var e=t.getAttribute("data-share_text"),a=t.getAttribute("data-webandapi"),c="api";"webapi"==a&&(c="yes"==i?"api":"web");var n="https://"+c+".whatsapp.com/send";window.open(n+"?text="+e,"_blank","noopener")}(t);try{ht_ctc_analytics(t)}catch(t){}}(t)})),n(".ht-ctc-sc-share").click(function(){!function(t){data_link=t.getAttribute("data-ctc-link"),data_link=encodeURI(data_link),window.open(data_link,"_blank","noopener");try{ht_ctc_analytics(t)}catch(t){}}(this)})}function o(e){try{var t=parseInt(e.getAttribute("data-show_effect"));n(e).show(t)}catch(t){e.style.display="block"}var a,c;c=(a=e).getAttribute("data-an_type"),setTimeout(function(){a.classList.add("ht_ctc_animation",c)},120),n(".ht-ctc-share").hover(function(){n(".ht-ctc-share .ht-ctc-cta-hover").show(220)},function(){n(".ht-ctc-share .ht-ctc-cta-hover").hide(100)})}void 0!==screen.width&&(i=1024<screen.width?"no":"yes"),"complete"==document.readyState||"interactive"==document.readyState?t():document.addEventListener("DOMContentLoaded",t)}(jQuery);
new/inc/chat/class-ht-ctc-chat.php CHANGED
@@ -14,8 +14,10 @@ class HT_CTC_Chat {
14
  public function chat() {
15
 
16
  $options = get_option('ht_ctc_chat_options');
17
-
 
18
  $ht_ctc_chat = array();
 
19
 
20
  // show/hide
21
  include HT_CTC_PLUGIN_DIR .'new/inc/commons/show-hide.php';
@@ -26,6 +28,8 @@ class HT_CTC_Chat {
26
 
27
  // position
28
  include HT_CTC_PLUGIN_DIR .'new/inc/commons/position-to-place.php';
 
 
29
 
30
  // is mobile
31
  $is_mobile = ht_ctc()->device_type->is_mobile();
@@ -33,17 +37,17 @@ class HT_CTC_Chat {
33
  $wp_device = '';
34
 
35
  // style
36
- $style_d = esc_attr( $options['style_desktop'] );
37
- $style_m = esc_attr( $options['style_mobile'] );
38
  if ( 'yes' == $is_mobile ) {
39
- $style = $style_m;
40
- $wp_device = 'mobile';
41
  } else {
42
- $style = $style_d;
43
- $wp_device = 'desktop';
44
  }
45
 
46
- $type = "chat";
47
 
48
  $page_id = get_the_ID();
49
  $page_url = get_permalink();
@@ -66,54 +70,59 @@ class HT_CTC_Chat {
66
  $ht_ctc_chat['pre_filled'] = esc_attr( $options['pre_filled'] );
67
  $ht_ctc_chat['pre_filled'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_chat['pre_filled'], 'Click to Chat for WhatsApp', 'pre_filled' );
68
 
69
- // analytics
70
- $is_ga_enable = apply_filters( 'ht_ctc_fh_is_ga_enable', 'no' );
71
- $is_fb_pixel = apply_filters( 'ht_ctc_fh_is_fb_pixel', 'no' );
72
- $is_fb_an_enable = apply_filters( 'ht_ctc_fh_is_fb_an_enable', 'no' );
73
-
74
  // webapi: web/api.whatsapp, wa: wa.me
75
- $webandapi = 'wa';
76
  if ( isset( $options['webandapi'] ) ) {
77
- $webandapi = 'webapi';
78
  }
79
 
80
- $display_mobile = (isset($options['hideon_mobile'])) ? 'hide' : 'show';
81
- $display_desktop = (isset($options['hideon_desktop'])) ? 'hide' : 'show';
82
 
83
  // number not added and is administrator
84
- $is_admin = "";
85
- if ( '' == $ht_ctc_chat['number'] && current_user_can('administrator') ) {
86
- $is_admin = "admin";
 
 
 
 
 
 
 
87
  }
88
 
89
  // class names
90
- $class_names = "ht-ctc ht-ctc-chat style-$style $wp_device ctc-analytics $is_admin";
 
 
91
 
92
- // hook
 
 
 
 
 
 
 
 
93
  $ht_ctc_chat = apply_filters( 'ht_ctc_fh_chat', $ht_ctc_chat );
94
-
95
- $ht_ctc_chat['pre_filled'] = str_replace( array('{{url}}', '{url}', '{{title}}', '{title}', '{{site}}', '{site}' ), array( $page_url, $page_url, $post_title, $post_title, HT_CTC_BLOG_NAME, HT_CTC_BLOG_NAME ), $ht_ctc_chat['pre_filled'] );
96
 
97
- // @uses at styles
98
- $call_to_action = $ht_ctc_chat['call_to_action'];
99
-
100
- if ( '' == $call_to_action ) {
101
- if ( '1' == $style || '4' == $style || '6' == $style || '8' == $style ) {
102
- $call_to_action = "WhatsApp us";
103
- }
104
- }
105
 
106
- $title = '';
107
- if ( '2' == $style || '3' == $style ) {
108
- $title = "title = '$call_to_action'";
109
- }
110
 
111
- // backend position - todo - remove this after some time... as may not need.
112
- // Fallback support - as some cache plugins are not updated the js code
113
- // js will replace this code.
114
- $backend_position = $position;
 
 
115
 
116
- $css = "display: none; cursor: pointer; z-index: 99999999;";
117
 
118
  // call style
119
  $path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style. '.php';
@@ -121,27 +130,36 @@ class HT_CTC_Chat {
121
  $path_d = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style_d. '.php';
122
  $path_m = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style_m. '.php';
123
 
124
- $othersettings = get_option('ht_ctc_othersettings');
 
 
 
 
 
 
125
 
126
 
127
  if ( is_file( $path ) ) {
128
  do_action('ht_ctc_ah_before_fixed_position');
129
  ?>
130
- <div <?php echo $title ?> onclick="ht_ctc_click(this);" class="<?php echo $class_names ?>"
131
  style="display: none; <?php echo $backend_position ?>"
132
- data-return_type="chat"
133
- data-style="<?php echo $style ?>"
134
  data-number="<?php echo $ht_ctc_chat['number'] ?>"
135
  data-pre_filled="<?php echo $ht_ctc_chat['pre_filled'] ?>"
136
- data-is_ga_enable="<?php echo $is_ga_enable ?>"
137
- data-is_fb_pixel="<?php echo $is_fb_pixel ?>"
138
- data-is_fb_an_enable="<?php echo $is_fb_an_enable ?>"
139
- data-webandapi="<?php echo $webandapi ?>"
140
- data-display_mobile="<?php echo $display_mobile ?>"
141
- data-display_desktop="<?php echo $display_desktop ?>"
142
- data-css="<?php echo $css ?>"
143
- data-position="<?php echo $position ?>"
144
- data-position_mobile="<?php echo $position_mobile ?>"
 
 
 
145
  >
146
  <?php
147
  if ( isset( $othersettings['select_styles_issue'] ) ) {
14
  public function chat() {
15
 
16
  $options = get_option('ht_ctc_chat_options');
17
+ $othersettings = get_option('ht_ctc_othersettings');
18
+
19
  $ht_ctc_chat = array();
20
+ $ht_ctc_os = array();
21
 
22
  // show/hide
23
  include HT_CTC_PLUGIN_DIR .'new/inc/commons/show-hide.php';
28
 
29
  // position
30
  include HT_CTC_PLUGIN_DIR .'new/inc/commons/position-to-place.php';
31
+ $ht_ctc_chat['position'] = $position;
32
+ $ht_ctc_chat['position_mobile'] = $position_mobile;
33
 
34
  // is mobile
35
  $is_mobile = ht_ctc()->device_type->is_mobile();
37
  $wp_device = '';
38
 
39
  // style
40
+ $ht_ctc_chat['style_d'] = esc_attr( $options['style_desktop'] );
41
+ $ht_ctc_chat['style_m'] = esc_attr( $options['style_mobile'] );
42
  if ( 'yes' == $is_mobile ) {
43
+ $ht_ctc_chat['style'] = $ht_ctc_chat['style_m'];
44
+ $wp_device = 'ctc_wp_mobile';
45
  } else {
46
+ $ht_ctc_chat['style'] = $ht_ctc_chat['style_d'];
47
+ $wp_device = 'ctc_wp_desktop';
48
  }
49
 
50
+ $ht_ctc_chat['type'] = "chat";
51
 
52
  $page_id = get_the_ID();
53
  $page_url = get_permalink();
70
  $ht_ctc_chat['pre_filled'] = esc_attr( $options['pre_filled'] );
71
  $ht_ctc_chat['pre_filled'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_chat['pre_filled'], 'Click to Chat for WhatsApp', 'pre_filled' );
72
 
 
 
 
 
 
73
  // webapi: web/api.whatsapp, wa: wa.me
74
+ $ht_ctc_chat['webandapi'] = 'wa';
75
  if ( isset( $options['webandapi'] ) ) {
76
+ $ht_ctc_chat['webandapi'] = 'webapi';
77
  }
78
 
79
+ $ht_ctc_chat['display_mobile'] = (isset($options['hideon_mobile'])) ? 'hide' : 'show';
80
+ $ht_ctc_chat['display_desktop'] = (isset($options['hideon_desktop'])) ? 'hide' : 'show';
81
 
82
  // number not added and is administrator
83
+ $no_number = "added";
84
+ $admin_url = admin_url( 'admin.php?page=click-to-chat' );
85
+ $admin_link = "<a href='$admin_url'>WhatsApp number</a>";
86
+
87
+ if ( '' == $ht_ctc_chat['number'] ) {
88
+ $no_number = "<p style='background-color: #ffffff; margin:0; border: 1px solid #fbfbfb; padding:7px; border-radius:4px; box-shadow: 5px 10px 8px #888888;'>No WhatsApp Number Found!</p>";
89
+ if ( current_user_can('administrator') ) {
90
+ $no_number = "<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 $admin_link 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>";
91
+
92
+ }
93
  }
94
 
95
  // class names
96
+ $ht_ctc_chat['class_names'] = "ht-ctc ht-ctc-chat $wp_device ctc-analytics ";
97
+
98
+ $ht_ctc_chat['css'] = "display: none; cursor: pointer; z-index: 99999999;";
99
 
100
+ // analytics
101
+ $ht_ctc_os['is_ga_enable'] = 'yes';
102
+ $ht_ctc_os['is_fb_pixel'] = 'yes';
103
+ $ht_ctc_os['is_fb_an_enable'] = 'yes';
104
+ // show effect
105
+ $ht_ctc_os['show_effect'] = '';
106
+ $ht_ctc_os['data-attributes'] = '';
107
+
108
+ // hooks
109
  $ht_ctc_chat = apply_filters( 'ht_ctc_fh_chat', $ht_ctc_chat );
110
+ $ht_ctc_os = apply_filters( 'ht_ctc_fh_os', $ht_ctc_os );
 
111
 
112
+ // pre-filled - have to run after filter hook.
113
+ $ht_ctc_chat['pre_filled'] = str_replace( array('{{url}}', '{url}', '{{title}}', '{title}', '{{site}}', '{site}' ), array( $page_url, $page_url, $post_title, $post_title, HT_CTC_BLOG_NAME, HT_CTC_BLOG_NAME ), $ht_ctc_chat['pre_filled'] );
 
 
 
 
 
 
114
 
115
+ // Fallback support - js will override this css
116
+ $backend_position = $ht_ctc_chat['position'];
 
 
117
 
118
+ // @uses at styles / easy call (after filter hook)
119
+ $style = $ht_ctc_chat['style'];
120
+ $style_d = $ht_ctc_chat['style_d'];
121
+ $style_m = $ht_ctc_chat['style_m'];
122
+ $type = $ht_ctc_chat['type'];
123
+ $call_to_action = $ht_ctc_chat['call_to_action'];
124
 
125
+ $ht_ctc_chat['class_names'] .= " style-$style ";
126
 
127
  // call style
128
  $path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style. '.php';
130
  $path_d = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style_d. '.php';
131
  $path_m = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style_m. '.php';
132
 
133
+
134
+ if ( '' == $call_to_action ) {
135
+ if ( '1' == $style || '4' == $style || '6' == $style || '8' == $style ) {
136
+ $call_to_action = "WhatsApp us";
137
+ }
138
+ }
139
+
140
 
141
 
142
  if ( is_file( $path ) ) {
143
  do_action('ht_ctc_ah_before_fixed_position');
144
  ?>
145
+ <div onclick="ht_ctc_click(this);" class="<?php echo $ht_ctc_chat['class_names'] ?>"
146
  style="display: none; <?php echo $backend_position ?>"
147
+ data-return_type="<?php echo $ht_ctc_chat['type'] ?>"
148
+ data-style="<?php echo $ht_ctc_chat['style'] ?>"
149
  data-number="<?php echo $ht_ctc_chat['number'] ?>"
150
  data-pre_filled="<?php echo $ht_ctc_chat['pre_filled'] ?>"
151
+ data-is_ga_enable="<?php echo $ht_ctc_os['is_ga_enable'] ?>"
152
+ data-is_fb_pixel="<?php echo $ht_ctc_os['is_fb_pixel'] ?>"
153
+ data-is_fb_an_enable="<?php echo $ht_ctc_os['is_fb_an_enable'] ?>"
154
+ data-webandapi="<?php echo $ht_ctc_chat['webandapi'] ?>"
155
+ data-display_mobile="<?php echo $ht_ctc_chat['display_mobile'] ?>"
156
+ data-display_desktop="<?php echo $ht_ctc_chat['display_desktop'] ?>"
157
+ data-css="<?php echo $ht_ctc_chat['css'] ?>"
158
+ data-position="<?php echo $ht_ctc_chat['position'] ?>"
159
+ data-position_mobile="<?php echo $ht_ctc_chat['position_mobile'] ?>"
160
+ data-show_effect="<?php echo $ht_ctc_os['show_effect'] ?>"
161
+ data-no_number="<?php echo $no_number ?>"
162
+ <?php echo $ht_ctc_os['data-attributes'] ?>
163
  >
164
  <?php
165
  if ( isset( $othersettings['select_styles_issue'] ) ) {
new/inc/class-ht-ctc-register.php CHANGED
@@ -39,7 +39,6 @@ class HT_CTC_Register {
39
  global $wpdb;
40
 
41
  // $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE 'ht\_ctc\_%';" );
42
- delete_option( 'ht_ctc_main_options' );
43
  delete_option( 'ht_ctc_chat_options' );
44
  delete_option( 'ht_ctc_plugin_details' );
45
  delete_option( 'ht_ctc_group' );
@@ -69,8 +68,8 @@ class HT_CTC_Register {
69
  public static function version_check() {
70
 
71
  $ht_ctc_plugin_details = get_option('ht_ctc_plugin_details');
72
-
73
- if ( isset($ht_ctc_plugin_details['version']) && HT_CTC_VERSION !== $ht_ctc_plugin_details['version'] ) {
74
  // to update the plugin - just like activate plugin
75
  self::activate();
76
 
39
  global $wpdb;
40
 
41
  // $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE 'ht\_ctc\_%';" );
 
42
  delete_option( 'ht_ctc_chat_options' );
43
  delete_option( 'ht_ctc_plugin_details' );
44
  delete_option( 'ht_ctc_group' );
68
  public static function version_check() {
69
 
70
  $ht_ctc_plugin_details = get_option('ht_ctc_plugin_details');
71
+
72
+ if ( !isset($ht_ctc_plugin_details['version']) || HT_CTC_VERSION !== $ht_ctc_plugin_details['version'] ) {
73
  // to update the plugin - just like activate plugin
74
  self::activate();
75
 
new/inc/commons/class-ht-ctc-animations.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hooks
4
+ * @since 2.8
5
+ */
6
+
7
+ if ( ! defined( 'ABSPATH' ) ) exit;
8
+
9
+ if ( ! class_exists( 'HT_CTC_Animations' ) ) :
10
+
11
+ class HT_CTC_Animations {
12
+
13
+
14
+ // public function __construct() {
15
+ // $this->base();
16
+ // }
17
+
18
+
19
+ function animations( $a ) {
20
+ ?>
21
+ <style id="ht-ctc-animations">.ht_ctc_animation {animation-duration:1s;animation-fill-mode:both;animation-delay:0s;animation-iteration-count:1;}</style>
22
+ <?php $this->$a(); ?>
23
+ <?php
24
+ }
25
+
26
+ function bounce() {
27
+ ?>
28
+ <style id="ht-ctc-an-bounce">@keyframes bounce{from,20%,53%,to{animation-timing-function:cubic-bezier(0.215,0.61,0.355,1);transform:translate3d(0,0,0)}40%,43%{animation-timing-function:cubic-bezier(0.755,0.05,0.855,0.06);transform:translate3d(0,-30px,0) scaleY(1.1)}70%{animation-timing-function:cubic-bezier(0.755,0.05,0.855,0.06);transform:translate3d(0,-15px,0) scaleY(1.05)}80%{transition-timing-function:cubic-bezier(0.215,0.61,0.355,1);transform:translate3d(0,0,0) scaleY(0.95)}90%{transform:translate3d(0,-4px,0) scaleY(1.02)}}.ht_ctc_an_bounce{animation-name:bounce;transform-origin:center bottom}</style>
29
+ <?php
30
+ }
31
+
32
+ function flash() {
33
+ ?>
34
+ <style id="ht-ctc-an-flash">@keyframes flash{from,50%,to{opacity:1}25%,75%{opacity:0}}.ht_ctc_an_flash{animation-name:flash}</style>
35
+ <?php
36
+ }
37
+
38
+ function pulse() {
39
+ ?>
40
+ <style id="ht-ctc-an-pulse">@keyframes pulse{from{transform:scale3d(1,1,1)}50%{transform:scale3d(1.05,1.05,1.05)}to{transform:scale3d(1,1,1)}}.ht_ctc_an_pulse{animation-name:pulse;animation-timing-function:ease-in-out}</style>
41
+ <?php
42
+ }
43
+
44
+
45
+
46
+ }
47
+
48
+ // new HT_CTC_Animations();
49
+
50
+ endif; // END class_exists check
new/inc/commons/class-ht-ctc-hooks.php CHANGED
@@ -24,16 +24,17 @@ class HT_CTC_Hooks {
24
  private function hooks() {
25
  // ## Action Hooks ##
26
  add_action( 'ht_ctc_ah_before_fixed_position', array($this, 'comment') );
 
27
 
28
  // if an issue with cache plugin
29
  // add_action( 'ht_ctc_ah_after_fixed_position', array($this, 'scripts') );
30
 
31
  // ## Filter Hooks ##
32
- add_filter( 'ht_ctc_fh_chat', array($this, 'ht_ctc_chat') );
33
- add_filter( 'ht_ctc_fh_is_ga_enable', array($this, 'is_ga_enable') );
34
- add_filter( 'ht_ctc_fh_is_fb_pixel', array($this, 'is_fb_pixel') );
35
- add_filter( 'ht_ctc_fh_is_fb_an_enable', array($this, 'is_fb_an_enable') );
36
  add_filter( 'ht_ctc_fh_load_app_js_bottom', array($this, 'load_app_js_bottom') );
 
 
 
37
 
38
  // previous metaboxes to new
39
  add_action( 'ht_ctc_ah_previous_metabox', array($this, 'previous_metabox') );
@@ -43,6 +44,30 @@ class HT_CTC_Hooks {
43
  /**
44
  * Action Hooks
45
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
  // comment before floting styles
48
  function comment() {
@@ -50,6 +75,7 @@ class HT_CTC_Hooks {
50
  echo $comment;
51
  }
52
 
 
53
  function scripts() {
54
 
55
  // autoptimize cache plugin
@@ -67,7 +93,7 @@ class HT_CTC_Hooks {
67
  */
68
 
69
  // number format
70
- function ht_ctc_chat( $ht_ctc_chat ) {
71
 
72
  // Number format
73
  // if random number feature, this have to modify (ltrim, preg_replace)
@@ -77,25 +103,36 @@ class HT_CTC_Hooks {
77
  $ht_ctc_chat['number'] = ltrim( $ht_ctc_chat['number'], '0' );
78
  }
79
 
 
80
  return $ht_ctc_chat;
81
  }
82
 
 
 
83
 
84
- // is_ga_enable
85
- function is_ga_enable( $is_ga_enable ) {
86
- return (isset( $this->main_options['google_analytics'] )) ? 'yes' : $is_ga_enable;
87
- }
88
 
89
- // is_fb_pixel
90
- function is_fb_pixel( $is_fb_pixel ) {
91
- return (isset( $this->main_options['fb_pixel'] )) ? 'yes' : $is_fb_pixel;
92
- }
93
 
94
- // is_fb_an_enable
95
- function is_fb_an_enable( $is_fb_an_enable ) {
96
- return (isset( $this->other_options['fb_analytics'] )) ? 'yes' : $is_fb_an_enable;
 
 
 
 
 
 
 
 
 
97
  }
98
 
 
 
99
  function load_app_js_bottom( $load_app_js_bottom ) {
100
 
101
  // compatibility
24
  private function hooks() {
25
  // ## Action Hooks ##
26
  add_action( 'ht_ctc_ah_before_fixed_position', array($this, 'comment') );
27
+ add_action( 'ht_ctc_ah_before_fixed_position', array($this, 'css_styles') );
28
 
29
  // if an issue with cache plugin
30
  // add_action( 'ht_ctc_ah_after_fixed_position', array($this, 'scripts') );
31
 
32
  // ## Filter Hooks ##
33
+ add_filter( 'ht_ctc_fh_chat', array($this, 'chat_settings') );
 
 
 
34
  add_filter( 'ht_ctc_fh_load_app_js_bottom', array($this, 'load_app_js_bottom') );
35
+
36
+ // other settings
37
+ add_filter( 'ht_ctc_fh_os', array($this, 'other_settings') );
38
 
39
  // previous metaboxes to new
40
  add_action( 'ht_ctc_ah_previous_metabox', array($this, 'previous_metabox') );
44
  /**
45
  * Action Hooks
46
  */
47
+
48
+ // css styles - before fixed position
49
+ function css_styles() {
50
+
51
+ $othersettings = get_option('ht_ctc_othersettings');
52
+
53
+
54
+ // display effect - if ? scale from center
55
+ if ( isset($othersettings['show_effect']) && 'From Center' == $othersettings['show_effect'] ) {
56
+ ?>
57
+ <style id="ht_ctc_fromcenter">@keyframes ht_ctc_fromcenter{from{transform:scale(0);}to{transform: scale(1);}}.ht-ctc{animation: ht_ctc_fromcenter .25s;}</style>
58
+ <?php
59
+ }
60
+
61
+ // Animation styles
62
+ $an_type = ( isset( $othersettings['an_type']) ) ? esc_attr( $othersettings['an_type'] ) : '';
63
+
64
+ if ( '' !== $an_type && 'no-animation' !== $an_type ) {
65
+ include_once HT_CTC_PLUGIN_DIR .'new/inc/commons/class-ht-ctc-animations.php';
66
+ $animations = new HT_CTC_Animations();
67
+ $animations->animations( $an_type );
68
+ }
69
+
70
+ }
71
 
72
  // comment before floting styles
73
  function comment() {
75
  echo $comment;
76
  }
77
 
78
+ // scripts - after fixed position
79
  function scripts() {
80
 
81
  // autoptimize cache plugin
93
  */
94
 
95
  // number format
96
+ function chat_settings( $ht_ctc_chat ) {
97
 
98
  // Number format
99
  // if random number feature, this have to modify (ltrim, preg_replace)
103
  $ht_ctc_chat['number'] = ltrim( $ht_ctc_chat['number'], '0' );
104
  }
105
 
106
+
107
  return $ht_ctc_chat;
108
  }
109
 
110
+ // other settings
111
+ function other_settings( $ht_ctc_os ) {
112
 
113
+ $othersettings = get_option('ht_ctc_othersettings');
 
 
 
114
 
115
+ $ht_ctc_os['show_effect'] = (isset($othersettings['show_effect'])) ? esc_attr($othersettings['show_effect']) : '';
116
+ $ht_ctc_os['is_ga_enable'] = (isset( $othersettings['google_analytics'] )) ? 'yes' : 'no';
117
+ $ht_ctc_os['is_fb_pixel'] = (isset( $othersettings['fb_pixel'] )) ? 'yes' : 'no';
118
+ $ht_ctc_os['is_fb_an_enable'] = (isset( $othersettings['fb_analytics'] )) ? 'yes' : 'no';
119
 
120
+ // show effect ? if 'From Corner' - then return time (from center - this->css_styles() handles)
121
+ if ( 'From Corner' == $ht_ctc_os['show_effect'] ) {
122
+ $ht_ctc_os['show_effect'] = 120;
123
+ }
124
+
125
+ // Animations
126
+ $an_type = ( isset( $othersettings['an_type']) ) ? esc_attr( $othersettings['an_type'] ) : 'no-animation';
127
+ if ( 'no-animation' !== $an_type ) {
128
+ $ht_ctc_os['data-attributes'] = "data-an_type='ht_ctc_an_$an_type' ";
129
+ }
130
+
131
+ return $ht_ctc_os;
132
  }
133
 
134
+
135
+
136
  function load_app_js_bottom( $load_app_js_bottom ) {
137
 
138
  // compatibility
new/inc/commons/class-ht-ctc-scripts.php CHANGED
@@ -20,6 +20,8 @@ class HT_CTC_Scripts {
20
  */
21
  function register_scripts() {
22
 
 
 
23
  // true/false
24
  $load_app_js_bottom = apply_filters( 'ht_ctc_fh_load_app_js_bottom', true );
25
 
@@ -32,11 +34,29 @@ class HT_CTC_Scripts {
32
  // js
33
  if ('production' == HT_CTC_ENVIRONMENT ) {
34
  $js = 'app.js';
 
 
35
  } else {
36
- $js = 'app.dev.js';
 
 
37
  }
 
 
38
  wp_enqueue_script( 'ht_ctc_app_js', plugins_url( "new/inc/assets/js/$js", HT_CTC_PLUGIN_FILE ), array ( 'jquery' ), HT_CTC_VERSION, $load_app_js_bottom );
39
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  }
41
 
42
  }
20
  */
21
  function register_scripts() {
22
 
23
+ $ht_ctc_othersettings = get_option('ht_ctc_othersettings');
24
+
25
  // true/false
26
  $load_app_js_bottom = apply_filters( 'ht_ctc_fh_load_app_js_bottom', true );
27
 
34
  // js
35
  if ('production' == HT_CTC_ENVIRONMENT ) {
36
  $js = 'app.js';
37
+ $group_js = 'group.js';
38
+ $share_js = 'share.js';
39
  } else {
40
+ $js = 'dev/app.dev.js';
41
+ $group_js = 'dev/group.dev.js';
42
+ $share_js = 'dev/share.dev.js';
43
  }
44
+
45
+ // app.js for all (chat)
46
  wp_enqueue_script( 'ht_ctc_app_js', plugins_url( "new/inc/assets/js/$js", HT_CTC_PLUGIN_FILE ), array ( 'jquery' ), HT_CTC_VERSION, $load_app_js_bottom );
47
 
48
+
49
+ // group.js
50
+ if ( isset ( $ht_ctc_othersettings['enable_group'] ) ) {
51
+ wp_enqueue_script( 'ht_ctc_group_js', plugins_url( "new/inc/assets/js/$group_js", HT_CTC_PLUGIN_FILE ), array ( 'jquery', 'ht_ctc_app_js' ), HT_CTC_VERSION, $load_app_js_bottom );
52
+ }
53
+
54
+ // share.js
55
+ if ( isset ( $ht_ctc_othersettings['enable_share'] ) ) {
56
+ wp_enqueue_script( 'ht_ctc_share_js', plugins_url( "new/inc/assets/js/$share_js", HT_CTC_PLUGIN_FILE ), array ( 'jquery', 'ht_ctc_app_js' ), HT_CTC_VERSION, $load_app_js_bottom );
57
+ }
58
+
59
+
60
  }
61
 
62
  }
new/inc/group/class-ht-ctc-group-shortcode.php CHANGED
@@ -147,13 +147,13 @@ class HT_CTC_Group_Shortcode {
147
  $sc_path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles-shortcode/sc-style-' . $style. '.php';
148
 
149
  if ( is_file( $sc_path ) ) {
150
- $o .= '<div onclick="ht_ctc_shortcode_click(this);" data-ctc-link="'.$link.'" data-return_type="'.$return_type.'" data-group_id="'.$group_id.'" data-is_ga_enable="'.$is_ga_enable.'" data-is_fb_pixel="'.$is_fb_pixel.'" data-is_fb_an_enable="'.$is_fb_an_enable.'" style="display: inline; cursor: pointer; z-index: 99999999; '.$css.'" class="'.$class_names.' ht-ctc-inline">';
151
  include $sc_path;
152
  $o .= '</div>';
153
  } else {
154
  // if style is not in the list..
155
  $img_link = plugins_url("./new/inc/assets/img/whatsapp-logo.svg", HT_CTC_PLUGIN_FILE );
156
- $o .= '<div onclick="ht_ctc_shortcode_click(this);" data-ctc-link="'.$link.'" data-return_type="'.$return_type.'" data-is_ga_enable="'.$is_ga_enable.'" data-is_fb_pixel="'.$is_fb_pixel.'" data-is_fb_an_enable="'.$is_fb_an_enable.'" style="display: inline; cursor: pointer; z-index: 99999999; '.$css.'" class="'.$class_names.' ht-ctc-inline">';
157
  $o .= '<img class="img-icon-sc sc_item pointer style-3-sc" src="'.$img_link.'" alt="WhatsApp chat" style="height: 50px; '.$css.' " >';
158
  $o .= '</div>';
159
  }
147
  $sc_path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles-shortcode/sc-style-' . $style. '.php';
148
 
149
  if ( is_file( $sc_path ) ) {
150
+ $o .= '<div data-ctc-link="'.$link.'" data-return_type="'.$return_type.'" data-group_id="'.$group_id.'" data-is_ga_enable="'.$is_ga_enable.'" data-is_fb_pixel="'.$is_fb_pixel.'" data-is_fb_an_enable="'.$is_fb_an_enable.'" style="display: inline; cursor: pointer; z-index: 99999999; '.$css.'" class="'.$class_names.' ht-ctc-inline">';
151
  include $sc_path;
152
  $o .= '</div>';
153
  } else {
154
  // if style is not in the list..
155
  $img_link = plugins_url("./new/inc/assets/img/whatsapp-logo.svg", HT_CTC_PLUGIN_FILE );
156
+ $o .= '<div data-ctc-link="'.$link.'" data-return_type="'.$return_type.'" data-is_ga_enable="'.$is_ga_enable.'" data-is_fb_pixel="'.$is_fb_pixel.'" data-is_fb_an_enable="'.$is_fb_an_enable.'" style="display: inline; cursor: pointer; z-index: 99999999; '.$css.'" class="'.$class_names.' ht-ctc-inline">';
157
  $o .= '<img class="img-icon-sc sc_item pointer style-3-sc" src="'.$img_link.'" alt="WhatsApp chat" style="height: 50px; '.$css.' " >';
158
  $o .= '</div>';
159
  }
new/inc/group/class-ht-ctc-group.php CHANGED
@@ -19,6 +19,10 @@ class HT_CTC_Group {
19
  public function group() {
20
 
21
  $options = get_option('ht_ctc_group');
 
 
 
 
22
 
23
  // show/hide
24
  include HT_CTC_PLUGIN_DIR .'new/inc/commons/show-hide.php';
@@ -29,30 +33,32 @@ class HT_CTC_Group {
29
 
30
  // position
31
  include HT_CTC_PLUGIN_DIR .'new/inc/commons/position-to-place.php';
32
-
 
 
33
  // is mobile to select styles
34
  $is_mobile = ht_ctc()->device_type->is_mobile();
35
 
36
  // style
37
- $style_d = esc_attr( $options['style_desktop'] );
38
- $style_m = esc_attr( $options['style_mobile'] );
39
  if ( 'yes' == $is_mobile ) {
40
- $style = $style_m;
41
  } else {
42
- $style = $style_d;
43
  }
44
 
45
- $type = "group";
46
 
47
  // call to action
48
- $call_to_action = esc_attr( $options['call_to_action'] );
49
- $call_to_action = apply_filters( 'wpml_translate_single_string', $call_to_action, 'Click to Chat for WhatsApp', 'call_to_action__group' );
50
 
51
  // class names
52
- $class_names = "ht-ctc ht-ctc-group style-$style";
53
 
54
  // group id
55
- $group_id = esc_attr( $options['group_id'] );
56
 
57
  // group_id - at page level
58
  $page_id = get_the_ID();
@@ -62,22 +68,47 @@ class HT_CTC_Group {
62
  $group_id = $page_group_id;
63
  }
64
 
65
- $group_id = apply_filters( 'wpml_translate_single_string', $group_id, 'Click to Chat for WhatsApp', 'group_id__group' );
66
 
67
  // analytics
68
  $is_ga_enable = apply_filters( 'ht_ctc_fh_is_ga_enable', 'no' );
69
  $is_fb_pixel = apply_filters( 'ht_ctc_fh_is_fb_pixel', 'no' );
70
  $is_fb_an_enable = apply_filters( 'ht_ctc_fh_is_fb_an_enable', 'no' );
71
 
72
- $display_mobile = (isset($options['hideon_mobile'])) ? 'hide' : 'show';
73
- $display_desktop = (isset($options['hideon_desktop'])) ? 'hide' : 'show';
 
74
 
75
- $title = '';
76
- if ( '2' == $style || '3' == $style ) {
77
- $title = "title = '$call_to_action'";
78
- }
79
 
80
- $css = "display: none; cursor: pointer; z-index: 99999999;";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
 
82
  // call style
83
  $path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style. '.php';
@@ -85,23 +116,24 @@ class HT_CTC_Group {
85
  $path_d = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style_d. '.php';
86
  $path_m = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style_m. '.php';
87
 
88
- $othersettings = get_option('ht_ctc_othersettings');
89
 
90
  if ( is_file( $path ) ) {
91
  do_action('ht_ctc_ah_before_fixed_position');
92
  ?>
93
- <div <?php echo $title ?> onclick="ht_ctc_click(this);" class="<?php echo $class_names ?>"
94
  style="display: none;"
95
- data-return_type="group"
96
- data-group_id="<?php echo $group_id ?>"
97
- data-is_ga_enable="<?php echo $is_ga_enable ?>"
98
- data-is_fb_pixel="<?php echo $is_fb_pixel ?>"
99
- data-is_fb_an_enable="<?php echo $is_fb_an_enable ?>"
100
- data-display_mobile="<?php echo $display_mobile ?>"
101
- data-display_desktop="<?php echo $display_desktop ?>"
102
- data-css="<?php echo $css ?>"
103
- data-position="<?php echo $position ?>"
104
- data-position_mobile="<?php echo $position_mobile ?>"
 
 
105
  >
106
  <?php
107
  if ( isset( $othersettings['select_styles_issue'] ) ) {
19
  public function group() {
20
 
21
  $options = get_option('ht_ctc_group');
22
+ $othersettings = get_option('ht_ctc_othersettings');
23
+
24
+ $ht_ctc_group = array();
25
+ $ht_ctc_os = array();
26
 
27
  // show/hide
28
  include HT_CTC_PLUGIN_DIR .'new/inc/commons/show-hide.php';
33
 
34
  // position
35
  include HT_CTC_PLUGIN_DIR .'new/inc/commons/position-to-place.php';
36
+ $ht_ctc_group['position'] = $position;
37
+ $ht_ctc_group['position_mobile'] = $position_mobile;
38
+
39
  // is mobile to select styles
40
  $is_mobile = ht_ctc()->device_type->is_mobile();
41
 
42
  // style
43
+ $ht_ctc_group['style_d'] = esc_attr( $options['style_desktop'] );
44
+ $ht_ctc_group['style_m'] = esc_attr( $options['style_mobile'] );
45
  if ( 'yes' == $is_mobile ) {
46
+ $ht_ctc_group['style'] = $ht_ctc_group['style_m'];
47
  } else {
48
+ $ht_ctc_group['style'] = $ht_ctc_group['style_d'];
49
  }
50
 
51
+ $ht_ctc_group['type'] = "group";
52
 
53
  // call to action
54
+ $ht_ctc_group['call_to_action'] = esc_attr( $options['call_to_action'] );
55
+ $ht_ctc_group['call_to_action'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_group['call_to_action'], 'Click to Chat for WhatsApp', 'call_to_action__group' );
56
 
57
  // class names
58
+ $ht_ctc_group['class_names'] = "ht-ctc ht-ctc-group ";
59
 
60
  // group id
61
+ $ht_ctc_group['group_id'] = esc_attr( $options['group_id'] );
62
 
63
  // group_id - at page level
64
  $page_id = get_the_ID();
68
  $group_id = $page_group_id;
69
  }
70
 
71
+ $ht_ctc_group['group_id'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_group['group_id'], 'Click to Chat for WhatsApp', 'group_id__group' );
72
 
73
  // analytics
74
  $is_ga_enable = apply_filters( 'ht_ctc_fh_is_ga_enable', 'no' );
75
  $is_fb_pixel = apply_filters( 'ht_ctc_fh_is_fb_pixel', 'no' );
76
  $is_fb_an_enable = apply_filters( 'ht_ctc_fh_is_fb_an_enable', 'no' );
77
 
78
+ $ht_ctc_group['display_mobile'] = (isset($options['hideon_mobile'])) ? 'hide' : 'show';
79
+ $ht_ctc_group['display_desktop'] = (isset($options['hideon_desktop'])) ? 'hide' : 'show';
80
+
81
 
 
 
 
 
82
 
83
+ $ht_ctc_group['css'] = "display: none; cursor: pointer; z-index: 99999999;";
84
+
85
+ // analytics
86
+ $ht_ctc_os['is_ga_enable'] = 'yes';
87
+ $ht_ctc_os['is_fb_pixel'] = 'yes';
88
+ $ht_ctc_os['is_fb_an_enable'] = 'yes';
89
+ // show effect
90
+ $ht_ctc_os['show_effect'] = '';
91
+ $ht_ctc_os['data-attributes'] = '';
92
+
93
+ // hooks
94
+ $ht_ctc_group = apply_filters( 'ht_ctc_fh_group', $ht_ctc_group );
95
+ $ht_ctc_os = apply_filters( 'ht_ctc_fh_os', $ht_ctc_os );
96
+
97
+
98
+ // @uses at styles / easy call (after filter hook)
99
+ $style = $ht_ctc_group['style'];
100
+ $style_d = $ht_ctc_group['style_d'];
101
+ $style_m = $ht_ctc_group['style_m'];
102
+ $type = $ht_ctc_group['type'];
103
+ $call_to_action = $ht_ctc_group['call_to_action'];
104
+
105
+ $ht_ctc_group['class_names'] .= " style-$style ";
106
+
107
+ if ( '' == $call_to_action ) {
108
+ if ( '1' == $style || '4' == $style || '6' == $style || '8' == $style ) {
109
+ $call_to_action = "WhatsApp Share";
110
+ }
111
+ }
112
 
113
  // call style
114
  $path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style. '.php';
116
  $path_d = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style_d. '.php';
117
  $path_m = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style_m. '.php';
118
 
 
119
 
120
  if ( is_file( $path ) ) {
121
  do_action('ht_ctc_ah_before_fixed_position');
122
  ?>
123
+ <div class="<?php echo $ht_ctc_group['class_names'] ?>"
124
  style="display: none;"
125
+ data-return_type="<?php echo $ht_ctc_group['type'] ?>"
126
+ data-group_id="<?php echo $ht_ctc_group['group_id'] ?>"
127
+ data-is_ga_enable="<?php echo $ht_ctc_os['is_ga_enable'] ?>"
128
+ data-is_fb_pixel="<?php echo $ht_ctc_os['is_fb_pixel'] ?>"
129
+ data-is_fb_an_enable="<?php echo $ht_ctc_os['is_fb_an_enable'] ?>"
130
+ data-display_mobile="<?php echo $ht_ctc_group['display_mobile'] ?>"
131
+ data-display_desktop="<?php echo $ht_ctc_group['display_desktop'] ?>"
132
+ data-css="<?php echo $ht_ctc_group['css'] ?>"
133
+ data-position="<?php echo $ht_ctc_group['position'] ?>"
134
+ data-position_mobile="<?php echo $ht_ctc_group['position_mobile'] ?>"
135
+ data-show_effect="<?php echo $ht_ctc_os['show_effect'] ?>"
136
+ <?php echo $ht_ctc_os['data-attributes'] ?>
137
  >
138
  <?php
139
  if ( isset( $othersettings['select_styles_issue'] ) ) {
new/inc/share/class-ht-ctc-share-shortcode.php CHANGED
@@ -168,13 +168,13 @@ class HT_CTC_Share_Shortcode {
168
  $sc_path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles-shortcode/sc-style-' . $style. '.php';
169
 
170
  if ( is_file( $sc_path ) ) {
171
- $o .= '<div onclick="ht_ctc_shortcode_click(this);" data-ctc-link="'.$link.'" data-return_type="'.$return_type.'" data-share_text="'.$share_text.'" data-is_ga_enable="'.$is_ga_enable.'" data-is_fb_pixel="'.$is_fb_pixel.'" data-is_fb_an_enable="'.$is_fb_an_enable.'" style="display: inline; cursor: pointer; z-index: 99999999; '.$css.'" class="'.$class_names.' ht-ctc-inline">';
172
  include $sc_path;
173
  $o .= '</div>';
174
  } else {
175
  // if style is not in the list..
176
  $img_link = plugins_url("./new/inc/assets/img/whatsapp-logo.svg", HT_CTC_PLUGIN_FILE );
177
- $o .= '<div onclick="ht_ctc_shortcode_click(this);" data-ctc-link="'.$link.'" data-return_type="'.$return_type.'" data-is_ga_enable="'.$is_ga_enable.'" data-is_fb_pixel="'.$is_fb_pixel.'" data-is_fb_an_enable="'.$is_fb_an_enable.'" style="display: inline; cursor: pointer; z-index: 99999999; '.$css.'" class="'.$class_names.' ht-ctc-inline">';
178
  $o .= '<img class="img-icon-sc sc_item pointer style-3-sc" src="'.$img_link.'" alt="WhatsApp chat" style="height: 50px; '.$css.' " >';
179
  $o .= '</div>';
180
  }
168
  $sc_path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles-shortcode/sc-style-' . $style. '.php';
169
 
170
  if ( is_file( $sc_path ) ) {
171
+ $o .= '<div data-ctc-link="'.$link.'" data-return_type="'.$return_type.'" data-share_text="'.$share_text.'" data-is_ga_enable="'.$is_ga_enable.'" data-is_fb_pixel="'.$is_fb_pixel.'" data-is_fb_an_enable="'.$is_fb_an_enable.'" style="display: inline; cursor: pointer; z-index: 99999999; '.$css.'" class="'.$class_names.' ht-ctc-inline">';
172
  include $sc_path;
173
  $o .= '</div>';
174
  } else {
175
  // if style is not in the list..
176
  $img_link = plugins_url("./new/inc/assets/img/whatsapp-logo.svg", HT_CTC_PLUGIN_FILE );
177
+ $o .= '<div data-ctc-link="'.$link.'" data-return_type="'.$return_type.'" data-is_ga_enable="'.$is_ga_enable.'" data-is_fb_pixel="'.$is_fb_pixel.'" data-is_fb_an_enable="'.$is_fb_an_enable.'" style="display: inline; cursor: pointer; z-index: 99999999; '.$css.'" class="'.$class_names.' ht-ctc-inline">';
178
  $o .= '<img class="img-icon-sc sc_item pointer style-3-sc" src="'.$img_link.'" alt="WhatsApp chat" style="height: 50px; '.$css.' " >';
179
  $o .= '</div>';
180
  }
new/inc/share/class-ht-ctc-share.php CHANGED
@@ -19,13 +19,17 @@ class HT_CTC_Share {
19
  public function share() {
20
 
21
  $options = get_option('ht_ctc_share');
 
 
 
 
22
 
23
  // share text
24
- $share_text = esc_attr( $options['share_text'] );
25
- $share_text = apply_filters( 'wpml_translate_single_string', $share_text, 'Click to Chat for WhatsApp', 'share_text__share' );
26
 
27
  // return if share text is blank
28
- if ( '' == $share_text ) {
29
  return;
30
  }
31
 
@@ -38,27 +42,29 @@ class HT_CTC_Share {
38
 
39
  // position
40
  include HT_CTC_PLUGIN_DIR .'new/inc/commons/position-to-place.php';
41
-
 
 
42
  // is mobile to select styles
43
  $is_mobile = ht_ctc()->device_type->is_mobile();
44
 
45
  // style
46
- $style_d = esc_attr( $options['style_desktop'] );
47
- $style_m = esc_attr( $options['style_mobile'] );
48
  if ( 'yes' == $is_mobile ) {
49
- $style = $style_m;
50
  } else {
51
- $style = $style_d;
52
  }
53
 
54
- $type = "share";
55
 
56
  // call to action
57
- $call_to_action = esc_html( $options['call_to_action'] );
58
- $call_to_action = apply_filters( 'wpml_translate_single_string', $call_to_action, 'Click to Chat for WhatsApp', 'call_to_action__share' );
59
 
60
  // class names
61
- $class_names = "ht-ctc ht-ctc-share style-$style";
62
 
63
  $page_url = get_permalink();
64
  $post_title = esc_html( get_the_title() );
@@ -69,29 +75,45 @@ class HT_CTC_Share {
69
  $post_title = HT_CTC_BLOG_NAME;
70
  }
71
 
72
- $share_text = str_replace( array('{{url}}', '{url}', '{{title}}', '{title}', '{{site}}', '{site}' ), array( $page_url, $page_url, $post_title, $post_title, HT_CTC_BLOG_NAME, HT_CTC_BLOG_NAME ), $share_text );
73
-
74
- // analytics
75
- $is_ga_enable = apply_filters( 'ht_ctc_fh_is_ga_enable', 'no' );
76
- $is_fb_pixel = apply_filters( 'ht_ctc_fh_is_fb_pixel', 'no' );
77
- $is_fb_an_enable = apply_filters( 'ht_ctc_fh_is_fb_an_enable', 'no' );
78
-
79
 
80
  // webapi: web/api.whatsapp, api: api.whatsapp
81
- $webandapi = 'api';
82
  if ( isset( $options['webandapi'] ) ) {
83
- $webandapi = 'webapi';
84
  }
85
 
86
- $display_mobile = (isset($options['hideon_mobile'])) ? 'hide' : 'show';
87
- $display_desktop = (isset($options['hideon_desktop'])) ? 'hide' : 'show';
88
 
89
- $title = '';
90
- if ( '2' == $style || '3' == $style ) {
91
- $title = "title = '$call_to_action'";
92
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
 
94
- $css = "display: none; cursor: pointer; z-index: 99999999;";
 
 
 
 
95
 
96
  // call style
97
  $path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style. '.php';
@@ -99,24 +121,26 @@ class HT_CTC_Share {
99
  $path_d = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style_d. '.php';
100
  $path_m = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style_m. '.php';
101
 
102
- $othersettings = get_option('ht_ctc_othersettings');
103
 
104
  if ( is_file( $path ) ) {
105
  do_action('ht_ctc_ah_before_fixed_position');
 
106
  ?>
107
- <div <?php echo $title ?> onclick="ht_ctc_click(this);" class="<?php echo $class_names ?>"
108
  style="display: none;"
109
- data-return_type="share"
110
- data-share_text="<?php echo $share_text ?>"
111
- data-is_ga_enable="<?php echo $is_ga_enable ?>"
112
- data-is_fb_pixel="<?php echo $is_fb_pixel ?>"
113
- data-is_fb_an_enable="<?php echo $is_fb_an_enable ?>"
114
- data-webandapi="<?php echo $webandapi ?>"
115
- data-display_mobile="<?php echo $display_mobile ?>"
116
- data-display_desktop="<?php echo $display_desktop ?>"
117
- data-css="<?php echo $css ?>"
118
- data-position="<?php echo $position ?>"
119
- data-position_mobile="<?php echo $position_mobile ?>"
 
 
120
  >
121
  <?php
122
  if ( isset( $othersettings['select_styles_issue'] ) ) {
19
  public function share() {
20
 
21
  $options = get_option('ht_ctc_share');
22
+ $othersettings = get_option('ht_ctc_othersettings');
23
+
24
+ $ht_ctc_share = array();
25
+ $ht_ctc_os = array();
26
 
27
  // share text
28
+ $ht_ctc_share['share_text'] = esc_attr( $options['share_text'] );
29
+ $ht_ctc_share['share_text'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_share['share_text'], 'Click to Chat for WhatsApp', 'share_text__share' );
30
 
31
  // return if share text is blank
32
+ if ( '' == $ht_ctc_share['share_text'] ) {
33
  return;
34
  }
35
 
42
 
43
  // position
44
  include HT_CTC_PLUGIN_DIR .'new/inc/commons/position-to-place.php';
45
+ $ht_ctc_share['position'] = $position;
46
+ $ht_ctc_share['position_mobile'] = $position_mobile;
47
+
48
  // is mobile to select styles
49
  $is_mobile = ht_ctc()->device_type->is_mobile();
50
 
51
  // style
52
+ $ht_ctc_share['style_d'] = esc_attr( $options['style_desktop'] );
53
+ $ht_ctc_share['style_m'] = esc_attr( $options['style_mobile'] );
54
  if ( 'yes' == $is_mobile ) {
55
+ $ht_ctc_share['style'] = $ht_ctc_share['style_m'];
56
  } else {
57
+ $ht_ctc_share['style'] = $ht_ctc_share['style_d'];
58
  }
59
 
60
+ $ht_ctc_share['type'] = "share";
61
 
62
  // call to action
63
+ $ht_ctc_share['call_to_action'] = esc_html( $options['call_to_action'] );
64
+ $ht_ctc_share['call_to_action'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_share['call_to_action'], 'Click to Chat for WhatsApp', 'call_to_action__share' );
65
 
66
  // class names
67
+ $ht_ctc_share['class_names'] = " ht-ctc ht-ctc-share ";
68
 
69
  $page_url = get_permalink();
70
  $post_title = esc_html( get_the_title() );
75
  $post_title = HT_CTC_BLOG_NAME;
76
  }
77
 
78
+ $ht_ctc_share['share_text'] = str_replace( array('{{url}}', '{url}', '{{title}}', '{title}', '{{site}}', '{site}' ), array( $page_url, $page_url, $post_title, $post_title, HT_CTC_BLOG_NAME, HT_CTC_BLOG_NAME ), $ht_ctc_share['share_text'] );
 
 
 
 
 
 
79
 
80
  // webapi: web/api.whatsapp, api: api.whatsapp
81
+ $ht_ctc_share['webandapi'] = 'api';
82
  if ( isset( $options['webandapi'] ) ) {
83
+ $ht_ctc_share['webandapi'] = 'webapi';
84
  }
85
 
86
+ $ht_ctc_share['display_mobile'] = (isset($options['hideon_mobile'])) ? 'hide' : 'show';
87
+ $ht_ctc_share['display_desktop'] = (isset($options['hideon_desktop'])) ? 'hide' : 'show';
88
 
89
+ $ht_ctc_share['css'] = "display: none; cursor: pointer; z-index: 99999999;";
90
+
91
+ // analytics
92
+ $ht_ctc_os['is_ga_enable'] = 'yes';
93
+ $ht_ctc_os['is_fb_pixel'] = 'yes';
94
+ $ht_ctc_os['is_fb_an_enable'] = 'yes';
95
+ // show effect
96
+ $ht_ctc_os['show_effect'] = '';
97
+ $ht_ctc_os['data-attributes'] = '';
98
+
99
+ // hooks
100
+ $ht_ctc_share = apply_filters( 'ht_ctc_fh_share', $ht_ctc_share );
101
+ $ht_ctc_os = apply_filters( 'ht_ctc_fh_os', $ht_ctc_os );
102
+
103
+ // @uses at styles / easy call (after filter hook)
104
+ $style = $ht_ctc_share['style'];
105
+ $style_d = $ht_ctc_share['style_d'];
106
+ $style_m = $ht_ctc_share['style_m'];
107
+ $type = $ht_ctc_share['type'];
108
+ $call_to_action = $ht_ctc_share['call_to_action'];
109
+
110
+ $ht_ctc_share['class_names'] .= " style-$style ";
111
 
112
+ if ( '' == $call_to_action ) {
113
+ if ( '1' == $style || '4' == $style || '6' == $style || '8' == $style ) {
114
+ $call_to_action = "WhatsApp Share";
115
+ }
116
+ }
117
 
118
  // call style
119
  $path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style. '.php';
121
  $path_d = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style_d. '.php';
122
  $path_m = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style_m. '.php';
123
 
 
124
 
125
  if ( is_file( $path ) ) {
126
  do_action('ht_ctc_ah_before_fixed_position');
127
+ // onclick="ht_ctc_share_click(this);"
128
  ?>
129
+ <div class="<?php echo $ht_ctc_share['class_names'] ?>"
130
  style="display: none;"
131
+ data-return_type="<?php echo $ht_ctc_share['type'] ?>"
132
+ data-share_text="<?php echo $ht_ctc_share['share_text'] ?>"
133
+ data-is_ga_enable="<?php echo $ht_ctc_os['is_ga_enable'] ?>"
134
+ data-is_fb_pixel="<?php echo $ht_ctc_os['is_fb_pixel'] ?>"
135
+ data-is_fb_an_enable="<?php echo $ht_ctc_os['is_fb_an_enable'] ?>"
136
+ data-webandapi="<?php echo $ht_ctc_share['webandapi'] ?>"
137
+ data-display_mobile="<?php echo $ht_ctc_share['display_mobile'] ?>"
138
+ data-display_desktop="<?php echo $ht_ctc_share['display_desktop'] ?>"
139
+ data-css="<?php echo $ht_ctc_share['css'] ?>"
140
+ data-position="<?php echo $ht_ctc_share['position'] ?>"
141
+ data-position_mobile="<?php echo $ht_ctc_share['position_mobile'] ?>"
142
+ data-show_effect="<?php echo $ht_ctc_os['show_effect'] ?>"
143
+ <?php echo $ht_ctc_os['data-attributes'] ?>
144
  >
145
  <?php
146
  if ( isset( $othersettings['select_styles_issue'] ) ) {
new/inc/styles-shortcode/sc-style-3.php CHANGED
@@ -8,8 +8,6 @@ if ( ! defined( 'ABSPATH' ) ) exit;
8
 
9
  $s3_options = get_option( 'ht_ctc_s3' );
10
 
11
- $s3_type = ( isset( $s3_options['s3_type']) ) ? esc_attr( $s3_options['s3_type'] ) : 'simple';
12
-
13
  $img_size = esc_attr( $s3_options['s3_img_size'] );
14
  if ( '' == $img_size ) {
15
  $img_size = "50px";
@@ -19,63 +17,11 @@ $ht_ctc_svg_css = "pointer-events:none; display:block; height:$img_size; width:$
19
 
20
  $s3_img_link = plugins_url( './new/inc/assets/img/whatsapp-logo.svg', HT_CTC_PLUGIN_FILE );
21
 
22
- include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/svg-style-3.php';
23
 
24
  $s3_simple = '';
25
- $s3_extend = '';
26
-
27
- // simple
28
  $s3_simple .= '
29
- <img class="img-icon ctc-analytics" title="'.$call_to_action.'" style="height: '.$img_size.';" src="'.$s3_img_link.'" alt="WhatsApp chat">
30
- ';
31
-
32
- // extend
33
- if ( 'extend' == $s3_type ) {
34
- // extend
35
- $s3_padding = ( isset( $s3_options['s3_padding']) ) ? esc_attr( $s3_options['s3_padding'] ) : '';
36
- $s3_bg_color = ( isset( $s3_options['s3_bg_color']) ) ? esc_attr( $s3_options['s3_bg_color'] ) : '#25D366';
37
- $s3_bg_color_hover = ( isset( $s3_options['s3_bg_color_hover']) ) ? esc_attr( $s3_options['s3_bg_color_hover'] ) : '#25D366';
38
-
39
- $s3_box_shadow = "";
40
- if ( isset( $s3_options['s3_box_shadow'])) {
41
- $s3_box_shadow = "box-shadow: 0px 0px 11px rgba(0,0,0,.5);";
42
- }
43
- $s3_extend_css = "background-color: $s3_bg_color; padding: $s3_padding; border-radius: 50%; $s3_box_shadow";
44
-
45
- $s3_box_shadow_hover = "";
46
- if ( isset( $s3_options['s3_box_shadow_hover'])) {
47
- $s3_box_shadow_hover = "box-shadow: 0px 0px 11px rgba(0,0,0,.5);";
48
- }
49
- // hover css
50
- $s3_hover_css = "background-color:$s3_bg_color_hover !important;$s3_box_shadow_hover";
51
-
52
- $others = array(
53
- 'bg_color' => "$s3_bg_color",
54
- );
55
-
56
- $style_3_extend_svg = style_3_extend_svg( $img_size, $type, $ht_ctc_svg_css, $others );;
57
-
58
-
59
- ?>
60
- <style>
61
- .ht-ctc-sc:hover svg stop{stop-color:<?php echo $s3_bg_color_hover ?>;}
62
- .ht-ctc-sc:hover .ht_ctc_padding{<?php echo $s3_hover_css ?>}
63
- </style>
64
- <?php
65
-
66
- $s3_extend .= '
67
- <div class="ht_ctc_padding" style="'.$s3_extend_css.' display:inline-block;">
68
- '.$style_3_extend_svg.'
69
- </div>
70
  ';
71
- }
72
-
73
 
74
-
75
-
76
-
77
- if ( 'extend' == $s3_type ) {
78
- $o .= $s3_extend;
79
- } else {
80
- $o .= $s3_simple;
81
- }
8
 
9
  $s3_options = get_option( 'ht_ctc_s3' );
10
 
 
 
11
  $img_size = esc_attr( $s3_options['s3_img_size'] );
12
  if ( '' == $img_size ) {
13
  $img_size = "50px";
17
 
18
  $s3_img_link = plugins_url( './new/inc/assets/img/whatsapp-logo.svg', HT_CTC_PLUGIN_FILE );
19
 
20
+ include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/ht-ctc-svg-images.php';
21
 
22
  $s3_simple = '';
 
 
 
23
  $s3_simple .= '
24
+ <img class="img-icon ctc-analytics" title="'.$call_to_action.'" style="display: inline-block; height: '.$img_size.';" src="'.$s3_img_link.'" alt="WhatsApp chat">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  ';
 
 
26
 
27
+ $o .= $s3_simple;
 
 
 
 
 
 
 
new/inc/styles-shortcode/sc-style-3_1.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ *
5
+ */
6
+
7
+ if ( ! defined( 'ABSPATH' ) ) exit;
8
+
9
+ $s3_1_options = get_option( 'ht_ctc_s3_1' );
10
+
11
+ $s3_type = ( isset( $s3_1_options['s3_type']) ) ? esc_attr( $s3_1_options['s3_type'] ) : 'simple';
12
+
13
+ $img_size = esc_attr( $s3_1_options['s3_img_size'] );
14
+ if ( '' == $img_size ) {
15
+ $img_size = "40px";
16
+ }
17
+
18
+ $ht_ctc_svg_css = "pointer-events:none; display:block; height:$img_size; width:$img_size;";
19
+
20
+ $s3_img_link = plugins_url( './new/inc/assets/img/whatsapp-logo.svg', HT_CTC_PLUGIN_FILE );
21
+
22
+ include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/ht-ctc-svg-images.php';
23
+
24
+ $s3_padding = ( isset( $s3_1_options['s3_padding']) ) ? esc_attr( $s3_1_options['s3_padding'] ) : '';
25
+ $s3_bg_color = ( isset( $s3_1_options['s3_bg_color']) ) ? esc_attr( $s3_1_options['s3_bg_color'] ) : '#25D366';
26
+ $s3_bg_color_hover = ( isset( $s3_1_options['s3_bg_color_hover']) ) ? esc_attr( $s3_1_options['s3_bg_color_hover'] ) : '#25D366';
27
+
28
+ $s3_box_shadow = "";
29
+ if ( isset( $s3_1_options['s3_box_shadow'])) {
30
+ $s3_box_shadow = "box-shadow: 0px 0px 11px rgba(0,0,0,.5);";
31
+ }
32
+ $s3_extend_css = "background-color: $s3_bg_color; padding: $s3_padding; border-radius: 50%; $s3_box_shadow";
33
+
34
+ $s3_box_shadow_hover = "";
35
+ if ( isset( $s3_1_options['s3_box_shadow_hover'])) {
36
+ $s3_box_shadow_hover = "box-shadow: 0px 0px 11px rgba(0,0,0,.5);";
37
+ }
38
+ // hover css
39
+ $s3_hover_css = "background-color:$s3_bg_color_hover !important;$s3_box_shadow_hover";
40
+
41
+ $others = array(
42
+ 'bg_color' => "$s3_bg_color",
43
+ );
44
+
45
+ $style_3_extend_svg = ht_ctc_style_3_1_svg( $img_size, $type, $ht_ctc_svg_css, $others );;
46
+
47
+ ?>
48
+ <style id="ht-ctc-sc-s8">
49
+ .ht-ctc-sc:hover svg stop{stop-color:<?php echo $s3_bg_color_hover ?>;}.ht-ctc-sc:hover .ht_ctc_padding{<?php echo $s3_hover_css ?>}
50
+ </style>
51
+ <?php
52
+
53
+ $s3_extend = '';
54
+ $s3_extend .= '
55
+ <div title="'.$call_to_action.'" class="ht_ctc_padding" style="'.$s3_extend_css.' display:inline-block;">
56
+ '.$style_3_extend_svg.'
57
+ </div>
58
+ ';
59
+
60
+ $o .= $s3_extend;
new/inc/styles-shortcode/sc-style-4.php CHANGED
@@ -41,11 +41,11 @@ if ( is_rtl() ) {
41
  $s4_chip_css = "display:inline-flex;$rtl_css;justify-content:center;align-items:center;background-color:$s4_bg_color;color:$s4_text_color;padding:0 12px;border-radius:25px;font-size:13px;line-height:32px;";
42
  $s4_chip_svg_css ="margin:$s4_margin;order:$s4_order;";
43
  $s4_chip_img_css ="margin:$s4_margin;order:$s4_order;height:$s4_img_size;width:$s4_img_size;border-radius:50%";
44
- $ht_ctc_svg_css = "pointer-events:none; display: block;";
45
 
46
  if ( '' == $s4_img_url ) {
47
- include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/svg-style-3.php';
48
- $style_3_svg = style_3_svg( $s4_img_size, $type, $ht_ctc_svg_css );
49
  $type = "$type-s4";
50
  $s4_img = '<span style="'.$s4_chip_svg_css.'">'.$style_3_svg.'</span>';
51
  } else {
41
  $s4_chip_css = "display:inline-flex;$rtl_css;justify-content:center;align-items:center;background-color:$s4_bg_color;color:$s4_text_color;padding:0 12px;border-radius:25px;font-size:13px;line-height:32px;";
42
  $s4_chip_svg_css ="margin:$s4_margin;order:$s4_order;";
43
  $s4_chip_img_css ="margin:$s4_margin;order:$s4_order;height:$s4_img_size;width:$s4_img_size;border-radius:50%";
44
+ $ht_ctc_svg_css = "pointer-events:none; display: block; height:$s4_img_size; width:$s4_img_size;";
45
 
46
  if ( '' == $s4_img_url ) {
47
+ include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/ht-ctc-svg-images.php';
48
+ $style_3_svg = ht_ctc_style_3_svg( $s4_img_size, $type, $ht_ctc_svg_css );
49
  $type = "$type-s4";
50
  $s4_img = '<span style="'.$s4_chip_svg_css.'">'.$style_3_svg.'</span>';
51
  } else {
new/inc/styles-shortcode/sc-style-7.php CHANGED
@@ -5,11 +5,8 @@
5
 
6
  if ( ! defined( 'ABSPATH' ) ) exit;
7
 
8
- wp_enqueue_style('ht_ctc_font_css');
9
-
10
  $s7_options = get_option( 'ht_ctc_s7' );
11
 
12
-
13
  $s7_icon_size = esc_attr( $s7_options['s7_icon_size'] );
14
  $s7_icon_color = esc_attr( $s7_options['s7_icon_color'] );
15
  $s7_icon_color_hover = esc_attr( $s7_options['s7_icon_color_hover'] );
@@ -18,16 +15,60 @@ $s7_border_color = esc_attr( $s7_options['s7_border_color'] );
18
  $s7_border_color_hover = esc_attr( $s7_options['s7_border_color_hover'] );
19
  $s7_border_radius = esc_attr( $s7_options['s7_border_radius'] );
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
- $s7_css = "font-size: $s7_icon_size; color: $s7_icon_color; padding: $s7_border_size; background-color: $s7_border_color; border-radius: $s7_border_radius;";
 
 
 
 
 
 
 
23
 
24
- $input_onhover = "this.style.color='$s7_icon_color_hover', this.style.backgroundColor='$s7_border_color_hover'" ;
25
- $input_onhover_out = "this.style.color='$s7_icon_color', this.style.backgroundColor='$s7_border_color'";
26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
- $o .= '
29
- <span title="'.$call_to_action.'" class="ctc-icon ctc-icon-whatsapp2 ctc-analytics" id="s7-icon" style="'.$s7_css.'"
30
- onmouseover = "'.$input_onhover.'"
31
- onmouseout = "'.$input_onhover_out.'"
32
- ></span>
 
 
33
  ';
5
 
6
  if ( ! defined( 'ABSPATH' ) ) exit;
7
 
 
 
8
  $s7_options = get_option( 'ht_ctc_s7' );
9
 
 
10
  $s7_icon_size = esc_attr( $s7_options['s7_icon_size'] );
11
  $s7_icon_color = esc_attr( $s7_options['s7_icon_color'] );
12
  $s7_icon_color_hover = esc_attr( $s7_options['s7_icon_color_hover'] );
15
  $s7_border_color_hover = esc_attr( $s7_options['s7_border_color_hover'] );
16
  $s7_border_radius = esc_attr( $s7_options['s7_border_radius'] );
17
 
18
+ // Call to action
19
+ $s7_cta_type = (isset( $s7_options['cta_type'])) ? esc_attr( $s7_options['cta_type'] ) : 'hover';
20
+ $s7_cta_textcolor = (isset( $s7_options['cta_textcolor'])) ? esc_attr( $s7_options['cta_textcolor'] ) : '';
21
+ $s7_cta_bgcolor = (isset( $s7_options['cta_bgcolor'])) ? esc_attr( $s7_options['cta_bgcolor'] ) : '#ffffff';
22
+
23
+ $s7_n1_styles = "display:inline-flex;justify-content:center;align-items:center;";
24
+ $s7_icon_css = "font-size: $s7_icon_size; color: $s7_icon_color; padding: $s7_border_size; background-color: $s7_border_color; border-radius: $s7_border_radius;";
25
+
26
+ // Call to action
27
+ $s7_cta_order = "1";
28
+
29
+ $s7_cta_css = "padding: 0px 16px; color: $s7_cta_textcolor; background-color: $s7_cta_bgcolor; border-radius:10px; margin:0 10px; ";
30
+ $s7_cta_class = "ht-ctc-cta ";
31
+ $title = "";
32
+ if ( 'hover' == $s7_cta_type ) {
33
+ $s7_cta_css .= " display: none; order: $s7_cta_order; ";
34
+ $s7_cta_class .= " ht-ctc-cta-hover ";
35
+ $title = "title = '$call_to_action'";
36
+ } elseif ( 'show' == $s7_cta_type ) {
37
+ $s7_cta_css .= "order: $s7_cta_order; ";
38
+ } elseif ( 'hide' == $s7_cta_type ) {
39
+ $s7_cta_css .= " display: none; ";
40
+ $title = "title = '$call_to_action'";
41
+ }
42
 
43
+ // svg values
44
+ $ht_ctc_svg_css = "pointer-events:none; display:block; height:$s7_icon_size; width:$s7_icon_size;";
45
+ $s7_svg_attrs = array(
46
+ 'color' => "$s7_icon_color",
47
+ 'icon_size' => "$s7_icon_size",
48
+ 'type' => "$type",
49
+ 'ht_ctc_svg_css' => "$ht_ctc_svg_css",
50
+ );
51
 
 
 
52
 
53
+ // hover (call to action hover effects is not there for shortcodes - as it may moves posts content. )(javascript have to display cta on hover)
54
+ $s7_hover_icon_styles = ".ht-ctc-sc.sc-style-7:hover .ctc_s_7_icon_padding{background-color:$s7_border_color_hover !important;}.ht-ctc-sc.sc-style-7:hover svg g path{fill:$s7_icon_color_hover !important;}";
55
+
56
+ include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/ht-ctc-svg-images.php';
57
+
58
+ $style_7_svg = ht_ctc_singlecolor( $s7_svg_attrs );
59
+
60
+ ?>
61
+ <style id="ht-ctc-sc-s7">
62
+ <?php echo $s7_hover_icon_styles ?>
63
+ </style>
64
+
65
+ <?php
66
 
67
+ $o .= '
68
+ <div '.$title.' class="ctc_s_7" style="'.$s7_n1_styles.'">
69
+ <p class="ctc_s_7_cta ctc-analytics '.$s7_cta_class.'" style="'.$s7_cta_css.'">'.$call_to_action.'</p>
70
+ <div class="ctc_s_7_icon_padding ctc-analytics " style="'.$s7_icon_css.'">
71
+ '.$style_7_svg.'
72
+ </div>
73
+ </div>
74
  ';
new/inc/styles-shortcode/sc-style-7_1.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * icon with padding borderr
4
+ */
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) exit;
7
+
8
+ $s7_1_options = get_option( 'ht_ctc_s7_1' );
9
+
10
+ $s7_icon_size = esc_attr( $s7_1_options['s7_icon_size'] );
11
+ $s7_icon_color = esc_attr( $s7_1_options['s7_icon_color'] );
12
+ $s7_icon_color_hover = esc_attr( $s7_1_options['s7_icon_color_hover'] );
13
+ $s7_bgcolor = esc_attr( $s7_1_options['s7_bgcolor'] );
14
+ $s7_bgcolor_hover = esc_attr( $s7_1_options['s7_bgcolor_hover'] );
15
+
16
+ // Call to action
17
+ $s7_cta_type = (isset( $s7_1_options['cta_type'])) ? esc_attr( $s7_1_options['cta_type'] ) : 'hover';
18
+
19
+ // Call to action - Order
20
+ $s7_cta_order = "1";
21
+ $s7_cta_padding_css = "padding-right: 21px;";
22
+ // $s7_cta_padding_css = "padding-left: 21px;";
23
+
24
+ $s7_n1_styles = "display:inline-flex;justify-content:center;align-items:center;";
25
+ $s7_cta_css = "";
26
+ $s7_icon_padding_css = "";
27
+ $s7_cta_class = "ht-ctc-cta ";
28
+ $s7_hover_styles = "";
29
+
30
+ // hover style is not there in shortcodes..
31
+ $s7_n1_styles .= "padding:5px 25px; background-color:$s7_bgcolor;border-radius:25px;";
32
+ $s7_cta_css .= "padding: 1px 16px; color: $s7_icon_color; border-radius:10px; margin:0 10px; order: $s7_cta_order; ";
33
+ $s7_icon_padding_css .= "";
34
+ $s7_hover_styles = ".ht-ctc.style-7_1:hover .ctc_s_7_1{background-color:$s7_bgcolor_hover !important;}.ht-ctc.style-7_1:hover .ctc_s_7_1_cta{color:$s7_icon_color_hover !important;}.ht-ctc.style-7_1:hover svg g path{fill:$s7_icon_color_hover !important;}";
35
+
36
+
37
+ // svg values
38
+ $ht_ctc_svg_css = "pointer-events:none; display:block; height:$s7_icon_size; width:$s7_icon_size;";
39
+ $s7_svg_attrs = array(
40
+ 'color' => "$s7_icon_color",
41
+ 'icon_size' => "$s7_icon_size",
42
+ 'type' => "$type",
43
+ 'ht_ctc_svg_css' => "$ht_ctc_svg_css",
44
+ );
45
+
46
+ include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/ht-ctc-svg-images.php';
47
+
48
+ $style_7_1_svg = ht_ctc_singlecolor( $s7_svg_attrs );
49
+
50
+ ?>
51
+ <style id="ht-ctc-sc-s7_1">
52
+ <?php echo $s7_hover_styles ?>
53
+ </style>
54
+
55
+ <?php
56
+
57
+ $o .= '
58
+ <div class="ctc_s_7_1" style="'.$s7_n1_styles.'">
59
+ <p class="ctc_s_7_1_cta ctc-analytics '.$s7_cta_class.'" style="'.$s7_cta_css.'">'.$call_to_action.'</p>
60
+ <div class="ctc_s_7_icon_padding ctc-analytics " style="'.$s7_icon_padding_css.'">
61
+ '.$style_7_1_svg.'
62
+ </div>
63
+ </div>
64
+ ';
new/inc/styles-shortcode/sc-style-8.php CHANGED
@@ -1,39 +1,29 @@
1
  <?php
2
  /**
3
  * materialize button
 
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) exit;
7
 
8
  $s8_options = get_option( 'ht_ctc_s8' );
9
 
10
- ?>
11
- <style>
12
- .ht-ctc-sc-style-8{display:none;}
13
- </style>
14
- <?php
15
-
16
- wp_enqueue_style('ht_ctc_font_css');
17
- wp_enqueue_style('ht_ctc_mdstyle8_css');
18
-
19
- $s8_txt_color = esc_attr( $s8_options['s8_txt_color'] );
20
  $s8_icon_color = esc_attr( $s8_options['s8_icon_color'] );
 
 
21
  $s8_txt_color_on_hover = esc_attr( $s8_options['s8_txt_color_on_hover'] );
22
  $s8_bg_color = esc_attr( $s8_options['s8_bg_color'] );
23
  $s8_bg_color_on_hover = esc_attr( $s8_options['s8_bg_color_on_hover'] );
24
- $s8_icon_color_on_hover = esc_attr( $s8_options['s8_icon_color_on_hover'] );
25
- $s8_icon_position = esc_attr( $s8_options['s8_icon_position'] );
26
 
27
  $s8_btn_size = esc_attr( $s8_options['s8_btn_size'] );
28
 
29
- $s8_icon_size_db = esc_attr( $s8_options['s8_icon_size'] );
30
- $s8_icon_size = ('' == $s8_icon_size_db) ? "" : "font-size: $s8_icon_size_db;";
31
- // $s8_icon_size = ('' == $s8_icon_size_db) ? "font-size: 12px;" : "font-size: $s8_icon_size_db;";
32
 
33
- $s8_text_size_db = esc_attr( $s8_options['s8_text_size'] );
34
- $s8_text_size = ('' == $s8_text_size_db) ? "" : "font-size: $s8_text_size_db;";
35
- // $s8_text_size = ('' == $s8_text_size_db) ? "font-size: 16px;" : "font-size: $s8_text_size_db;";
36
 
 
37
 
38
  // shortcode attributes
39
  $s8_width_sc = $a["s8_width"];
@@ -42,25 +32,50 @@ $s8_icon_position_sc = $a["s8_icon_position"];
42
 
43
  $s8_width_css = '';
44
  if ( '' !== $s8_width_sc ) {
45
- $s8_width_css = "width: $s8_width_sc";
46
  }
47
 
48
  if ( '' !== $s8_icon_position_sc ) {
49
  $s8_icon_position = $s8_icon_position_sc;
50
  }
51
 
 
 
 
 
52
 
53
- $input_onhover = "this.style.backgroundColor= '$s8_bg_color_on_hover', this.childNodes[1].style.color= '$s8_icon_color_on_hover', this.childNodes[3].style.color= '$s8_txt_color_on_hover'; ";
54
- $input_onhover_out = "this.style.backgroundColor= '$s8_bg_color', this.childNodes[1].style.color= '$s8_icon_color', this.childNodes[3].style.color= '$s8_txt_color'; ";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
 
 
 
 
 
 
 
 
56
 
57
  $o .= '
58
- <div class="ht-ctc-sc-style-8 mdstyle8 ctc-analytics">
59
- <span class="waves-effect waves-light '.$s8_btn_size.' ctc-analytics" style="background-color: '.$s8_bg_color.'; '.$s8_width_css.'"
60
- onmouseover= "'.$input_onhover.'"
61
- onmouseout= "'.$input_onhover_out.'">
62
- <i class="material-icons s8_icon '.$s8_icon_position.' ctc-icon ctc-icon-whatsapp2 ctc-analytics" style="color: '.$s8_icon_color.'; '.$s8_icon_size.' "></i>
63
- <span class="ctc-analytics s8_span" style="color: '.$s8_txt_color.'; '.$s8_text_size.' ">'.$call_to_action.'</span>
64
  </span>
65
  </div>
66
- ';
1
  <?php
2
  /**
3
  * materialize button
4
+ *
5
  */
6
 
7
  if ( ! defined( 'ABSPATH' ) ) exit;
8
 
9
  $s8_options = get_option( 'ht_ctc_s8' );
10
 
 
 
 
 
 
 
 
 
 
 
11
  $s8_icon_color = esc_attr( $s8_options['s8_icon_color'] );
12
+ $s8_icon_color_on_hover = esc_attr( $s8_options['s8_icon_color_on_hover'] );
13
+ $s8_txt_color = esc_attr( $s8_options['s8_txt_color'] );
14
  $s8_txt_color_on_hover = esc_attr( $s8_options['s8_txt_color_on_hover'] );
15
  $s8_bg_color = esc_attr( $s8_options['s8_bg_color'] );
16
  $s8_bg_color_on_hover = esc_attr( $s8_options['s8_bg_color_on_hover'] );
 
 
17
 
18
  $s8_btn_size = esc_attr( $s8_options['s8_btn_size'] );
19
 
20
+ $s8_icon_size = ('' == esc_attr( $s8_options['s8_icon_size'] )) ? "17px" : esc_attr( $s8_options['s8_icon_size'] );
 
 
21
 
22
+ $s8_text_size = esc_attr( $s8_options['s8_text_size'] );
23
+ $s8_text_size_css = ('' == $s8_text_size) ? "" : "font-size: $s8_text_size;";
24
+ // $s8_text_size_css = ('' == $s8_text_size) ? "font-size: 16px;" : "font-size: $s8_text_size;";
25
 
26
+ $s8_icon_position = esc_attr( $s8_options['s8_icon_position'] );
27
 
28
  // shortcode attributes
29
  $s8_width_sc = $a["s8_width"];
32
 
33
  $s8_width_css = '';
34
  if ( '' !== $s8_width_sc ) {
35
+ $s8_width_css = "width: $s8_width_sc;";
36
  }
37
 
38
  if ( '' !== $s8_icon_position_sc ) {
39
  $s8_icon_position = $s8_icon_position_sc;
40
  }
41
 
42
+ $s8_height = '36px';
43
+ if ('btn-large' == $s8_btn_size) {
44
+ $s8_height = '54px';
45
+ }
46
 
47
+ $s8_icon_css = ( 'right' == $s8_icon_position ) ? "order:1;margin-left: 15px;" : "order:0;margin-right: 15px;";
48
+ $s8_text_css = "color:$s8_txt_color; $s8_text_size_css ";
49
+ $s8_main_span_css = "display: flex;padding: 0 2rem;letter-spacing: .5px;transition: .2s ease-out;text-align: center;justify-content: center;align-items: center;border-radius:2px;height:$s8_height;line-height:$s8_height;vertical-align:middle;box-shadow:0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12), 0 3px 1px -2px rgba(0,0,0,.2);box-sizing:inherit;background-color:$s8_bg_color;";
50
+
51
+ $s8_svg_attrs = array (
52
+ 'color' => "$s8_icon_color",
53
+ 'icon_size' => "$s8_icon_size",
54
+ 'type' => "$type",
55
+ 'ht_ctc_svg_css' => 'display:block;',
56
+ );
57
+
58
+ $style_8_svg = "";
59
+ if ('hide' !== $s8_icon_position) {
60
+ include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/ht-ctc-svg-images.php';
61
+ $style_8_svg = ht_ctc_singlecolor( $s8_svg_attrs );
62
+ }
63
 
64
+ ?>
65
+
66
+ <style id="ht-ctc-sc-s8">
67
+ .ht-ctc-sc .ht-ctc-style-8 .s_8 svg{<?php echo $s8_icon_css ?>;}.ht-ctc-sc:hover svg g path{fill:<?php echo $s8_txt_color_on_hover ?> !important;}.ht-ctc-sc:hover .ht-ctc-s8-text{color:<?php echo $s8_txt_color_on_hover ?> !important;}.ht-ctc-sc:hover .ht-ctc-style-8 .s_8{box-shadow: 0 3px 3px 0 rgba(7,6,6,.14), 0 1px 7px 0 rgba(0,0,0,.12), 0 3px 1px -1px rgba(0,0,0,.2) !important; transition: .2s ease-out !important; background-color:<?php echo $s8_bg_color_on_hover ?> !important; }
68
+ </style>
69
+
70
+ <?php
71
 
72
  $o .= '
73
+ <div class="ht-ctc-style-8 ctc-analytics" style="display: inline-block; '.$s8_width_css.' " >
74
+ <span class="s_8 waves-effect waves-light ctc-analytics" style="'.$s8_main_span_css.' ">
75
+ '.$style_8_svg.'
76
+ <span class="ht-ctc-s8-text s8_span ctc-analytics" style="'.$s8_text_css.'">
77
+ '.$call_to_action.'
78
+ </span>
79
  </span>
80
  </div>
81
+ ';
new/inc/styles/style-2.php CHANGED
@@ -16,8 +16,39 @@ if ( '' == $img_size ) {
16
  $img_size = "50px";
17
  }
18
 
19
- $ht_ctc_svg_css = "pointer-events:none; display:block; height:$img_size; width:$img_size;";
 
 
 
 
 
 
 
 
 
 
20
 
21
- include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/svg-style-2.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
- echo style_2_svg( $img_size, $type, $ht_ctc_svg_css );
 
 
 
 
 
16
  $img_size = "50px";
17
  }
18
 
19
+ // Call to action
20
+ $s2_cta_type = (isset( $s2_options['cta_type'])) ? esc_attr( $s2_options['cta_type'] ) : 'hover';
21
+
22
+ $s2_cta_order = "1";
23
+ if ('right' == $options['side_2']) {
24
+ // if side_2 is right then cta is left
25
+ $s2_cta_order = "0";
26
+ }
27
+
28
+ $s2_cta_textcolor = (isset( $s2_options['cta_textcolor'])) ? esc_attr( $s2_options['cta_textcolor'] ) : '';
29
+ $s2_cta_bgcolor = (isset( $s2_options['cta_bgcolor'])) ? esc_attr( $s2_options['cta_bgcolor'] ) : '#ffffff';
30
 
31
+ $s2_cta_textcolor = ('' !== $s2_cta_textcolor) ? "color: $s2_cta_textcolor" : "";
32
+ $s2_cta_bgcolor = ('' !== $s2_cta_bgcolor) ? "background-color: $s2_cta_bgcolor" : "";
33
+
34
+ $s2_cta_css = "padding: 0px 16px; $s2_cta_bgcolor; $s2_cta_textcolor; border-radius:10px; margin:0 10px; ";
35
+ $s2_cta_class = "ht-ctc-cta ";
36
+ $title = "";
37
+ if ( 'hover' == $s2_cta_type ) {
38
+ $s2_cta_css .= " display: none; order: $s2_cta_order; ";
39
+ $s2_cta_class .= " ht-ctc-cta-hover ";
40
+ } elseif ( 'show' == $s2_cta_type ) {
41
+ $s2_cta_css .= "order: $s2_cta_order; ";
42
+ } elseif ( 'hide' == $s2_cta_type ) {
43
+ $s2_cta_css .= " display: none; ";
44
+ $title = "title = '$call_to_action'";
45
+ }
46
+
47
+ $ht_ctc_svg_css = "pointer-events:none; display:block; height:$img_size; width:$img_size;";
48
 
49
+ include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/ht-ctc-svg-images.php';
50
+ ?>
51
+ <div <?php echo $title ?> style="display: flex; justify-content: center; align-items: center;">
52
+ <p class="<?php echo $s2_cta_class ?>" style="<?php echo $s2_cta_css ?>"><?php echo $call_to_action; ?></p>
53
+ <?php echo ht_ctc_style_2_svg( $img_size, $type, $ht_ctc_svg_css ); ?>
54
+ </div>
new/inc/styles/style-3.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Style - 3
4
  *
5
- * IOS like - WhatsApp icon
6
  *
7
  */
8
 
@@ -17,47 +17,40 @@ if ( '' == $img_size ) {
17
  $img_size = "50px";
18
  }
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  $ht_ctc_svg_css = "pointer-events:none; display:block; height:$img_size; width:$img_size;";
21
 
22
- include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/svg-style-3.php';
23
-
24
-
25
-
26
- if ( 'simple' == $s3_type ) {
27
- // simple
28
- echo style_3_svg( $img_size, $type, $ht_ctc_svg_css );
29
- } else {
30
- // extend
31
- $s3_padding = ( isset( $s3_options['s3_padding']) ) ? esc_attr( $s3_options['s3_padding'] ) : '';
32
- $s3_bg_color = ( isset( $s3_options['s3_bg_color']) ) ? esc_attr( $s3_options['s3_bg_color'] ) : '#25D366';
33
- $s3_bg_color_hover = ( isset( $s3_options['s3_bg_color_hover']) ) ? esc_attr( $s3_options['s3_bg_color_hover'] ) : '#25D366';
34
-
35
- $s3_box_shadow = "";
36
- if ( isset( $s3_options['s3_box_shadow'])) {
37
- $s3_box_shadow = "box-shadow: 0px 0px 11px rgba(0,0,0,.5);";
38
- }
39
- $s3_extend_css = "background-color: $s3_bg_color; padding: $s3_padding; border-radius: 50%; $s3_box_shadow";
40
-
41
- $s3_box_shadow_hover = "";
42
- if ( isset( $s3_options['s3_box_shadow_hover'])) {
43
- $s3_box_shadow_hover = "box-shadow:0px 0px 11px rgba(0,0,0,.5);";
44
- }
45
- // hover css
46
- $s3_hover_css = "background-color:$s3_bg_color_hover !important;$s3_box_shadow_hover";
47
-
48
- $others = array(
49
- 'bg_color' => "$s3_bg_color",
50
- );
51
-
52
- ?>
53
- <style>
54
- .ht-ctc:hover svg stop{stop-color:<?php echo $s3_bg_color_hover ?>;}
55
- .ht-ctc:hover .ht_ctc_padding{<?php echo $s3_hover_css ?>}
56
- </style>
57
-
58
-
59
- <div class="ht_ctc_padding" style="<?php echo $s3_extend_css ?>">
60
- <?php echo style_3_extend_svg( $img_size, $type, $ht_ctc_svg_css, $others ); ?>
61
- </div>
62
- <?php
63
- }
2
  /**
3
  * Style - 3
4
  *
5
+ * WhatsApp icon
6
  *
7
  */
8
 
17
  $img_size = "50px";
18
  }
19
 
20
+ // Call to action
21
+ $s3_cta_type = (isset( $s3_options['cta_type'])) ? esc_attr( $s3_options['cta_type'] ) : 'hover';
22
+
23
+ $s3_cta_order = "1";
24
+ if ('right' == $options['side_2']) {
25
+ // if side_2 is right then cta is left
26
+ $s3_cta_order = "0";
27
+ }
28
+
29
+ $s3_cta_textcolor = (isset( $s3_options['cta_textcolor'])) ? esc_attr( $s3_options['cta_textcolor'] ) : '';
30
+ $s3_cta_bgcolor = (isset( $s3_options['cta_bgcolor'])) ? esc_attr( $s3_options['cta_bgcolor'] ) : '#ffffff';
31
+
32
+ $s3_cta_textcolor = ('' !== $s3_cta_textcolor) ? "color: $s3_cta_textcolor" : "";
33
+ $s3_cta_bgcolor = ('' !== $s3_cta_bgcolor) ? "background-color: $s3_cta_bgcolor" : "";
34
+
35
+ $s3_cta_css = "padding: 0px 16px; $s3_cta_bgcolor; $s3_cta_textcolor; border-radius:10px; margin:0 10px; ";
36
+ $s3_cta_class = "ht-ctc-cta ";
37
+ $title = "";
38
+ if ( 'hover' == $s3_cta_type ) {
39
+ $s3_cta_css .= " display: none; order: $s3_cta_order; ";
40
+ $s3_cta_class .= " ht-ctc-cta-hover ";
41
+ } elseif ( 'show' == $s3_cta_type ) {
42
+ $s3_cta_css .= "order: $s3_cta_order; ";
43
+ } elseif ( 'hide' == $s3_cta_type ) {
44
+ $s3_cta_css .= " display: none; ";
45
+ $title = "title = '$call_to_action'";
46
+ }
47
+
48
  $ht_ctc_svg_css = "pointer-events:none; display:block; height:$img_size; width:$img_size;";
49
 
50
+ include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/ht-ctc-svg-images.php';
51
+
52
+ ?>
53
+ <div <?php echo $title ?> style="display: flex; justify-content: center; align-items: center;">
54
+ <p class="<?php echo $s3_cta_class ?>" style="<?php echo $s3_cta_css ?>"><?php echo $call_to_action; ?></p>
55
+ <?php echo ht_ctc_style_3_svg( $img_size, $type, $ht_ctc_svg_css ); ?>
56
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
new/inc/styles/style-3_1.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Style - 3_1 - s3 extend
4
+ *
5
+ */
6
+
7
+ if ( ! defined( 'ABSPATH' ) ) exit;
8
+
9
+ $s3_1_options = get_option( 'ht_ctc_s3_1' );
10
+
11
+ $img_size = esc_attr( $s3_1_options['s3_img_size'] );
12
+ if ( '' == $img_size ) {
13
+ $img_size = "40px";
14
+ }
15
+
16
+ // Call to action
17
+ $s3_1_cta_type = (isset( $s3_1_options['cta_type'])) ? esc_attr( $s3_1_options['cta_type'] ) : 'hover';
18
+
19
+ $s3_1_cta_order = "1";
20
+ if ('right' == $options['side_2']) {
21
+ // if side_2 is right then cta is left
22
+ $s3_1_cta_order = "0";
23
+ }
24
+
25
+ $s3_1_cta_textcolor = (isset( $s3_1_options['cta_textcolor'])) ? esc_attr( $s3_1_options['cta_textcolor'] ) : '';
26
+ $s3_1_cta_bgcolor = (isset( $s3_1_options['cta_bgcolor'])) ? esc_attr( $s3_1_options['cta_bgcolor'] ) : '#ffffff';
27
+
28
+ $s3_1_cta_textcolor = ('' !== $s3_1_cta_textcolor) ? "color: $s3_1_cta_textcolor" : "";
29
+ $s3_1_cta_bgcolor = ('' !== $s3_1_cta_bgcolor) ? "background-color: $s3_1_cta_bgcolor" : "";
30
+
31
+ $s3_1_cta_css = "padding: 0px 16px; $s3_1_cta_bgcolor; $s3_1_cta_textcolor; border-radius:10px; margin:0 10px; ";
32
+ $s3_1_cta_class = "ht-ctc-cta ";
33
+ $title = "";
34
+ if ( 'hover' == $s3_1_cta_type ) {
35
+ $s3_1_cta_css .= " display: none; order: $s3_1_cta_order; ";
36
+ $s3_1_cta_class .= " ht-ctc-cta-hover ";
37
+ } elseif ( 'show' == $s3_1_cta_type ) {
38
+ $s3_1_cta_css .= "order: $s3_1_cta_order; ";
39
+ } elseif ( 'hide' == $s3_1_cta_type ) {
40
+ $s3_1_cta_css .= " display: none; ";
41
+ $title = "title = '$call_to_action'";
42
+ }
43
+
44
+ $ht_ctc_svg_css = "pointer-events:none; display:block; height:$img_size; width:$img_size;";
45
+
46
+ include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/ht-ctc-svg-images.php';
47
+
48
+
49
+ // extend
50
+ $s3_1_padding = ( isset( $s3_1_options['s3_padding']) ) ? esc_attr( $s3_1_options['s3_padding'] ) : '';
51
+ $s3_1_bg_color = ( isset( $s3_1_options['s3_bg_color']) ) ? esc_attr( $s3_1_options['s3_bg_color'] ) : '#25D366';
52
+ $s3_1_bg_color_hover = ( isset( $s3_1_options['s3_bg_color_hover']) ) ? esc_attr( $s3_1_options['s3_bg_color_hover'] ) : '#25D366';
53
+
54
+ $s3_1_box_shadow = "";
55
+ if ( isset( $s3_1_options['s3_box_shadow'])) {
56
+ $s3_1_box_shadow = "box-shadow: 0px 0px 11px rgba(0,0,0,.5);";
57
+ }
58
+ $s3_1_extend_css = "background-color: $s3_1_bg_color; padding: $s3_1_padding; border-radius: 50%; $s3_1_box_shadow";
59
+
60
+ $s3_1_box_shadow_hover = "";
61
+ if ( isset( $s3_1_options['s3_box_shadow_hover'])) {
62
+ $s3_1_box_shadow_hover = "box-shadow:0px 0px 11px rgba(0,0,0,.5);";
63
+ }
64
+ // hover css
65
+ $s3_1_hover_css = "background-color:$s3_1_bg_color_hover !important;$s3_1_box_shadow_hover";
66
+
67
+ $others = array(
68
+ 'bg_color' => "$s3_1_bg_color",
69
+ );
70
+
71
+ ?>
72
+ <style id="ht-ctc-s3">
73
+ .ht-ctc:hover svg stop{stop-color:<?php echo $s3_1_bg_color_hover ?>;}.ht-ctc:hover .ht_ctc_padding{<?php echo $s3_1_hover_css ?>}
74
+ </style>
75
+
76
+ <div <?php echo $title ?> style="display: flex; justify-content: center; align-items: center;">
77
+ <p class="<?php echo $s3_1_cta_class ?>" style="<?php echo $s3_1_cta_css ?>"><?php echo $call_to_action ?></p>
78
+ <div class="ht_ctc_padding" style="<?php echo $s3_1_extend_css ?>">
79
+ <?php echo ht_ctc_style_3_1_svg( $img_size, $type, $ht_ctc_svg_css, $others ); ?>
80
+ </div>
81
+ </div>
new/inc/styles/style-4.php CHANGED
@@ -41,16 +41,16 @@ if ( is_rtl() ) {
41
  $s4_chip_css = "display:flex;$rtl_css;justify-content: center;align-items: center;background-color:$s4_bg_color;color:$s4_text_color;padding:0 12px;border-radius:25px;font-size:13px;line-height:32px;";
42
  $s4_chip_svg_css ="margin:$s4_margin;order:$s4_order;";
43
  $s4_chip_img_css ="margin:$s4_margin;order:$s4_order;height:$s4_img_size;width:$s4_img_size;border-radius:50%";
44
- $ht_ctc_svg_css = "pointer-events:none; display: block;";
45
  ?>
46
 
47
  <div class="chip ctc-analytics" style="<?php echo $s4_chip_css ?>">
48
  <?php
49
  if ( '' == $s4_img_url ) {
50
- include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/svg-style-3.php';
51
  $type = "$type-s4";
52
  ?>
53
- <span style="<?php echo $s4_chip_svg_css ?>"><?php echo style_3_svg( $s4_img_size, $type, $ht_ctc_svg_css ); ?></span>
54
  <?php
55
  } else {
56
  // if user changed the image
41
  $s4_chip_css = "display:flex;$rtl_css;justify-content: center;align-items: center;background-color:$s4_bg_color;color:$s4_text_color;padding:0 12px;border-radius:25px;font-size:13px;line-height:32px;";
42
  $s4_chip_svg_css ="margin:$s4_margin;order:$s4_order;";
43
  $s4_chip_img_css ="margin:$s4_margin;order:$s4_order;height:$s4_img_size;width:$s4_img_size;border-radius:50%";
44
+ $ht_ctc_svg_css = "pointer-events:none; display: block; height:$s4_img_size; width:$s4_img_size;";
45
  ?>
46
 
47
  <div class="chip ctc-analytics" style="<?php echo $s4_chip_css ?>">
48
  <?php
49
  if ( '' == $s4_img_url ) {
50
+ include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/ht-ctc-svg-images.php';
51
  $type = "$type-s4";
52
  ?>
53
+ <span style="<?php echo $s4_chip_svg_css ?>"><?php echo ht_ctc_style_3_svg( $s4_img_size, $type, $ht_ctc_svg_css ); ?></span>
54
  <?php
55
  } else {
56
  // if user changed the image
new/inc/styles/style-7.php CHANGED
@@ -5,8 +5,6 @@
5
  */
6
  if ( ! defined( 'ABSPATH' ) ) exit;
7
 
8
- wp_enqueue_style('ht_ctc_font_css');
9
-
10
  $s7_options = get_option( 'ht_ctc_s7' );
11
 
12
  $s7_icon_size = esc_attr( $s7_options['s7_icon_size'] );
@@ -17,10 +15,63 @@ $s7_border_color = esc_attr( $s7_options['s7_border_color'] );
17
  $s7_border_color_hover = esc_attr( $s7_options['s7_border_color_hover'] );
18
  $s7_border_radius = esc_attr( $s7_options['s7_border_radius'] );
19
 
20
- $s7_css = "font-size: $s7_icon_size; color: $s7_icon_color; padding: $s7_border_size; background-color: $s7_border_color; border-radius: $s7_border_radius;";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  ?>
23
- <span title="<?php echo $call_to_action ?>" class="ctc-analytics ctc-icon ctc-icon-whatsapp2" id="s7-icon" style="<?php echo $s7_css ?>"
24
- onmouseover = "this.style.color = '<?php echo $s7_icon_color_hover ?>', this.style.backgroundColor = '<?php echo $s7_border_color_hover ?>' "
25
- onmouseout = "this.style.color = '<?php echo $s7_icon_color ?>', this.style.backgroundColor = '<?php echo $s7_border_color ?>' "
26
- ></span>
 
 
 
 
 
 
5
  */
6
  if ( ! defined( 'ABSPATH' ) ) exit;
7
 
 
 
8
  $s7_options = get_option( 'ht_ctc_s7' );
9
 
10
  $s7_icon_size = esc_attr( $s7_options['s7_icon_size'] );
15
  $s7_border_color_hover = esc_attr( $s7_options['s7_border_color_hover'] );
16
  $s7_border_radius = esc_attr( $s7_options['s7_border_radius'] );
17
 
18
+ // Call to action
19
+ $s7_cta_type = (isset( $s7_options['cta_type'])) ? esc_attr( $s7_options['cta_type'] ) : 'hover';
20
+ $s7_cta_textcolor = (isset( $s7_options['cta_textcolor'])) ? esc_attr( $s7_options['cta_textcolor'] ) : '';
21
+ $s7_cta_bgcolor = (isset( $s7_options['cta_bgcolor'])) ? esc_attr( $s7_options['cta_bgcolor'] ) : '#ffffff';
22
+
23
+ $s7_n1_styles = "display:flex;justify-content:center;align-items:center;";
24
+ $s7_icon_css = "font-size: $s7_icon_size; color: $s7_icon_color; padding: $s7_border_size; background-color: $s7_border_color; border-radius: $s7_border_radius;";
25
+
26
+ // Call to action
27
+ $s7_cta_order = "1";
28
+ if ('right' == $options['side_2']) {
29
+ // if side_2 is right then cta is left
30
+ $s7_cta_order = "0";
31
+ }
32
+
33
+ $s7_cta_css = "padding: 0px 16px; color: $s7_cta_textcolor; background-color: $s7_cta_bgcolor; border-radius:10px; margin:0 10px; ";
34
+ $s7_cta_class = "ht-ctc-cta ";
35
+ $title = "";
36
+ if ( 'hover' == $s7_cta_type ) {
37
+ $s7_cta_css .= " display: none; order: $s7_cta_order; ";
38
+ $s7_cta_class .= " ht-ctc-cta-hover ";
39
+ } elseif ( 'show' == $s7_cta_type ) {
40
+ $s7_cta_css .= "order: $s7_cta_order; ";
41
+ } elseif ( 'hide' == $s7_cta_type ) {
42
+ $s7_cta_css .= " display: none; ";
43
+ $title = "title = '$call_to_action'";
44
+ }
45
+
46
+ // svg values
47
+ $ht_ctc_svg_css = "pointer-events:none; display:block; height:$s7_icon_size; width:$s7_icon_size;";
48
+ $s7_svg_attrs = array(
49
+ 'color' => "$s7_icon_color",
50
+ 'icon_size' => "$s7_icon_size",
51
+ 'type' => "$type",
52
+ 'ht_ctc_svg_css' => "$ht_ctc_svg_css",
53
+ );
54
 
55
+ // cta order
56
+ $s7_cta_order = "1";
57
+ if ('right' == $options['side_2']) {
58
+ // if side_2 is right then cta is left
59
+ $s7_cta_order = "0";
60
+ }
61
+
62
+
63
+ // hover
64
+ $s7_hover_icon_styles = ".ht-ctc.style-7:hover .ctc_s_7_icon_padding{background-color:$s7_border_color_hover !important;}.ht-ctc.style-7:hover svg g path{fill:$s7_icon_color_hover !important;}";
65
+
66
+ include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/ht-ctc-svg-images.php';
67
  ?>
68
+ <style id="ht-ctc-s7">
69
+ <?php echo $s7_hover_icon_styles ?>
70
+ </style>
71
+
72
+ <div <?php echo $title ?> class="ctc_s_7" style="<?php echo $s7_n1_styles; ?>">
73
+ <p class="ctc_s_7_cta ctc-analytics <?php echo $s7_cta_class ?>" style="<?php echo $s7_cta_css ?>"><?php echo $call_to_action; ?></p>
74
+ <div class="ctc_s_7_icon_padding ctc-analytics " style="<?php echo $s7_icon_css ?>">
75
+ <?php echo ht_ctc_singlecolor( $s7_svg_attrs ); ?>
76
+ </div>
77
+ </div>
new/inc/styles/style-7_1.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Style - 7
4
+ * icon with customize padding
5
+ */
6
+ if ( ! defined( 'ABSPATH' ) ) exit;
7
+
8
+ // shadow
9
+ // 0px 0px 11px rgba(0,0,0,.5) / 5px 5px 11px #888888
10
+ // $s7_bs = "box-shadow: 5px 5px 11px rgba(0,0,0,.5);";
11
+ // $s7_box_shadow = "";
12
+ // if ( !isset( $s7_options['s3_box_shadow'])) {
13
+ // $s7_box_shadow = "$s7_bs ";
14
+ // }
15
+ // $s7_box_shadow_hover = "";
16
+ // if ( isset( $s7_options['s7_box_shadow_hover'])) {
17
+ // $s7_box_shadow_hover = "$s7_bs ";
18
+ // }
19
+
20
+ $s7_1_options = get_option( 'ht_ctc_s7_1' );
21
+
22
+ $s7_icon_size = esc_attr( $s7_1_options['s7_icon_size'] );
23
+ $s7_icon_color = esc_attr( $s7_1_options['s7_icon_color'] );
24
+ $s7_icon_color_hover = esc_attr( $s7_1_options['s7_icon_color_hover'] );
25
+ $s7_bgcolor = esc_attr( $s7_1_options['s7_bgcolor'] );
26
+ $s7_bgcolor_hover = esc_attr( $s7_1_options['s7_bgcolor_hover'] );
27
+ $s7_border_size = esc_attr( $s7_1_options['s7_border_size'] );
28
+
29
+ // Call to action
30
+ $s7_cta_type = (isset( $s7_1_options['cta_type'])) ? esc_attr( $s7_1_options['cta_type'] ) : 'hover';
31
+
32
+
33
+ // Call to action - Order
34
+ $s7_cta_order = "1";
35
+ $s7_cta_padding_css = "padding-right: 21px;";
36
+ if ('right' == $options['side_2']) {
37
+ // if side_2 is right then cta is left
38
+ $s7_cta_order = "0";
39
+ $s7_cta_padding_css = "padding-left: 21px;";
40
+ }
41
+
42
+ $s7_n1_styles = "display:flex;justify-content:center;align-items:center;";
43
+ $s7_cta_css = "";
44
+ $s7_icon_padding_css = "";
45
+ $s7_cta_class = "ht-ctc-cta ";
46
+ $s7_hover_styles = "";
47
+ if ( 'hover' == $s7_cta_type ) {
48
+ $s7_n1_styles .= "background-color: $s7_bgcolor; border-radius: 25px;";
49
+ $s7_cta_css .= " display: none; order: $s7_cta_order; color: $s7_icon_color; $s7_cta_padding_css margin:0 10px; border-radius: 25px; ";
50
+ $s7_cta_class .= " ht-ctc-cta-hover ";
51
+ $s7_icon_padding_css .= "padding: $s7_border_size;background-color: $s7_bgcolor;border-radius: 25px; ";
52
+ $s7_hover_styles = ".ht-ctc.style-7_1:hover .ctc_s_7_icon_padding{background-color:$s7_bgcolor_hover;border-radius: 25px;}";
53
+ } elseif ( 'show' == $s7_cta_type ) {
54
+ $s7_n1_styles .= "padding:5px 25px; background-color:$s7_bgcolor;border-radius:25px;";
55
+ $s7_cta_css .= "padding: 1px 16px; color: $s7_icon_color; border-radius:10px; margin:0 10px; order: $s7_cta_order; ";
56
+ $s7_icon_padding_css .= "";
57
+ $s7_hover_styles = ".ht-ctc.style-7_1:hover .ctc_s_7_1{background-color:$s7_bgcolor_hover !important;}.ht-ctc.style-7_1:hover .ctc_s_7_1_cta{color:$s7_icon_color_hover !important;}.ht-ctc.style-7_1:hover svg g path{fill:$s7_icon_color_hover !important;}";
58
+ }
59
+
60
+
61
+ // svg values
62
+ $ht_ctc_svg_css = "pointer-events:none; display:block; height:$s7_icon_size; width:$s7_icon_size;";
63
+ $s7_svg_attrs = array(
64
+ 'color' => "$s7_icon_color",
65
+ 'icon_size' => "$s7_icon_size",
66
+ 'type' => "$type",
67
+ 'ht_ctc_svg_css' => "$ht_ctc_svg_css",
68
+ );
69
+
70
+ // cta order
71
+ $s7_cta_order = "1";
72
+ if ('right' == $options['side_2']) {
73
+ // if side_2 is right then cta is left
74
+ $s7_cta_order = "0";
75
+ }
76
+
77
+ include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/ht-ctc-svg-images.php';
78
+ ?>
79
+ <style id="ht-ctc-s7_1">
80
+ <?php echo $s7_hover_styles ?>
81
+ </style>
82
+
83
+ <div class="ctc_s_7_1" style="<?php echo $s7_n1_styles; ?>">
84
+ <p class="ctc_s_7_1_cta ctc-analytics <?php echo $s7_cta_class ?>" style="<?php echo $s7_cta_css ?>"><?php echo $call_to_action; ?></p>
85
+ <div class="ctc_s_7_icon_padding ctc-analytics " style="<?php echo $s7_icon_padding_css ?>">
86
+ <?php echo ht_ctc_singlecolor( $s7_svg_attrs ); ?>
87
+ </div>
88
+ </div>
new/inc/styles/style-8.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Style - 5
4
  *
5
  * Button with icon
6
  *
@@ -10,46 +10,53 @@ if ( ! defined( 'ABSPATH' ) ) exit;
10
 
11
  $s8_options = get_option( 'ht_ctc_s8' );
12
 
13
- wp_enqueue_style('ht_ctc_font_css');
14
- wp_enqueue_style('ht_ctc_mdstyle8_css');
15
-
16
-
17
- $s8_txt_color = esc_attr( $s8_options['s8_txt_color'] );
18
  $s8_icon_color = esc_attr( $s8_options['s8_icon_color'] );
 
 
19
  $s8_txt_color_on_hover = esc_attr( $s8_options['s8_txt_color_on_hover'] );
20
  $s8_bg_color = esc_attr( $s8_options['s8_bg_color'] );
21
  $s8_bg_color_on_hover = esc_attr( $s8_options['s8_bg_color_on_hover'] );
22
 
23
- $s8_icon_color_on_hover = esc_attr( $s8_options['s8_icon_color_on_hover'] );
24
-
25
  $s8_icon_position = esc_attr( $s8_options['s8_icon_position'] );
26
-
27
  $s8_btn_size = esc_attr( $s8_options['s8_btn_size'] );
28
 
29
- $s8_icon_size_db = esc_attr( $s8_options['s8_icon_size'] );
30
- $s8_icon_size = ('' == $s8_icon_size_db) ? "" : "font-size: $s8_icon_size_db;";
31
- // $s8_icon_size = ('' == $s8_icon_size_db) ? "font-size: 12px;" : "font-size: $s8_icon_size_db;";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
- $s8_text_size_db = esc_attr( $s8_options['s8_text_size'] );
34
- $s8_text_size = ('' == $s8_text_size_db) ? "" : "font-size: $s8_text_size_db;";
35
- // $s8_text_size = ('' == $s8_text_size_db) ? "font-size: 16px;" : "font-size: $s8_text_size_db;";
36
  ?>
37
 
38
- <div class = "mdstyle8 ht-ctc-style-8 ctc-analytics" >
39
- <span class="waves-effect waves-light <?php echo $s8_btn_size ?> ctc-analytics" style="background-color: <?php echo $s8_bg_color ?>; "
40
- onmouseover = "this.style.backgroundColor = '<?php echo $s8_bg_color_on_hover ?>',
41
- document.getElementsByClassName('ht-ctc-s8-icon')[0].style.color = '<?php echo $s8_icon_color_on_hover ?>',
42
- document.getElementsByClassName('ht-ctc-s8-text')[0].style.color = '<?php echo $s8_txt_color_on_hover ?>'
43
- "
44
- onmouseout = "this.style.backgroundColor = '<?php echo $s8_bg_color ?>',
45
- document.getElementsByClassName('ht-ctc-s8-icon')[0].style.color = '<?php echo $s8_icon_color ?>',
46
- document.getElementsByClassName('ht-ctc-s8-text')[0].style.color = '<?php echo $s8_txt_color ?>'
47
- ">
48
- <i class="material-icons s8_icon ctc-analytics <?php echo $s8_icon_position ?> ctc-icon ctc-icon-whatsapp2 ht-ctc-s8-icon"
49
- style="color: <?php echo $s8_icon_color ?>; <?php echo $s8_icon_size ?>">
50
- </i>
51
- <span class="ht-ctc-s8-text s8_span ctc-analytics" style="color: <?php echo $s8_txt_color ?>; <?php echo $s8_text_size ?>">
52
- <?php echo $call_to_action ?>
53
- </span>
54
- </span>
55
  </div>
1
  <?php
2
  /**
3
+ * Style - 8
4
  *
5
  * Button with icon
6
  *
10
 
11
  $s8_options = get_option( 'ht_ctc_s8' );
12
 
 
 
 
 
 
13
  $s8_icon_color = esc_attr( $s8_options['s8_icon_color'] );
14
+ $s8_icon_color_on_hover = esc_attr( $s8_options['s8_icon_color_on_hover'] );
15
+ $s8_txt_color = esc_attr( $s8_options['s8_txt_color'] );
16
  $s8_txt_color_on_hover = esc_attr( $s8_options['s8_txt_color_on_hover'] );
17
  $s8_bg_color = esc_attr( $s8_options['s8_bg_color'] );
18
  $s8_bg_color_on_hover = esc_attr( $s8_options['s8_bg_color_on_hover'] );
19
 
 
 
20
  $s8_icon_position = esc_attr( $s8_options['s8_icon_position'] );
 
21
  $s8_btn_size = esc_attr( $s8_options['s8_btn_size'] );
22
 
23
+ $s8_icon_size = ('' == esc_attr( $s8_options['s8_icon_size'] )) ? "17px" : esc_attr( $s8_options['s8_icon_size'] );
24
+
25
+ $s8_text_size = esc_attr( $s8_options['s8_text_size'] );
26
+ $s8_text_size_css = ('' == $s8_text_size) ? "" : "font-size: $s8_text_size;";
27
+ // $s8_text_size_css = ('' == $s8_text_size) ? "font-size: 16px;" : "font-size: $s8_text_size;";
28
+
29
+ $s8_height = '36px';
30
+ if ('btn-large' == $s8_btn_size) {
31
+ $s8_height = '54px';
32
+ }
33
+
34
+ $s8_svg_attrs = array (
35
+ 'color' => "$s8_icon_color",
36
+ 'icon_size' => "$s8_icon_size",
37
+ 'type' => "$type",
38
+ 'ht_ctc_svg_css' => 'display:block;',
39
+ );
40
 
41
+ $s8_icon_css = ( 'right' == $s8_icon_position ) ? "order:1;margin-left: 15px;" : "order:0;margin-right: 15px;";
42
+ $s8_text_css = "color:$s8_txt_color; $s8_text_size_css ";
43
+ $s8_main_span_css = "display: flex;padding: 0 2rem;letter-spacing: .5px;transition: .2s ease-out;text-align: center;justify-content: center;align-items: center;border-radius:2px;height:$s8_height;line-height:$s8_height;vertical-align:middle;box-shadow:0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12), 0 3px 1px -2px rgba(0,0,0,.2);box-sizing:inherit;background-color:$s8_bg_color;";
44
  ?>
45
 
46
+ <style id="ht-ctc-s8">
47
+ .ht-ctc-style-8 .s_8 svg{<?php echo $s8_icon_css ?>;}.ht-ctc:hover svg g path{fill:<?php echo $s8_txt_color_on_hover ?> !important;}.ht-ctc:hover .ht-ctc-s8-text{color:<?php echo $s8_txt_color_on_hover ?> !important;}.ht-ctc:hover .ht-ctc-style-8 .s_8{box-shadow: 0 3px 3px 0 rgba(7,6,6,.14), 0 1px 7px 0 rgba(0,0,0,.12), 0 3px 1px -1px rgba(0,0,0,.2) !important; transition: .2s ease-out !important; background-color:<?php echo $s8_bg_color_on_hover ?> !important; }
48
+ </style>
49
+
50
+ <div class = "ht-ctc-style-8 ctc-analytics" >
51
+ <span class="s_8 waves-effect waves-light ctc-analytics" style="<?php echo $s8_main_span_css ?>">
52
+ <?php
53
+ if ('hide' !== $s8_icon_position) {
54
+ include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/ht-ctc-svg-images.php';
55
+ echo ht_ctc_singlecolor( $s8_svg_attrs );
56
+ }
57
+ ?>
58
+ <span class="ht-ctc-s8-text s8_span ctc-analytics" style="<?php echo $s8_text_css; ?>">
59
+ <?php echo $call_to_action ?>
60
+ </span>
61
+ </span>
 
62
  </div>
readme.txt CHANGED
@@ -3,7 +3,7 @@ Requires at least: 4.6
3
  Tested up to: 5.5.3
4
  Requires PHP: 5.6
5
  Contributors: holithemes
6
- Stable tag: 2.12.1
7
  Tags: whatsapp, whatsapp business, click to chat, whatsapp chat, whatsapp support, whatsapp group, whatsapp message, social chat, whatsapp wordpress, whatsapp floating button, whatsapp icon, holithemes
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -28,17 +28,6 @@ Add your 'WhatsApp' or 'WhatsApp Business' Number. And let your website visitors
28
 
29
  **Desktop:** Navigates to Webpage(web.whatsapp.com) / WhatsApp Desktop App.
30
 
31
- = Next v3.0 =
32
-
33
- [Download v3.0-beta.1 from Plugin Development Version](https://wordpress.org/plugins/click-to-chat-for-whatsapp/advanced/#plugin-download-history-stats:~:text=Please%20select%20a%20specific%20version%20to%20download).
34
-
35
- * Call to Action for Style-2, 3, 7.
36
- * New 'Style-7 Extend'.
37
- * Style-3 is now Style-3, 'Style-3 Extend'.
38
- * Improved Style-7, Style-8.
39
- * Animations
40
- * New Variable for prefilled message. [url] - replaces with full url including parameters.
41
-
42
  = 💎 Styles =
43
 
44
  Select Style that matches your Website design.
@@ -70,6 +59,7 @@ Add variables to change values dynamically
70
  {site} -> Website Title
71
  {title} -> Page Title
72
  {url} -> Web page URL
 
73
  `
74
 
75
  With these variables we can understand from which page the user started WhatsApp chat.
@@ -90,7 +80,7 @@ Additional, variables to change values dynamically
90
  `
91
  = 📒 Change Values at page level =
92
 
93
- > Change 'WhatsApp Number', 'Call to Action' at the page level
94
 
95
  [Page level settings](https://holithemes.com/plugins/click-to-chat/change-values-at-page-level/)
96
 
@@ -120,7 +110,7 @@ Creates an Event when the user clicks on WhatsApp Icon/button.
120
 
121
  = 🔆 Localization =
122
 
123
- compatible with [WPML](https://wpml.org/), Polylang.
124
 
125
  Easy to setup different values for language
126
  * WhatsApp Number
@@ -364,7 +354,7 @@ For any issues with the plugin / suggestions:
364
 
365
  * please create a [new topic](https://wordpress.org/support/plugin/click-to-chat-for-whatsapp/)
366
 
367
- * 📧 clicktochat@holithemes.com
368
 
369
  * [WhatsApp us](http://api.whatsapp.com/send?phone=919494429789&text=Hi%20HoliThemes,%20I%20have%20a%20question:)
370
 
@@ -393,6 +383,19 @@ After Activate the plugin, add WhatsApp Number at plugin settings.
393
 
394
  == Changelog ==
395
 
 
 
 
 
 
 
 
 
 
 
 
 
 
396
  = 2.12.1 =
397
  * Fix: Style-4 img position issue.
398
  * Updated: admin page
3
  Tested up to: 5.5.3
4
  Requires PHP: 5.6
5
  Contributors: holithemes
6
+ Stable tag: 3.0.3
7
  Tags: whatsapp, whatsapp business, click to chat, whatsapp chat, whatsapp support, whatsapp group, whatsapp message, social chat, whatsapp wordpress, whatsapp floating button, whatsapp icon, holithemes
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
28
 
29
  **Desktop:** Navigates to Webpage(web.whatsapp.com) / WhatsApp Desktop App.
30
 
 
 
 
 
 
 
 
 
 
 
 
31
  = 💎 Styles =
32
 
33
  Select Style that matches your Website design.
59
  {site} -> Website Title
60
  {title} -> Page Title
61
  {url} -> Web page URL
62
+ [url] -> Web page full URL including parameters
63
  `
64
 
65
  With these variables we can understand from which page the user started WhatsApp chat.
80
  `
81
  = 📒 Change Values at page level =
82
 
83
+ > Change 'WhatsApp Number', 'Call to Action' at the page level (while editing the post, at the right side bar 'Click to Chat' metabox)
84
 
85
  [Page level settings](https://holithemes.com/plugins/click-to-chat/change-values-at-page-level/)
86
 
110
 
111
  = 🔆 Localization =
112
 
113
+ Compatible with [WPML](https://wpml.org/), Polylang.
114
 
115
  Easy to setup different values for language
116
  * WhatsApp Number
354
 
355
  * please create a [new topic](https://wordpress.org/support/plugin/click-to-chat-for-whatsapp/)
356
 
357
+ * 📧 ctc@holithemes.com
358
 
359
  * [WhatsApp us](http://api.whatsapp.com/send?phone=919494429789&text=Hi%20HoliThemes,%20I%20have%20a%20question:)
360
 
383
 
384
  == Changelog ==
385
 
386
+ = 3.0.3 =
387
+ * Updated Animations
388
+ * Fixed: {url} variable at WooCommerce Pre-filled message.
389
+
390
+ = 3.0 =
391
+ * Call to Action for Style-2, 3, 7.
392
+ * New 'Style-7 Extend'.
393
+ * Style-3 is now Style-3, 'Style-3 Extend'.
394
+ * Improved Style-7, Style-8.
395
+ * Animations
396
+ * New Variable for prefilled message. [url] - replaces with full url including parameters.
397
+ * Updated User Interface
398
+
399
  = 2.12.1 =
400
  * Fix: Style-4 img position issue.
401
  * Updated: admin page