Click to Chat for WhatsApp Chat - Version 3.3.3

Version Description

  • User Interface: Display settings
  • New: Display settings for custom post types
  • User Interface: same_settings for mobile, desktop
  • User Interface: WooCommerce related settings now in seperate page
Download this release

Release Info

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

Code changes from version 3.3.2 to 3.3.3

Files changed (58) hide show
  1. click-to-chat.php +2 -2
  2. common/class-ht-ctc-switch.php +1 -1
  3. new/admin/admin.php +2 -0
  4. new/admin/admin_assets/css/admin.css +9 -3
  5. new/admin/admin_assets/js/333.admin.js +249 -0
  6. new/admin/admin_assets/js/admin.js +56 -33
  7. new/admin/admin_commons/admin-desktop.php +0 -125
  8. new/admin/admin_commons/admin-device-settings.php +209 -0
  9. new/admin/admin_commons/admin-mobile.php +0 -148
  10. new/admin/admin_commons/admin-show-hide.php +155 -348
  11. new/admin/admin_commons/admin-sidebar-content.php +1 -1
  12. new/admin/admin_commons/class-ht-ctc-admin-hooks.php +39 -1
  13. new/admin/class-ht-ctc-admin-group-page.php +6 -15
  14. new/admin/class-ht-ctc-admin-main-page.php +5 -29
  15. new/admin/class-ht-ctc-admin-other-settings.php +0 -3
  16. new/admin/class-ht-ctc-admin-scripts.php +2 -2
  17. new/admin/class-ht-ctc-admin-share-page.php +6 -15
  18. new/admin/class-ht-ctc-update-db.php +0 -150
  19. new/admin/db/class-ht-ctc-db.php +237 -0
  20. new/admin/{class-ht-ctc-db.php → db/class-ht-ctc-db2.php} +55 -212
  21. new/admin/db/class-ht-ctc-update-db-backup.php +539 -0
  22. new/admin/db/class-ht-ctc-update-db.php +637 -0
  23. new/inc/assets/js/dev/app.dev.js +11 -2
  24. new/inc/chat/class-ht-ctc-chat-shortcode.php +7 -3
  25. new/inc/chat/class-ht-ctc-chat.php +18 -6
  26. new/inc/class-ht-ctc-register.php +15 -3
  27. new/inc/commons/position-to-place.php +16 -10
  28. new/inc/commons/show-hide.php +234 -139
  29. new/inc/group/class-ht-ctc-group-shortcode.php +7 -3
  30. new/inc/group/class-ht-ctc-group.php +8 -4
  31. new/inc/share/class-ht-ctc-share-shortcode.php +7 -3
  32. new/inc/share/class-ht-ctc-share.php +8 -4
  33. new/inc/styles/style-2.php +10 -1
  34. new/inc/styles/style-3.php +1 -1
  35. new/inc/styles/style-3_1.php +1 -1
  36. new/inc/styles/style-7.php +2 -10
  37. new/inc/styles/style-7_1.php +1 -7
  38. new/tools/woo/class-ht-ctc-admin-woo.php +0 -84
  39. new/tools/woo/class-ht-ctc-woo.php +40 -6
  40. new/tools/woo/ht-ctc-woo.php +39 -6
  41. new/tools/woo/woo-admin/class-ht-ctc-admin-woo-page.php +236 -0
  42. prev/admin/admin.php +6 -6
  43. prev/admin/class-ccw-admin-menu.php +2 -2
  44. prev/inc/class-ccw-shortcode.php +6 -6
  45. prev/inc/class-ht-ccw-register.php +1 -1
  46. prev/inc/commons/styles-list-sc/sc-style-2.php +1 -1
  47. prev/inc/commons/styles-list-sc/sc-style-5.php +1 -1
  48. prev/inc/commons/styles-list-sc/sc-style-8.1.php +1 -1
  49. prev/inc/commons/styles-list-sc/sc-style-8.php +1 -1
  50. prev/inc/commons/styles-list/style-2.php +1 -1
  51. prev/inc/commons/styles-list/style-3.php +1 -1
  52. prev/inc/commons/styles-list/style-4.php +1 -1
  53. prev/inc/commons/styles-list/style-5.php +1 -1
  54. prev/inc/commons/styles-list/style-8.php +1 -1
  55. prev/inc/commons/styles-list/style-9.php +1 -1
  56. prev/inc/commons/styles-list/style-99.php +1 -1
  57. prev/inc/commons/styles.php +6 -6
  58. readme.txt +11 -7
click-to-chat.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Click to Chat
4
  Plugin URI: https://wordpress.org/plugins/click-to-chat-for-whatsapp/
5
  Description: Lets make your Web page visitors contact you through WhatsApp with a single click/tap
6
- Version: 3.3.2
7
  Author: HoliThemes
8
  Author URI: https://holithemes.com/plugins/click-to-chat/
9
  License: GPL2
@@ -17,7 +17,7 @@ if ( ! defined( 'WPINC' ) ) {
17
 
18
  // ctc - Version - update version at readme 'Stable tag'
19
  if ( ! defined( 'HT_CTC_VERSION' ) ) {
20
- define( 'HT_CTC_VERSION', '3.3.2' );
21
  }
22
 
23
  // define HT_CTC_PLUGIN_FILE
3
  Plugin Name: Click to Chat
4
  Plugin URI: https://wordpress.org/plugins/click-to-chat-for-whatsapp/
5
  Description: Lets make your Web page visitors contact you through WhatsApp with a single click/tap
6
+ Version: 3.3.3
7
  Author: HoliThemes
8
  Author URI: https://holithemes.com/plugins/click-to-chat/
9
  License: GPL2
17
 
18
  // ctc - Version - update version at readme 'Stable tag'
19
  if ( ! defined( 'HT_CTC_VERSION' ) ) {
20
+ define( 'HT_CTC_VERSION', '3.3.3' );
21
  }
22
 
23
  // define HT_CTC_PLUGIN_FILE
common/class-ht-ctc-switch.php CHANGED
@@ -74,7 +74,7 @@ class HT_CTC_Swift {
74
 
75
  $ht_ctc_switch = get_option('ht_ctc_switch');
76
 
77
- if ( 'yes' == $ht_ctc_switch['interface'] ) {
78
  $is_new = 'yes';
79
  }
80
  }
74
 
75
  $ht_ctc_switch = get_option('ht_ctc_switch');
76
 
77
+ if ( isset($ht_ctc_switch['interface']) && 'yes' == $ht_ctc_switch['interface'] ) {
78
  $is_new = 'yes';
79
  }
80
  }
new/admin/admin.php CHANGED
@@ -28,6 +28,8 @@ include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-scripts.php';
28
  // Main, Chat admin page
29
  include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-main-page.php';
30
 
 
 
31
  // group admin page
32
  if ( isset ( $ht_ctc_othersettings['enable_group'] ) ) {
33
  include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-group-page.php';
28
  // Main, Chat admin page
29
  include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-main-page.php';
30
 
31
+ do_action('ht_ctc_ah_admin_includes_after_main_page' );
32
+
33
  // group admin page
34
  if ( isset ( $ht_ctc_othersettings['enable_group'] ) ) {
35
  include_once HT_CTC_PLUGIN_DIR .'new/admin/class-ht-ctc-admin-group-page.php';
new/admin/admin_assets/css/admin.css CHANGED
@@ -1,13 +1,19 @@
1
  /* Admin CSS */
2
 
3
- .show-hide_display-none {
 
4
  display: none;
5
  }
6
 
7
- .show-hide_display-block {
8
- display: block;
 
9
  }
10
 
 
 
 
 
11
  .options .submit {
12
  position: sticky !important;
13
  bottom: 1px;
1
  /* Admin CSS */
2
 
3
+ .show-hide_display-none,
4
+ .not_samesettings {
5
  display: none;
6
  }
7
 
8
+ .show_settings,
9
+ .hide_settings {
10
+ display: none;
11
  }
12
 
13
+ /* .show_hide_types .ctc_radio_text {
14
+ padding-left: 28px !important;
15
+ } */
16
+
17
  .options .submit {
18
  position: sticky !important;
19
  bottom: 1px;
new/admin/admin_assets/js/333.admin.js ADDED
@@ -0,0 +1,249 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Click to Chat
2
+ document.addEventListener('DOMContentLoaded', function () {
3
+
4
+ // M.AutoInit();
5
+
6
+ var elems = document.querySelectorAll('select');
7
+ M.FormSelect.init(elems, {});
8
+
9
+ var elems = document.querySelectorAll('.collapsible');
10
+ M.Collapsible.init(elems, {});
11
+
12
+ var elems = document.querySelectorAll('.modal');
13
+ M.Modal.init(elems, {});
14
+
15
+ var elems = document.querySelectorAll('.tooltipped');
16
+ M.Tooltip.init(elems, {});
17
+
18
+ });
19
+
20
+ (function ($) {
21
+
22
+ // ready
23
+ $(function () {
24
+
25
+ $('select').formSelect();
26
+ $('.collapsible').collapsible();
27
+ $('.modal').modal();
28
+ $('.tooltipped').tooltip();
29
+ $('.ht-ctc-color').wpColorPicker();
30
+
31
+ // var toast = false;
32
+ // if (typeof M !== "undefined" && M.toast) {
33
+ // toast = true;
34
+ // }
35
+
36
+ // if (toast) {
37
+ // M.toast({ html: 'Hided on Mobile devices', classes: 'rounded' });
38
+ // }
39
+
40
+ // show/hide settings
41
+ function show_hide_options() {
42
+
43
+ // default display
44
+ var val = $('.global_display:checked').val();
45
+
46
+ $('.global_show_or_hide_label').html('(' + val + ')');
47
+
48
+ if (val == 'show') {
49
+ $(".hide_settings").show();
50
+ $(".show_hide_types .show_btn").attr('disabled', 'disabled');
51
+ $(".show_hide_types .show_box").hide();
52
+ } else if (val == 'hide') {
53
+ $(".show_settings").show();
54
+ $(".show_hide_types .hide_btn").attr('disabled', 'disabled');
55
+ $(".show_hide_types .hide_box").hide();
56
+ }
57
+
58
+ // on change
59
+ $(".global_display").on("change", function (e) {
60
+
61
+ var change_val = e.target.value;
62
+ $('.global_show_or_hide_label').html('(' + change_val + ')');
63
+
64
+ $(".hide_settings").hide();
65
+ $(".show_settings").hide();
66
+ $(".show_hide_types .show_btn").removeAttr('disabled');
67
+ $(".show_hide_types .hide_btn").removeAttr('disabled');
68
+ $(".show_hide_types .show_box").hide();
69
+ $(".show_hide_types .hide_box").hide();
70
+
71
+ if (change_val == 'show') {
72
+ $(".hide_settings").show(500);
73
+ $(".show_hide_types .show_btn").attr('disabled', 'disabled');
74
+ $(".show_hide_types .hide_box").show();
75
+ } else if (change_val == 'hide') {
76
+ $(".show_settings").show(500);
77
+ $(".show_hide_types .hide_btn").attr('disabled', 'disabled');
78
+ $(".show_hide_types .show_box").show();
79
+ }
80
+ });
81
+
82
+ }
83
+ show_hide_options();
84
+
85
+
86
+
87
+ // call to action
88
+ var cta_styles = ['.ht_ctc_s2', '.ht_ctc_s3', '.ht_ctc_s3_1', '.ht_ctc_s7'];
89
+ cta_styles.forEach(ht_ctc_admin_cta);
90
+
91
+ function ht_ctc_admin_cta(style) {
92
+ // default display
93
+ var val = $(style + ' .select_cta_type').find(":selected").val();
94
+ if (val == 'hide') {
95
+ $(style + " .cta_stick").hide();
96
+ }
97
+
98
+ // on change
99
+ $(style + " .select_cta_type").on("change", function (e) {
100
+ var change_val = e.target.value;
101
+ if (change_val == 'hide') {
102
+ $(style + " .cta_stick").hide(100);
103
+ } else {
104
+ $(style + " .cta_stick").show(200);
105
+ }
106
+ });
107
+ }
108
+
109
+ function ht_ctc_admin_animations() {
110
+ // default display
111
+ var val = $('.select_an_type').find(":selected").val();
112
+ if (val == 'no-animation') {
113
+ $(".an_delay").hide();
114
+ $(".an_itr").hide();
115
+ }
116
+
117
+ // on change
118
+ $(".select_an_type").on("change", function (e) {
119
+
120
+ var change_val = e.target.value;
121
+
122
+ if (change_val == 'no-animation') {
123
+ $(".an_delay").hide();
124
+ $(".an_itr").hide();
125
+ } else {
126
+ $(".an_delay").show(500);
127
+ $(".an_itr").show(500);
128
+ }
129
+ });
130
+ }
131
+ ht_ctc_admin_animations();
132
+
133
+ // on change - styles
134
+ $(".chat_select_style").on("change", function (e) {
135
+ $(".customize_styles_link").animate({ fontSize: '1.2em' }, "slow");
136
+ });
137
+
138
+ // Deskop, Mobile - same settings
139
+ function desktop_mobile() {
140
+
141
+ // same setting
142
+ if ($('.same_settings').is(':checked')) {
143
+ $(".not_samesettings").hide();
144
+ } else {
145
+ $(".not_samesettings").show();
146
+ }
147
+
148
+ $(".same_settings").on("change", function (e) {
149
+
150
+ if ($('.same_settings').is(':checked')) {
151
+ $(".not_samesettings").hide(900);
152
+ } else {
153
+ $(".not_samesettings").show(900);
154
+ }
155
+
156
+ });
157
+
158
+ }
159
+ desktop_mobile()
160
+
161
+ // WhatsApp number
162
+ function wn() {
163
+
164
+ var cc = $("#whatsapp_cc").val();
165
+ var num = $("#whatsapp_number").val();
166
+
167
+ $("#whatsapp_cc").on("change paste keyup", function (e) {
168
+ cc = $("#whatsapp_cc").val();
169
+ call();
170
+ });
171
+
172
+ $("#whatsapp_number").on("change paste keyup", function (e) {
173
+ num = $("#whatsapp_number").val();
174
+ call();
175
+ });
176
+
177
+ function call() {
178
+ $(".ht_ctc_wn").html(cc + '' + num);
179
+ $("#ctc_whatsapp_number").val(cc + '' + num);
180
+ }
181
+
182
+ }
183
+ wn();
184
+
185
+ // webhook
186
+ function hook() {
187
+
188
+ // webhook value - html
189
+ var hook_value_html = $('.add_hook_value').attr('data-html');
190
+
191
+ // add value
192
+ $(document).on('click', '.add_hook_value', function () {
193
+
194
+ $('.ctc_hook_value').append(hook_value_html);
195
+ });
196
+
197
+ // Remove value
198
+ $('.ctc_hook_value').on('click', '.hook_remove_value', function (e) {
199
+ e.preventDefault();
200
+ $(this).closest('.additional-value').remove();
201
+ });
202
+
203
+ }
204
+ hook();
205
+
206
+ // things based on screen size
207
+ function ss() {
208
+
209
+ var is_mobile = (typeof screen.width !== "undefined" && screen.width > 1024) ? "no" : "yes";
210
+
211
+ if ('yes' == is_mobile) {
212
+
213
+ // WhatsApp number tooltip position for mobile
214
+ // $("#whatsapp_cc").data('position', 'bottom');
215
+ $("#whatsapp_cc").attr('data-position', 'bottom');
216
+ $("#whatsapp_number").attr('data-position', 'bottom');
217
+ }
218
+ }
219
+ ss();
220
+
221
+ function other() {
222
+
223
+ // hover text on save_changes button
224
+ var text = $('#ctc_save_changes_hover_text').text();
225
+ $("#submit").attr('title', text);
226
+
227
+ // analytics - ga4 display only if ga is enabled.
228
+ $("#google_analytics").on("change", function (e) {
229
+ console.log('change worked');
230
+ if ($('#google_analytics').is(':checked')) {
231
+ $(".ctc_ga4").show();
232
+ } else {
233
+ $(".ctc_ga4").hide();
234
+ }
235
+ });
236
+
237
+ if ($('#google_analytics').is(':checked')) {
238
+ $(".ctc_ga4").show();
239
+ } else {
240
+ $(".ctc_ga4").hide();
241
+ }
242
+
243
+ }
244
+ other();
245
+
246
+ });
247
+
248
+
249
+ })(jQuery);
new/admin/admin_assets/js/admin.js CHANGED
@@ -1,4 +1,4 @@
1
- // Click to Chat v3.2.9
2
  document.addEventListener('DOMContentLoaded', function () {
3
 
4
  // M.AutoInit();
@@ -28,33 +28,61 @@ document.addEventListener('DOMContentLoaded', function () {
28
  $('.tooltipped').tooltip();
29
  $('.ht-ctc-color').wpColorPicker();
30
 
 
 
 
 
 
 
 
 
 
31
  // show/hide settings
32
- function ht_ctc_show_hide_options() {
33
 
34
  // default display
35
- var val = $('.select_show_or_hide').find(":selected").val();
 
 
 
36
  if (val == 'show') {
37
- $(".showbased").show();
 
 
38
  } else if (val == 'hide') {
39
- $(".hidebased").show();
 
 
40
  }
41
 
42
  // on change
43
- $(".select_show_or_hide").on("change", function (e) {
44
 
45
  var change_val = e.target.value;
46
- $(".showbased").hide();
47
- $(".hidebased").hide();
 
 
 
 
 
 
48
 
49
  if (change_val == 'show') {
50
- $(".showbased").show(500);
 
 
51
  } else if (change_val == 'hide') {
52
- $(".hidebased").show(500);
 
 
53
  }
54
  });
55
 
56
  }
57
- ht_ctc_show_hide_options();
 
 
58
 
59
  // call to action
60
  var cta_styles = ['.ht_ctc_s2', '.ht_ctc_s3', '.ht_ctc_s3_1', '.ht_ctc_s7'];
@@ -107,33 +135,28 @@ document.addEventListener('DOMContentLoaded', function () {
107
  $(".customize_styles_link").animate({ fontSize: '1.2em' }, "slow");
108
  });
109
 
110
- // Deskop, Mobile
111
- if ($('#hideon_desktop').is(':checked')) {
112
- $(".ht_ctc_admin_desktop").hide();
113
- }
114
-
115
- if ($('#hideon_mobile').is(':checked')) {
116
- $(".ht_ctc_admin_mobile").hide();
117
- }
118
 
119
- $(".hidebasedondevice").on("change", function (e) {
120
- if ($('#hideon_desktop').is(':checked')) {
121
- $(".ht_ctc_admin_desktop").hide();
122
  } else {
123
- $(".ht_ctc_admin_desktop").show();
124
  }
125
 
126
- if ($('#hideon_mobile').is(':checked')) {
127
- $(".ht_ctc_admin_mobile").hide();
128
- } else {
129
- $(".ht_ctc_admin_mobile").show();
130
- }
131
- });
132
 
133
- // hide nothing or hide only on one device.
134
- $(document).on('click', '.hidebasedondevice', function () {
135
- $('.hidebasedondevice').not(this).prop('checked', false);
136
- });
 
 
 
 
 
 
137
 
138
  // WhatsApp number
139
  function wn() {
1
+ // Click to Chat
2
  document.addEventListener('DOMContentLoaded', function () {
3
 
4
  // M.AutoInit();
28
  $('.tooltipped').tooltip();
29
  $('.ht-ctc-color').wpColorPicker();
30
 
31
+ // var toast = false;
32
+ // if (typeof M !== "undefined" && M.toast) {
33
+ // toast = true;
34
+ // }
35
+
36
+ // if (toast) {
37
+ // M.toast({ html: 'Hided on Mobile devices', classes: 'rounded' });
38
+ // }
39
+
40
  // show/hide settings
41
+ function show_hide_options() {
42
 
43
  // default display
44
+ var val = $('.global_display:checked').val();
45
+
46
+ $('.global_show_or_hide_label').html('('+val+')');
47
+
48
  if (val == 'show') {
49
+ $(".hide_settings").show();
50
+ $(".show_hide_types .show_btn").attr('disabled', 'disabled');
51
+ $(".show_hide_types .show_box").hide();
52
  } else if (val == 'hide') {
53
+ $(".show_settings").show();
54
+ $(".show_hide_types .hide_btn").attr('disabled', 'disabled');
55
+ $(".show_hide_types .hide_box").hide();
56
  }
57
 
58
  // on change
59
+ $(".global_display").on("change", function (e) {
60
 
61
  var change_val = e.target.value;
62
+ $('.global_show_or_hide_label').html('('+change_val+')');
63
+
64
+ $(".hide_settings").hide();
65
+ $(".show_settings").hide();
66
+ $(".show_hide_types .show_btn").removeAttr('disabled');
67
+ $(".show_hide_types .hide_btn").removeAttr('disabled');
68
+ $(".show_hide_types .show_box").hide();
69
+ $(".show_hide_types .hide_box").hide();
70
 
71
  if (change_val == 'show') {
72
+ $(".hide_settings").show(500);
73
+ $(".show_hide_types .show_btn").attr('disabled', 'disabled');
74
+ $(".show_hide_types .hide_box").show();
75
  } else if (change_val == 'hide') {
76
+ $(".show_settings").show(500);
77
+ $(".show_hide_types .hide_btn").attr('disabled', 'disabled');
78
+ $(".show_hide_types .show_box").show();
79
  }
80
  });
81
 
82
  }
83
+ show_hide_options();
84
+
85
+
86
 
87
  // call to action
88
  var cta_styles = ['.ht_ctc_s2', '.ht_ctc_s3', '.ht_ctc_s3_1', '.ht_ctc_s7'];
135
  $(".customize_styles_link").animate({ fontSize: '1.2em' }, "slow");
136
  });
137
 
138
+ // Deskop, Mobile - same settings
139
+ function desktop_mobile() {
 
 
 
 
 
 
140
 
141
+ // same setting
142
+ if ($('.same_settings').is(':checked')) {
143
+ $(".not_samesettings").hide();
144
  } else {
145
+ $(".not_samesettings").show();
146
  }
147
 
148
+ $(".same_settings").on("change", function (e) {
 
 
 
 
 
149
 
150
+ if ($('.same_settings').is(':checked')) {
151
+ $(".not_samesettings").hide(900);
152
+ } else {
153
+ $(".not_samesettings").show(900);
154
+ }
155
+
156
+ });
157
+
158
+ }
159
+ desktop_mobile()
160
 
161
  // WhatsApp number
162
  function wn() {
new/admin/admin_commons/admin-desktop.php DELETED
@@ -1,125 +0,0 @@
1
- <?php
2
- /**
3
- * Admin Desktop
4
- *
5
- * @package ctc
6
- * @subpackage Administration
7
- * @since 2.11
8
- */
9
-
10
- if ( ! defined( 'ABSPATH' ) ) exit;
11
-
12
- // style
13
- $style_desktop = ( isset( $options['style_desktop']) ) ? esc_attr( $options['style_desktop'] ) : '';
14
-
15
- // position
16
- $side_1 = ( isset( $options['side_1']) ) ? esc_attr( $options['side_1'] ) : '';
17
- $side_1_value = ( isset( $options['side_1_value']) ) ? esc_attr( $options['side_1_value'] ) : '';
18
- $side_2 = ( isset( $options['side_2']) ) ? esc_attr( $options['side_2'] ) : '';
19
- $side_2_value = ( isset( $options['side_2_value']) ) ? esc_attr( $options['side_2_value'] ) : '';
20
-
21
- ?>
22
-
23
- <ul class="collapsible">
24
- <li class="active">
25
- <div class="collapsible-header"><?php _e( 'Desktop', 'click-to-chat-for-whatsapp' ); ?></div>
26
- <div class="collapsible-body">
27
-
28
-
29
- <!-- style -->
30
- <p class="description ht_ctc_admin_desktop ht_ctc_subtitle"><?php _e( 'Select Style (Desktop)', 'click-to-chat-for-whatsapp' ); ?>:</p class="description">
31
- <div class="row ht_ctc_admin_desktop">
32
- <div class="input-field col s12 m12">
33
- <select name="<?= $dbrow; ?>[style_desktop]" class="chat_select_style select_style_desktop">
34
- <option value="1" <?= $style_desktop == 1 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-1', 'click-to-chat-for-whatsapp' ); ?></option>
35
- <option value="2" <?= $style_desktop == 2 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-2', 'click-to-chat-for-whatsapp' ); ?></option>
36
- <!-- <optgroup label="Style 3"> -->
37
- <option value="3" <?= $style_desktop == 3 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-3', 'click-to-chat-for-whatsapp' ); ?></option>
38
- <option value="3_1" <?= $style_desktop == '3_1' ? 'SELECTED' : ''; ?> >&emsp;<?php _e( 'Style-3 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
39
- <!-- </optgroup> -->
40
- <option value="4" <?= $style_desktop == 4 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-4', 'click-to-chat-for-whatsapp' ); ?></option>
41
- <option value="5" <?= $style_desktop == 5 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-5', 'click-to-chat-for-whatsapp' ); ?></option>
42
- <option value="6" <?= $style_desktop == 6 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-6', 'click-to-chat-for-whatsapp' ); ?></option>
43
- <option value="7" <?= $style_desktop == 7 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7', 'click-to-chat-for-whatsapp' ); ?></option>
44
- <option value="7_1" <?= $style_desktop == '7_1' ? 'SELECTED' : ''; ?> >&emsp;<?php _e( 'Style-7 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
45
- <option value="8" <?= $style_desktop == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
46
- <option value="99" <?= $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://holithemes.com/plugins/click-to-chat/list-of-styles/?utm_source=ctc&utm_medium=admin&utm_campaign=chat"><?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="<?= 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="<?= 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/?utm_source=ctc&utm_medium=admin&utm_campaign=chat"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a></span></p>
50
- </div>
51
- </div>
52
-
53
-
54
- <?php
55
- // Action hook - After select style - Desktop
56
- do_action('ht_ctc_ah_admin_desktop_after_select_sytle', $options, $dbrow );
57
- ?>
58
-
59
- <!-- Dekstop position -->
60
- <!-- side - 1 -->
61
- <p class="description ht_ctc_admin_desktop ht_ctc_subtitle"><?php _e( 'Position to Place (Desktop)', 'click-to-chat-for-whatsapp' ); ?>:</p>
62
- <div class="row ht_ctc_admin_desktop">
63
- <br>
64
- <div class="input-field col s6">
65
- <select name="<?= $dbrow; ?>[side_1]" class="select-2">
66
- <option value="bottom" <?= $side_1 == 'bottom' ? 'SELECTED' : ''; ?> ><?php _e( 'bottom', 'click-to-chat-for-whatsapp' ); ?></option>
67
- <option value="top" <?= $side_1 == 'top' ? 'SELECTED' : ''; ?> ><?php _e( 'top', 'click-to-chat-for-whatsapp' ); ?></option>
68
- </select>
69
- <label>top / bottom </label>
70
- </div>
71
- <div class="input-field col s6">
72
- <input name="<?= $dbrow; ?>[side_1_value]" value="<?= $side_1_value ?>" id="side_1_value" type="text" class="input-margin">
73
- <label for="side_1_value"><?php _e( 'E.g. 10px', 'click-to-chat-for-whatsapp' ); ?></label>
74
- </div>
75
- </div>
76
-
77
- <!-- side - 2 -->
78
- <div class="row ht_ctc_admin_desktop" style="margin-bottom:0;">
79
- <div class="input-field col s6">
80
- <select name="<?= $dbrow; ?>[side_2]" class="select-2">
81
- <option value="right" <?= $side_2 == 'right' ? 'SELECTED' : ''; ?> ><?php _e( 'right', 'click-to-chat-for-whatsapp' ); ?></option>
82
- <option value="left" <?= $side_2 == 'left' ? 'SELECTED' : ''; ?> ><?php _e( 'left', 'click-to-chat-for-whatsapp' ); ?></option>
83
- </select>
84
- <label><?php _e( 'right / left', 'click-to-chat-for-whatsapp' ); ?></label>
85
- </div>
86
-
87
- <div class="input-field col s6">
88
- <input name="<?= $dbrow; ?>[side_2_value]" value="<?= $side_2_value ?>" id="side_2_value" type="text" class="input-margin">
89
- <label for="side_2_value"><?php _e( 'E.g. 50%', 'click-to-chat-for-whatsapp' ); ?></label>
90
- </div>
91
- </div>
92
- <p class="description ht_ctc_admin_desktop"><?php _e( 'Add css units as suffix - e.g. 10px, 50%', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/position-to-place/?utm_source=ctc&utm_medium=admin&utm_campaign=chat">more info</a> </p>
93
-
94
- <br class="ht_ctc_admin_desktop">
95
- <hr class="ht_ctc_admin_desktop" style="max-width: 500px;">
96
- <br class="ht_ctc_admin_desktop">
97
-
98
-
99
- <?php
100
- // Hide on Desktop Devices
101
- if ( isset( $options['hideon_desktop'] ) ) {
102
- ?>
103
- <p>
104
- <label>
105
- <input name="<?= $dbrow; ?>[hideon_desktop]" type="checkbox" value="1" <?php checked( $options['hideon_desktop'], 1 ); ?> class="hidebasedondevice" id="hideon_desktop" />
106
- <span><?php _e( 'Hide on - Desktop Devices', 'click-to-chat-for-whatsapp' ); ?></span>
107
- </label>
108
- </p>
109
- <?php
110
- } else {
111
- ?>
112
- <p>
113
- <label>
114
- <input name="<?= $dbrow; ?>[hideon_desktop]" type="checkbox" value="1" class="hidebasedondevice" id="hideon_desktop" />
115
- <span><?php _e( 'Hide on - Desktop Devices', 'click-to-chat-for-whatsapp' ); ?></span>
116
- </label>
117
- </p>
118
- <?php
119
- }
120
- ?>
121
-
122
- </div>
123
- </div>
124
- </li>
125
- <ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
new/admin/admin_commons/admin-device-settings.php ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Admin settings
4
+ * select style
5
+ * postion to place
6
+ *
7
+ * same_settings - checkbox - if unchecked display setting for desktop, mobile
8
+ *
9
+ * @package ctc
10
+ * @subpackage Administration
11
+ * @since 2.11 ( updated on 3.3.3 merged - admin-mobile, admin-dekstop.php )
12
+ */
13
+
14
+ if ( ! defined( 'ABSPATH' ) ) exit;
15
+
16
+ // style
17
+ $style_desktop = ( isset( $options['style_desktop']) ) ? esc_attr( $options['style_desktop'] ) : '';
18
+ $style_mobile = ( isset( $options['style_mobile']) ) ? esc_attr( $options['style_mobile'] ) : '';
19
+
20
+
21
+ // desktop position
22
+ $side_1 = ( isset( $options['side_1']) ) ? esc_attr( $options['side_1'] ) : '';
23
+ $side_1_value = ( isset( $options['side_1_value']) ) ? esc_attr( $options['side_1_value'] ) : '';
24
+ $side_2 = ( isset( $options['side_2']) ) ? esc_attr( $options['side_2'] ) : '';
25
+ $side_2_value = ( isset( $options['side_2_value']) ) ? esc_attr( $options['side_2_value'] ) : '';
26
+
27
+ // mobile position
28
+ $mobile_side_1 = ( isset( $options['mobile_side_1']) ) ? esc_attr( $options['mobile_side_1'] ) : '';
29
+ $mobile_side_1_value = ( isset( $options['mobile_side_1_value'])) ? esc_attr( $options['mobile_side_1_value'] ) : '';
30
+ $mobile_side_2 = ( isset( $options['mobile_side_2']) ) ? esc_attr( $options['mobile_side_2'] ) : '';
31
+ $mobile_side_2_value = ( isset( $options['mobile_side_2_value'])) ? esc_attr( $options['mobile_side_2_value'] ) : '';
32
+
33
+
34
+ ?>
35
+
36
+ <ul class="collapsible">
37
+ <li class="active">
38
+ <div class="collapsible-header"><?php _e( 'Style, Position - Desktop, Mobile', 'click-to-chat-for-whatsapp' ); ?></div>
39
+ <div class="collapsible-body">
40
+
41
+ <blockquote class="not_samesettings" style="margin-bottom: 25px;">Desktop:</blockquote>
42
+
43
+ <!-- style -->
44
+ <p class="description ht_ctc_admin_desktop ht_ctc_subtitle"><?php _e( 'Select Style', 'click-to-chat-for-whatsapp' ); ?> <span class="not_samesettings"><?php _e( ' (Desktop)', 'click-to-chat-for-whatsapp' ); ?></span>:</p class="description">
45
+ <div class="row ht_ctc_admin_desktop">
46
+ <div class="input-field col s12 m12">
47
+ <select name="<?= $dbrow; ?>[style_desktop]" class="chat_select_style select_style_desktop">
48
+ <option value="1" <?= $style_desktop == 1 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-1', 'click-to-chat-for-whatsapp' ); ?></option>
49
+ <option value="2" <?= $style_desktop == 2 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-2', 'click-to-chat-for-whatsapp' ); ?></option>
50
+ <!-- <optgroup label="Style 3"> -->
51
+ <option value="3" <?= $style_desktop == 3 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-3', 'click-to-chat-for-whatsapp' ); ?></option>
52
+ <option value="3_1" <?= $style_desktop == '3_1' ? 'SELECTED' : ''; ?> >&emsp;<?php _e( 'Style-3 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
53
+ <!-- </optgroup> -->
54
+ <option value="4" <?= $style_desktop == 4 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-4', 'click-to-chat-for-whatsapp' ); ?></option>
55
+ <option value="5" <?= $style_desktop == 5 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-5', 'click-to-chat-for-whatsapp' ); ?></option>
56
+ <option value="6" <?= $style_desktop == 6 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-6', 'click-to-chat-for-whatsapp' ); ?></option>
57
+ <option value="7" <?= $style_desktop == 7 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7', 'click-to-chat-for-whatsapp' ); ?></option>
58
+ <option value="7_1" <?= $style_desktop == '7_1' ? 'SELECTED' : ''; ?> >&emsp;<?php _e( 'Style-7 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
59
+ <option value="8" <?= $style_desktop == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
60
+ <option value="99" <?= $style_desktop == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-99 (Add your own image / GIF)', 'click-to-chat-for-whatsapp' ); ?></option>
61
+ </select>
62
+ <p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/list-of-styles/?utm_source=ctc&utm_medium=admin&utm_campaign=chat"><?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="<?= admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">( Click to Chat -> Customize )</a></span> </p>
63
+ </div>
64
+ </div>
65
+
66
+
67
+ <?php
68
+ // Action hook - After select style - Desktop
69
+ do_action('ht_ctc_ah_admin_desktop_after_select_sytle', $options, $dbrow );
70
+ ?>
71
+
72
+ <!-- Desktop position -->
73
+ <!-- side - 1 -->
74
+ <p class="description ht_ctc_admin_desktop ht_ctc_subtitle"><?php _e( 'Position to Place', 'click-to-chat-for-whatsapp' ); ?> <span class="not_samesettings"><?php _e( ' (Desktop)', 'click-to-chat-for-whatsapp' ); ?></span>:</p>
75
+ <div class="row ht_ctc_admin_desktop">
76
+ <br>
77
+ <div class="input-field col s6">
78
+ <select name="<?= $dbrow; ?>[side_1]" class="select-2">
79
+ <option value="bottom" <?= $side_1 == 'bottom' ? 'SELECTED' : ''; ?> ><?php _e( 'bottom', 'click-to-chat-for-whatsapp' ); ?></option>
80
+ <option value="top" <?= $side_1 == 'top' ? 'SELECTED' : ''; ?> ><?php _e( 'top', 'click-to-chat-for-whatsapp' ); ?></option>
81
+ </select>
82
+ <label>top / bottom </label>
83
+ </div>
84
+ <div class="input-field col s6">
85
+ <input name="<?= $dbrow; ?>[side_1_value]" value="<?= $side_1_value ?>" id="side_1_value" type="text" class="input-margin">
86
+ <label for="side_1_value"><?php _e( 'E.g. 10px', 'click-to-chat-for-whatsapp' ); ?></label>
87
+ </div>
88
+ </div>
89
+
90
+ <!-- side - 2 -->
91
+ <div class="row ht_ctc_admin_desktop" style="margin-bottom:0;">
92
+ <div class="input-field col s6">
93
+ <select name="<?= $dbrow; ?>[side_2]" class="select-2">
94
+ <option value="right" <?= $side_2 == 'right' ? 'SELECTED' : ''; ?> ><?php _e( 'right', 'click-to-chat-for-whatsapp' ); ?></option>
95
+ <option value="left" <?= $side_2 == 'left' ? 'SELECTED' : ''; ?> ><?php _e( 'left', 'click-to-chat-for-whatsapp' ); ?></option>
96
+ </select>
97
+ <label><?php _e( 'right / left', 'click-to-chat-for-whatsapp' ); ?></label>
98
+ </div>
99
+
100
+ <div class="input-field col s6">
101
+ <input name="<?= $dbrow; ?>[side_2_value]" value="<?= $side_2_value ?>" id="side_2_value" type="text" class="input-margin">
102
+ <label for="side_2_value"><?php _e( 'E.g. 50%', 'click-to-chat-for-whatsapp' ); ?></label>
103
+ </div>
104
+ </div>
105
+ <p class="description ht_ctc_admin_desktop"><?php _e( 'Add css units as suffix - e.g. 10px, 50%', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/position-to-place/?utm_source=ctc&utm_medium=admin&utm_campaign=chat">more info</a> </p>
106
+
107
+
108
+
109
+ <br><br>
110
+
111
+ <?php
112
+
113
+ // Same setting for Mobile Devices
114
+ if ( isset( $options['same_settings'] ) ) {
115
+ ?>
116
+ <p style="margin-bottom: 25px;">
117
+ <label>
118
+ <input name="<?= $dbrow; ?>[same_settings]" type="checkbox" value="1" <?php checked( $options['same_settings'], 1 ); ?> class="same_settings" id="same_settings" />
119
+ <span><?php _e( 'Mobile and Desktop same setttings', 'click-to-chat-for-whatsapp' ); ?></span>
120
+ </label>
121
+ </p>
122
+ <?php
123
+ } else {
124
+ ?>
125
+ <p style="margin-bottom: 25px;">
126
+ <label>
127
+ <input name="<?= $dbrow; ?>[same_settings]" type="checkbox" value="1" class="same_settings" id="same_settings" />
128
+ <span><?php _e( 'Mobile and Desktop same setttings', 'click-to-chat-for-whatsapp' ); ?></span>
129
+ </label>
130
+ </p>
131
+ <?php
132
+ }
133
+
134
+ ?>
135
+
136
+ <blockquote class="not_samesettings " style="margin-bottom: 25px;">Mobile:</blockquote>
137
+
138
+ <!-- style -->
139
+ <p class="description ht_ctc_admin_mobile ht_ctc_subtitle not_samesettings"><?php _e( 'Select Style (Mobile)', 'click-to-chat-for-whatsapp' ); ?>:</p class="description">
140
+ <div class="row ht_ctc_admin_mobile not_samesettings">
141
+ <div class="input-field col s12 m12">
142
+ <select name="<?= $dbrow; ?>[style_mobile]" class="chat_select_style select_style_mobile">
143
+ <option value="1" <?= $style_mobile == 1 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-1', 'click-to-chat-for-whatsapp' ); ?></option>
144
+ <option value="2" <?= $style_mobile == 2 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-2', 'click-to-chat-for-whatsapp' ); ?></option>
145
+ <option value="3" <?= $style_mobile == 3 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-3', 'click-to-chat-for-whatsapp' ); ?></option>
146
+ <option value="3_1" <?= $style_mobile == '3_1' ? 'SELECTED' : ''; ?> >&emsp;<?php _e( 'Style-3 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
147
+ <option value="4" <?= $style_mobile == 4 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-4', 'click-to-chat-for-whatsapp' ); ?></option>
148
+ <option value="5" <?= $style_mobile == 5 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-5', 'click-to-chat-for-whatsapp' ); ?></option>
149
+ <option value="6" <?= $style_mobile == 6 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-6', 'click-to-chat-for-whatsapp' ); ?></option>
150
+ <option value="7" <?= $style_mobile == 7 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7', 'click-to-chat-for-whatsapp' ); ?></option>
151
+ <option value="7_1" <?= $style_mobile == '7_1' ? 'SELECTED' : ''; ?> >&emsp;<?php _e( 'Style-7 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
152
+ <option value="8" <?= $style_mobile == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
153
+ <option value="99" <?= $style_mobile == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-99 (Add your own image / GIF)', 'click-to-chat-for-whatsapp' ); ?></option>
154
+ </select>
155
+ <p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/list-of-styles/?utm_source=ctc&utm_medium=admin&utm_campaign=chat"><?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="<?= admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">( Click to Chat -> Customize )</a></span> </p>
156
+ </div>
157
+ </div>
158
+
159
+ <?php
160
+ // Action hook - After select style - Mobile
161
+ do_action('ht_ctc_ah_admin_mobile_after_select_sytle', $options, $dbrow );
162
+ ?>
163
+
164
+ <!-- Mobile position -->
165
+ <!-- side - 1 -->
166
+ <p class="description ht_ctc_admin_mobile ht_ctc_subtitle not_samesettings"><?php _e( 'Position to Place (Mobile)', 'click-to-chat-for-whatsapp' ); ?>:</p>
167
+ <div class="row ht_ctc_admin_mobile not_samesettings">
168
+ <br>
169
+ <div class="input-field col s6">
170
+ <select name="<?= $dbrow; ?>[mobile_side_1]" class="select-2">
171
+ <option value="bottom" <?= $mobile_side_1 == 'bottom' ? 'SELECTED' : ''; ?> ><?php _e( 'bottom', 'click-to-chat-for-whatsapp' ); ?></option>
172
+ <option value="top" <?= $mobile_side_1 == 'top' ? 'SELECTED' : ''; ?> ><?php _e( 'top', 'click-to-chat-for-whatsapp' ); ?></option>
173
+ </select>
174
+ <label>top / bottom </label>
175
+ </div>
176
+ <div class="input-field col s6">
177
+ <input name="<?= $dbrow; ?>[mobile_side_1_value]" value="<?= $mobile_side_1_value ?>" id="mobile_side_1_value" type="text" class="input-margin">
178
+ <label for="mobile_side_1_value"><?php _e( 'E.g. 10px', 'click-to-chat-for-whatsapp' ); ?></label>
179
+ </div>
180
+ </div>
181
+
182
+ <!-- side - 2 -->
183
+ <div class="row ht_ctc_admin_mobile not_samesettings" style="margin-bottom:0;">
184
+ <div class="input-field col s6">
185
+ <select name="<?= $dbrow; ?>[mobile_side_2]" class="select-2">
186
+ <option value="right" <?= $mobile_side_2 == 'right' ? 'SELECTED' : ''; ?> ><?php _e( 'right', 'click-to-chat-for-whatsapp' ); ?></option>
187
+ <option value="left" <?= $mobile_side_2 == 'left' ? 'SELECTED' : ''; ?> ><?php _e( 'left', 'click-to-chat-for-whatsapp' ); ?></option>
188
+ </select>
189
+ <label><?php _e( 'right / left', 'click-to-chat-for-whatsapp' ); ?></label>
190
+ </div>
191
+
192
+ <div class="input-field col s6">
193
+ <input name="<?= $dbrow; ?>[mobile_side_2_value]" value="<?= $mobile_side_2_value ?>" id="mobile_side_2_value" type="text" class="input-margin">
194
+ <label for="mobile_side_2_value"><?php _e( 'E.g. 50%', 'click-to-chat-for-whatsapp' ); ?></label>
195
+ </div>
196
+ </div>
197
+ <p class="description ht_ctc_admin_mobile not_samesettings"><?php _e( 'Add css units as suffix - e.g. 10px, 50%', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/position-to-place/?utm_source=ctc&utm_medium=admin&utm_campaign=chat"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
198
+
199
+
200
+
201
+ <br class="not_samesettings">
202
+ <hr class="not_samesettings" style="max-width: 500px;">
203
+ <br class="not_samesettings">
204
+ <p class="description"><span class="not_samesettings" style="font-size: 0.7em;">If Styles for desktop, mobile not selected as expected <a target="_blank" href="<?= 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/?utm_source=ctc&utm_medium=admin&utm_campaign=chat">more info</a></span></p>
205
+
206
+ </div>
207
+ </div>
208
+ </li>
209
+ <ul>
new/admin/admin_commons/admin-mobile.php DELETED
@@ -1,148 +0,0 @@
1
- <?php
2
- /**
3
- * Admin Mobile
4
- *
5
- * @package ctc
6
- * @subpackage Administration
7
- * @since 2.11
8
- */
9
-
10
- if ( ! defined( 'ABSPATH' ) ) exit;
11
-
12
- // style
13
- $style_mobile = ( isset( $options['style_mobile']) ) ? esc_attr( $options['style_mobile'] ) : '';
14
-
15
- // position
16
- $mobile_side_1 = ( isset( $options['mobile_side_1']) ) ? esc_attr( $options['mobile_side_1'] ) : '';
17
- $mobile_side_1_value = ( isset( $options['mobile_side_1_value'])) ? esc_attr( $options['mobile_side_1_value'] ) : '';
18
- $mobile_side_2 = ( isset( $options['mobile_side_2']) ) ? esc_attr( $options['mobile_side_2'] ) : '';
19
- $mobile_side_2_value = ( isset( $options['mobile_side_2_value'])) ? esc_attr( $options['mobile_side_2_value'] ) : '';
20
-
21
- ?>
22
-
23
- <ul class="collapsible">
24
- <li class="active">
25
- <div class="collapsible-header"><?php _e( 'Mobile', 'click-to-chat-for-whatsapp' ); ?></div>
26
- <div class="collapsible-body">
27
-
28
- <?php
29
-
30
- // Same setting for Mobile Devices
31
- if ( isset( $options['same_settings'] ) ) {
32
- ?>
33
- <!-- <p>
34
- <label>
35
- <input name="<?= $dbrow; ?>[same_settings]" type="checkbox" value="1" <?php checked( $options['same_settings'], 1 ); ?> class="same_settings" id="same_settings" />
36
- <span><?php _e( 'Desktop and Mobile same setttings', 'click-to-chat-for-whatsapp' ); ?></span>
37
- </label>
38
- </p> -->
39
- <?php
40
- } else {
41
- ?>
42
- <!-- <p>
43
- <label>
44
- <input name="<?= $dbrow; ?>[same_settings]" type="checkbox" value="1" class="same_settings" id="same_settings" />
45
- <span><?php _e( 'Desktop and Mobile same setttings', 'click-to-chat-for-whatsapp' ); ?></span>
46
- </label>
47
- </p> -->
48
- <?php
49
- }
50
-
51
- ?>
52
- <!-- <br><br> -->
53
-
54
- <!-- style -->
55
- <p class="description ht_ctc_admin_mobile ht_ctc_subtitle"><?php _e( 'Select Style (Mobile)', 'click-to-chat-for-whatsapp' ); ?>:</p class="description">
56
- <div class="row ht_ctc_admin_mobile">
57
- <div class="input-field col s12 m12">
58
- <select name="<?= $dbrow; ?>[style_mobile]" class="chat_select_style select_style_mobile">
59
- <option value="1" <?= $style_mobile == 1 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-1', 'click-to-chat-for-whatsapp' ); ?></option>
60
- <option value="2" <?= $style_mobile == 2 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-2', 'click-to-chat-for-whatsapp' ); ?></option>
61
- <option value="3" <?= $style_mobile == 3 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-3', 'click-to-chat-for-whatsapp' ); ?></option>
62
- <option value="3_1" <?= $style_mobile == '3_1' ? 'SELECTED' : ''; ?> >&emsp;<?php _e( 'Style-3 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
63
- <option value="4" <?= $style_mobile == 4 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-4', 'click-to-chat-for-whatsapp' ); ?></option>
64
- <option value="5" <?= $style_mobile == 5 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-5', 'click-to-chat-for-whatsapp' ); ?></option>
65
- <option value="6" <?= $style_mobile == 6 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-6', 'click-to-chat-for-whatsapp' ); ?></option>
66
- <option value="7" <?= $style_mobile == 7 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7', 'click-to-chat-for-whatsapp' ); ?></option>
67
- <option value="7_1" <?= $style_mobile == '7_1' ? 'SELECTED' : ''; ?> >&emsp;<?php _e( 'Style-7 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
68
- <option value="8" <?= $style_mobile == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
69
- <option value="99" <?= $style_mobile == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-99 (Add your own image / GIF)', 'click-to-chat-for-whatsapp' ); ?></option>
70
- </select>
71
- <p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/list-of-styles/?utm_source=ctc&utm_medium=admin&utm_campaign=chat"><?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="<?= admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">( Click to Chat -> Customize )</a></span> </p>
72
- <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="<?= 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/?utm_source=ctc&utm_medium=admin&utm_campaign=chat">more info</a></span></p>
73
- </div>
74
- </div>
75
-
76
- <?php
77
- // Action hook - After select style - Mobile
78
- do_action('ht_ctc_ah_admin_mobile_after_select_sytle', $options, $dbrow );
79
- ?>
80
-
81
- <!-- Mobile position -->
82
- <!-- side - 1 -->
83
- <p class="description ht_ctc_admin_mobile ht_ctc_subtitle"><?php _e( 'Position to Place (Mobile)', 'click-to-chat-for-whatsapp' ); ?>:</p>
84
- <div class="row ht_ctc_admin_mobile">
85
- <br>
86
- <div class="input-field col s6">
87
- <select name="<?= $dbrow; ?>[mobile_side_1]" class="select-2">
88
- <option value="bottom" <?= $mobile_side_1 == 'bottom' ? 'SELECTED' : ''; ?> ><?php _e( 'bottom', 'click-to-chat-for-whatsapp' ); ?></option>
89
- <option value="top" <?= $mobile_side_1 == 'top' ? 'SELECTED' : ''; ?> ><?php _e( 'top', 'click-to-chat-for-whatsapp' ); ?></option>
90
- </select>
91
- <label>top / bottom </label>
92
- </div>
93
- <div class="input-field col s6">
94
- <input name="<?= $dbrow; ?>[mobile_side_1_value]" value="<?= $mobile_side_1_value ?>" id="mobile_side_1_value" type="text" class="input-margin">
95
- <label for="mobile_side_1_value"><?php _e( 'E.g. 10px', 'click-to-chat-for-whatsapp' ); ?></label>
96
- </div>
97
- </div>
98
-
99
- <!-- side - 2 -->
100
- <div class="row ht_ctc_admin_mobile" style="margin-bottom:0;">
101
- <div class="input-field col s6">
102
- <select name="<?= $dbrow; ?>[mobile_side_2]" class="select-2">
103
- <option value="right" <?= $mobile_side_2 == 'right' ? 'SELECTED' : ''; ?> ><?php _e( 'right', 'click-to-chat-for-whatsapp' ); ?></option>
104
- <option value="left" <?= $mobile_side_2 == 'left' ? 'SELECTED' : ''; ?> ><?php _e( 'left', 'click-to-chat-for-whatsapp' ); ?></option>
105
- </select>
106
- <label><?php _e( 'right / left', 'click-to-chat-for-whatsapp' ); ?></label>
107
- </div>
108
-
109
- <div class="input-field col s6">
110
- <input name="<?= $dbrow; ?>[mobile_side_2_value]" value="<?= $mobile_side_2_value ?>" id="mobile_side_2_value" type="text" class="input-margin">
111
- <label for="mobile_side_2_value"><?php _e( 'E.g. 50%', 'click-to-chat-for-whatsapp' ); ?></label>
112
- </div>
113
- </div>
114
- <p class="description ht_ctc_admin_mobile"><?php _e( 'Add css units as suffix - e.g. 10px, 50%', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/position-to-place/?utm_source=ctc&utm_medium=admin&utm_campaign=chat"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
115
-
116
- <br class="ht_ctc_admin_mobile">
117
- <hr class="ht_ctc_admin_mobile" style="max-width: 500px;">
118
- <br class="ht_ctc_admin_mobile">
119
-
120
- <?php
121
-
122
- // Hide on Mobile Devices
123
- if ( isset( $options['hideon_mobile'] ) ) {
124
- ?>
125
- <p>
126
- <label>
127
- <input name="<?= $dbrow; ?>[hideon_mobile]" type="checkbox" value="1" <?php checked( $options['hideon_mobile'], 1 ); ?> class="hidebasedondevice" id="hideon_mobile" />
128
- <span><?php _e( 'Hide on - Mobile Devices', 'click-to-chat-for-whatsapp' ); ?></span>
129
- </label>
130
- </p>
131
- <?php
132
- } else {
133
- ?>
134
- <p>
135
- <label>
136
- <input name="<?= $dbrow; ?>[hideon_mobile]" type="checkbox" value="1" class="hidebasedondevice" id="hideon_mobile" />
137
- <span><?php _e( 'Hide on - Mobile Devices', 'click-to-chat-for-whatsapp' ); ?></span>
138
- </label>
139
- </p>
140
- <?php
141
- }
142
-
143
- ?>
144
-
145
- </div>
146
- </div>
147
- </li>
148
- <ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
new/admin/admin_commons/admin-show-hide.php CHANGED
@@ -4,432 +4,239 @@
4
  *
5
  * @package ctc
6
  * @subpackage Administration
7
- * @since 2.8
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit;
11
 
12
- $show_or_hide = ( isset( $options['show_or_hide']) ) ? esc_attr( $options['show_or_hide'] ) : '';
13
-
14
- $list_hideon_pages = ( isset( $options['list_hideon_pages']) ) ? esc_attr( $options['list_hideon_pages'] ) : '';
15
- $list_hideon_cat = ( isset( $options['list_hideon_cat']) ) ? esc_attr( $options['list_hideon_cat'] ) : '';
16
- $list_showon_pages = ( isset( $options['list_showon_pages']) ) ? esc_attr( $options['list_showon_pages'] ) : '';
17
- $list_showon_cat = ( isset( $options['list_showon_cat']) ) ? esc_attr( $options['list_showon_cat'] ) : '';
18
-
19
 
20
  ?>
21
 
22
  <ul class="collapsible">
23
  <li class="active">
24
- <div class="collapsible-header" id="showhide_settings"><?php _e( 'Show/Hide on Selected pages', 'click-to-chat-for-whatsapp' ); ?></div>
25
  <div class="collapsible-body">
26
 
27
  <?php
28
 
 
29
  if ( 'chat' == $type ) {
30
  do_action('ht_ctc_ah_admin_chat_before_showhide');
31
  }
32
  do_action('ht_ctc_ah_admin_before_showhide');
33
- ?>
34
 
35
- <span class="description"><b><?php _e( 'Select Show/Hide', 'click-to-chat-for-whatsapp' ); ?>:</b></span>
36
-
37
- <div class="row" style="margin-bottom: 0px;">
38
- <div class="input-field col s8">
39
- <select name="<?= $dbrow; ?>[show_or_hide]" class="select_show_or_hide">
40
- <option value="hide" <?= $show_or_hide == "hide" ? 'SELECTED' : ''; ?> ><?php _e( 'Hide on selected pages', 'click-to-chat-for-whatsapp' ); ?></option>
41
- <option value="show" <?= $show_or_hide == "show" ? 'SELECTED' : ''; ?> ><?php _e( 'Show only on selected pages', 'click-to-chat-for-whatsapp' ); ?></option>
42
- </select>
43
- <p class="description ctc_show_hide_display show-hide_display-none hidebased"><span style="background-color: #ddd; padding: 0 5px; border-radius: 5px; color: green; "><?php _e( 'Default shows on all pages', 'click-to-chat-for-whatsapp' ); ?> </span></p>
44
- <p class="description ctc_show_hide_display show-hide_display-none showbased"><span style="color: red; "><?php _e( 'Default Hides on all pages', 'click-to-chat-for-whatsapp' ); ?> </span></p>
45
- <!-- <label><?php _e( 'enable' , 'click-to-chat-for-whatsapp' ) ?></label> -->
46
- </div>
47
- </div>
 
 
 
 
 
 
48
 
 
 
49
 
 
 
 
50
 
51
- <!-- ######### Hide ######### -->
 
 
 
 
 
 
52
 
 
 
53
 
 
 
54
 
55
- <p class="description ctc_show_hide_display show-hide_display-none hidebased" style="margin-bottom: 15px;">
56
- <strong style=""><?php _e( 'Select pages to Hide styles', 'click-to-chat-for-whatsapp' ); ?></strong>
57
- </p>
58
- <!-- <br><br> -->
59
- <?php
 
60
 
61
- // checkboxes - Hide based on Type of posts
 
 
62
 
63
- // Single Posts
64
- if ( isset( $options['hideon_posts'] ) ) {
65
- ?>
66
- <p class="ctc_show_hide_display show-hide_display-none hidebased">
67
- <label>
68
- <input name="<?= $dbrow; ?>[hideon_posts]" type="checkbox" value="1" <?php checked( $options['hideon_posts'], 1 ); ?> id="filled-in-box1" />
69
- <span><?php _e( 'Hide on - Posts', 'click-to-chat-for-whatsapp' ); ?></span>
70
- </label>
71
- </p>
72
- <?php
73
- } else {
74
- ?>
75
- <p class="ctc_show_hide_display show-hide_display-none hidebased">
76
- <label>
77
- <input name="<?= $dbrow; ?>[hideon_posts]" type="checkbox" value="1" id="filled-in-box1" />
78
- <span><?php _e( 'Hide on - Posts', 'click-to-chat-for-whatsapp' ); ?></span>
79
- </label>
80
- </p>
81
- <?php
82
- }
83
 
84
 
85
- // Page
86
- if ( isset( $options['hideon_page'] ) ) {
87
- ?>
88
- <p class="ctc_show_hide_display show-hide_display-none hidebased">
 
 
89
  <label>
90
- <input name="<?= $dbrow; ?>[hideon_page]" type="checkbox" value="1" <?php checked( $options['hideon_page'], 1 ); ?> id="filled-in-box2" />
91
- <span><?php _e( 'Hide on - Pages', 'click-to-chat-for-whatsapp' ); ?></span>
 
92
  </label>
93
  </p>
94
- <?php
95
- } else {
96
- ?>
97
- <p class="ctc_show_hide_display show-hide_display-none hidebased">
98
  <label>
99
- <input name="<?= $dbrow; ?>[hideon_page]" type="checkbox" value="1" id="filled-in-box2" />
100
- <span><?php _e( 'Hide on - Pages', 'click-to-chat-for-whatsapp' ); ?></span>
 
101
  </label>
102
  </p>
103
- <?php
104
- }
105
-
106
-
107
-
108
 
109
- // Home Page
110
- // is_home and is_front_page - combined. calling as home/front page
111
- if ( isset( $options['hideon_homepage'] ) ) {
112
- ?>
113
- <p class="ctc_show_hide_display show-hide_display-none hidebased">
 
 
114
  <label>
115
- <input name="<?= $dbrow; ?>[hideon_homepage]" type="checkbox" value="1" <?php checked( $options['hideon_homepage'], 1 ); ?> id="filled-in-box3" />
116
- <span><?php _e( 'Hide on - Home/Front Page', 'click-to-chat-for-whatsapp' ); ?></span>
 
117
  </label>
118
  </p>
119
- <?php
120
- } else {
121
- ?>
122
- <p class="ctc_show_hide_display show-hide_display-none hidebased">
123
  <label>
124
- <input name="<?= $dbrow; ?>[hideon_homepage]" type="checkbox" value="1" id="filled-in-box3" />
125
- <span><?php _e( 'Hide on - Home/Front Page', 'click-to-chat-for-whatsapp' ); ?></span>
 
126
  </label>
127
  </p>
128
- <?php
129
- }
130
 
 
 
 
131
 
132
- // Category
133
- if ( isset( $options['hideon_category'] ) ) {
134
- ?>
135
- <p class="ctc_show_hide_display show-hide_display-none hidebased">
136
- <label>
137
- <input name="<?= $dbrow; ?>[hideon_category]" type="checkbox" value="1" <?php checked( $options['hideon_category'], 1 ); ?> id="filled-in-box5" />
138
- <span><?php _e( 'Hide on - Category', 'click-to-chat-for-whatsapp' ); ?></span>
139
- </label>
140
  </p>
141
- <?php
142
- } else {
143
- ?>
144
- <p class="ctc_show_hide_display show-hide_display-none hidebased">
145
  <label>
146
- <input name="<?= $dbrow; ?>[hideon_category]" type="checkbox" value="1" id="filled-in-box5" />
147
- <span><?php _e( 'Hide on - Category', 'click-to-chat-for-whatsapp' ); ?></span>
 
148
  </label>
149
  </p>
150
- <?php
151
- }
152
-
153
-
154
-
155
- // Archive
156
- if ( isset( $options['hideon_archive'] ) ) {
157
- ?>
158
- <p class="ctc_show_hide_display show-hide_display-none hidebased">
159
  <label>
160
- <input name="<?= $dbrow; ?>[hideon_archive]" type="checkbox" value="1" <?php checked( $options['hideon_archive'], 1 ); ?> id="filled-in-box6" />
161
- <span><?php _e( 'Hide on - Archive', 'click-to-chat-for-whatsapp' ); ?></span>
 
162
  </label>
163
  </p>
164
- <?php
165
- } else {
166
- ?>
167
- <p class="ctc_show_hide_display show-hide_display-none hidebased">
168
- <label>
169
- <input name="<?= $dbrow; ?>[hideon_archive]" type="checkbox" value="1" id="filled-in-box6" />
170
- <span><?php _e( 'Hide on - Archive', 'click-to-chat-for-whatsapp' ); ?></span>
171
- </label>
172
- </p>
173
- <?php
174
- }
175
 
 
176
 
177
- // 404 Page
178
- if ( isset( $options['hideon_404'] ) ) {
179
- ?>
180
- <p class="ctc_show_hide_display show-hide_display-none hidebased">
181
- <label>
182
- <input name="<?= $dbrow; ?>[hideon_404]" type="checkbox" value="1" <?php checked( $options['hideon_404'], 1 ); ?> id="hideon_404" />
183
- <span><?php _e( 'Hide on - 404 Page', 'click-to-chat-for-whatsapp' ); ?></span>
184
- </label>
185
- </p>
186
- <?php
187
- } else {
188
- ?>
189
- <p class="ctc_show_hide_display show-hide_display-none hidebased">
190
- <label>
191
- <input name="<?= $dbrow; ?>[hideon_404]" type="checkbox" value="1" id="hideon_404" />
192
- <span><?php _e( 'Hide on - 404 Page', 'click-to-chat-for-whatsapp' ); ?></span>
193
- </label>
194
- </p>
195
- <?php
196
- }
197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
 
199
- // WooCommerce single product pages
200
- if ( isset( $options['hideon_wooproduct'] ) ) {
201
- ?>
202
- <p class="ctc_show_hide_display show-hide_display-none hidebased">
203
- <label>
204
- <input name="<?= $dbrow; ?>[hideon_wooproduct]" type="checkbox" value="1" <?php checked( $options['hideon_wooproduct'], 1 ); ?> id="hideon_wooproduct" />
205
- <span><?php _e( 'Hide on - WooCommerce single product pages', 'click-to-chat-for-whatsapp' ); ?></span>
206
- </label>
207
- </p>
208
- <?php
209
- } else {
210
- ?>
211
- <p class="ctc_show_hide_display show-hide_display-none hidebased">
212
- <label>
213
- <input name="<?= $dbrow; ?>[hideon_wooproduct]" type="checkbox" value="1" id="hideon_wooproduct" />
214
- <span><?php _e( 'Hide on - WooCommerce single product pages', 'click-to-chat-for-whatsapp' ); ?></span>
215
- </label>
216
- </p>
217
- <?php
218
  }
219
 
220
 
221
  ?>
222
- <p class="description ctc_show_hide_display show-hide_display-none hidebased"><?php _e( 'Check to hide Styles based on the type of pages', 'click-to-chat-for-whatsapp' ); ?></p>
223
- <br class="ctc_show_hide_display show-hide_display-none hidebased">
224
-
225
  <!-- ID's list to hide styles -->
226
- <div class="row ctc_show_hide_display show-hide_display-none hidebased">
227
  <div class="input-field col s7">
228
- <input name="<?= $dbrow; ?>[list_hideon_pages]" value="<?= $list_hideon_pages ?>" id="ccw_list_id_tohide" type="text" class="input-margin">
229
- <label for="ccw_list_id_tohide"><?php _e( "Add Post ID's to Hide Styles", 'click-to-chat-for-whatsapp' ); ?></label>
230
  <p class="description"><?php _e( "Add post id's to hide. Add multiple post id's by separating with a comma ( , )", 'click-to-chat-for-whatsapp' ); ?></p>
231
  </div>
232
  </div>
233
 
234
- <!-- Categorys list - to hide -->
235
- <div class="row ctc_show_hide_display show-hide_display-none hidebased">
236
  <div class="input-field col s7">
237
- <input name="<?= $dbrow; ?>[list_hideon_cat]" value="<?= $list_hideon_cat ?>" id="list_hideon_cat" type="text" class="input-margin">
238
- <label for="list_hideon_cat"><?php _e( 'Add Category names to Hide Styles' , 'click-to-chat-for-whatsapp' ) ?> </label>
239
- <p class="description"><?php _e( 'Hides on this Category type pages, Add multiple Categories by separating with a comma ( , ) ', 'click-to-chat-for-whatsapp' ); ?></p>
240
  </div>
241
  </div>
242
 
243
-
244
-
245
- <!-- ######### Show ######### -->
246
-
247
-
248
-
249
- <p class="description ctc_show_hide_display show-hide_display-none showbased" style="margin-bottom: 15px">
250
- <strong><?php _e( 'Select pages to display styles', 'click-to-chat-for-whatsapp' ); ?></strong>
251
- </p>
252
- <?php
253
-
254
- // checkboxes - Show based on Type of posts
255
-
256
- // Single Posts
257
- if ( isset( $options['showon_posts'] ) ) {
258
- ?>
259
- <p class="ctc_show_hide_display show-hide_display-none showbased">
260
- <label>
261
- <input name="<?= $dbrow; ?>[showon_posts]" type="checkbox" value="1" <?php checked( $options['showon_posts'], 1 ); ?> id="show_filled-in-box1" />
262
- <span>Show on - Posts</span>
263
- </label>
264
- </p>
265
- <?php
266
- } else {
267
- ?>
268
- <p class="ctc_show_hide_display show-hide_display-none showbased">
269
- <label>
270
- <input name="<?= $dbrow; ?>[showon_posts]" type="checkbox" value="1" id="show_filled-in-box1" />
271
- <span>Show on - Posts</span>
272
- </label>
273
- </p>
274
- <?php
275
- }
276
-
277
-
278
- // Page
279
- if ( isset( $options['showon_page'] ) ) {
280
- ?>
281
- <p class="ctc_show_hide_display show-hide_display-none showbased">
282
- <label>
283
- <input name="<?= $dbrow; ?>[showon_page]" type="checkbox" value="1" <?php checked( $options['showon_page'], 1 ); ?> id="show_filled-in-box2" />
284
- <span>Show on - Pages</span>
285
- </label>
286
- </p>
287
- <?php
288
- } else {
289
- ?>
290
- <p class="ctc_show_hide_display show-hide_display-none showbased">
291
- <label>
292
- <input name="<?= $dbrow; ?>[showon_page]" type="checkbox" value="1" id="show_filled-in-box2" />
293
- <span>Show on - Pages</span>
294
- </label>
295
- </p>
296
- <?php
297
- }
298
-
299
-
300
- // Home Page
301
- // is_home and is_front_page - combined. calling as home/front page
302
- if ( isset( $options['showon_homepage'] ) ) {
303
- ?>
304
- <p class="ctc_show_hide_display show-hide_display-none showbased">
305
- <label>
306
- <input name="<?= $dbrow; ?>[showon_homepage]" type="checkbox" value="1" <?php checked( $options['showon_homepage'], 1 ); ?> id="show_filled-in-box3" />
307
- <span>Show on - Home/Front Page</span>
308
- </label>
309
- </p>
310
- <?php
311
- } else {
312
- ?>
313
- <p class="ctc_show_hide_display show-hide_display-none showbased">
314
- <label>
315
- <input name="<?= $dbrow; ?>[showon_homepage]" type="checkbox" value="1" id="show_filled-in-box3" />
316
- <span>Show on - Home/Front Page</span>
317
- </label>
318
- </p>
319
- <?php
320
- }
321
-
322
-
323
- // Category
324
- if ( isset( $options['showon_category'] ) ) {
325
- ?>
326
- <p class="ctc_show_hide_display show-hide_display-none showbased">
327
- <label>
328
- <input name="<?= $dbrow; ?>[showon_category]" type="checkbox" value="1" <?php checked( $options['showon_category'], 1 ); ?> id="show_filled-in-box5" />
329
- <span>Show on - Category</span>
330
- </label>
331
- </p>
332
- <?php
333
- } else {
334
- ?>
335
- <p class="ctc_show_hide_display show-hide_display-none showbased">
336
- <label>
337
- <input name="<?= $dbrow; ?>[showon_category]" type="checkbox" value="1" id="show_filled-in-box5" />
338
- <span>Show on - Category</span>
339
- </label>
340
- </p>
341
- <?php
342
- }
343
-
344
- // Archive
345
- if ( isset( $options['showon_archive'] ) ) {
346
- ?>
347
- <p class="ctc_show_hide_display show-hide_display-none showbased">
348
- <label>
349
- <input name="<?= $dbrow; ?>[showon_archive]" type="checkbox" value="1" <?php checked( $options['showon_archive'], 1 ); ?> id="show_filled-in-box6" />
350
- <span>Show on - Archive</span>
351
- </label>
352
- </p>
353
- <?php
354
- } else {
355
- ?>
356
- <p class="ctc_show_hide_display show-hide_display-none showbased">
357
- <label>
358
- <input name="<?= $dbrow; ?>[showon_archive]" type="checkbox" value="1" id="show_filled-in-box6" />
359
- <span>Show on - Archive</span>
360
- </label>
361
- </p>
362
- <?php
363
- }
364
-
365
-
366
- // 404 Page
367
- if ( isset( $options['showon_404'] ) ) {
368
- ?>
369
- <p class="ctc_show_hide_display show-hide_display-none showbased">
370
- <label>
371
- <input name="<?= $dbrow; ?>[showon_404]" type="checkbox" value="1" <?php checked( $options['showon_404'], 1 ); ?> id="showon_404" />
372
- <span>Show on - 404 Page</span>
373
- </label>
374
- </p>
375
- <?php
376
- } else {
377
- ?>
378
- <p class="ctc_show_hide_display show-hide_display-none showbased">
379
- <label>
380
- <input name="<?= $dbrow; ?>[showon_404]" type="checkbox" value="1" id="showon_404" />
381
- <span>Show on - 404 Page</span>
382
- </label>
383
- </p>
384
- <?php
385
- }
386
-
387
-
388
- // WooCommerce single product pages
389
- if ( isset( $options['showon_wooproduct'] ) ) {
390
- ?>
391
- <p class="ctc_show_hide_display show-hide_display-none showbased">
392
- <label>
393
- <input name="<?= $dbrow; ?>[showon_wooproduct]" type="checkbox" value="1" <?php checked( $options['showon_wooproduct'], 1 ); ?> id="showon_wooproduct" />
394
- <span>Show on - WooCommerce Single product pages</span>
395
- </label>
396
- </p>
397
- <?php
398
- } else {
399
- ?>
400
- <p class="ctc_show_hide_display show-hide_display-none showbased">
401
- <label>
402
- <input name="<?= $dbrow; ?>[showon_wooproduct]" type="checkbox" value="1" id="showon_wooproduct" />
403
- <span>Show on - WooCommerce Single product pages</span>
404
- </label>
405
- </p>
406
- <?php
407
- }
408
-
409
-
410
- ?>
411
- <p class="description ctc_show_hide_display show-hide_display-none showbased">Check to display Styles based on type of the page</p>
412
- <br class="ctc_show_hide_display show-hide_display-none showbased">
413
-
414
- <!-- ID's list to show styles -->
415
- <div class="row ctc_show_hide_display show-hide_display-none showbased">
416
  <div class="input-field col s7">
417
- <input name="<?= $dbrow; ?>[list_showon_pages]" value="<?= $list_showon_pages ?>" id="ccw_list_id_toshow" type="text" class="input-margin">
418
- <label for="ccw_list_id_toshow"><?php _e( "Add Post ID's to show Styles", 'click-to-chat-for-whatsapp' ); ?></label>
419
- <p class="description"><?php _e( "Add Post, Page, Media - ID's to show styles, Add multiple id's by separating with a comma ( , )", 'click-to-chat-for-whatsapp' ); ?></p>
420
  </div>
421
  </div>
422
 
423
-
424
  <!-- Categorys list - to show -->
425
- <div class="row ctc_show_hide_display show-hide_display-none showbased">
426
  <div class="input-field col s7">
427
- <input name="<?= $dbrow; ?>[list_showon_cat]" value="<?= $list_showon_cat ?>" id="ccw_list_cat_toshow" type="text" class="input-margin">
428
- <label for="ccw_list_cat_toshow"><?php _e( 'Add Category names to Show Styles' , 'click-to-chat-for-whatsapp' ) ?> </label>
429
  <p class="description"><?php _e( 'Show on this Category type pages, Add multiple Categories by separating with a comma ( , )', 'click-to-chat-for-whatsapp' ); ?> </p>
430
  </div>
431
  </div>
432
 
 
433
  <?php
434
  if ( 'chat' == $type ) {
435
  do_action('ht_ctc_ah_admin_chat_after_showhide');
4
  *
5
  * @package ctc
6
  * @subpackage Administration
7
+ * @since 2.8 updated 3.3.3
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit;
11
 
12
+ // $dbrow = 'ht_ctc_chat_options';
 
 
 
 
 
 
13
 
14
  ?>
15
 
16
  <ul class="collapsible">
17
  <li class="active">
18
+ <div class="collapsible-header" id="showhide_settings"><?php _e( 'Display Settings', 'click-to-chat-for-whatsapp' ); ?></div>
19
  <div class="collapsible-body">
20
 
21
  <?php
22
 
23
+
24
  if ( 'chat' == $type ) {
25
  do_action('ht_ctc_ah_admin_chat_before_showhide');
26
  }
27
  do_action('ht_ctc_ah_admin_before_showhide');
 
28
 
29
+ $show_hide_settings = array(
30
+ // 'Home Page' => '',
31
+ 'home' => 'Home Page',
32
+ // 'Build in Post Types' => '',
33
+ 'posts' => 'Posts',
34
+ 'pages' => 'Pages',
35
+ // 'Multiple/Loop Posts' => '',
36
+ 'archive' => 'Archive pages',
37
+ 'category' => 'Category pages',
38
+ // '404 Page' => '',
39
+ 'page_404' => '404 Page',
40
+ // 'Post Types' => '',
41
+ );
42
+
43
+ // woo single product page
44
+ if ( class_exists( 'WooCommerce' ) ) {
45
+ $show_hide_settings['WooCommerce'] = '';
46
+ $show_hide_settings['woo_product'] = 'Single Product pages';
47
+ }
48
 
49
+ // custom post types
50
+ $custom_post_types = get_post_types( array('public' => true, '_builtin' => false) );
51
 
52
+ // woocommerce product working in different way..
53
+ // unset may not be the perfect in all times.
54
+ unset($custom_post_types['product']);
55
 
56
+ // not empty array - custom post types
57
+ if (!empty($custom_post_types)) {
58
+ // title custom post type
59
+ $show_hide_settings['Custom Post Types'] = '';
60
+ // merge
61
+ $show_hide_settings = array_merge($show_hide_settings, $custom_post_types);
62
+ }
63
 
64
+ // display settings - options - sub array
65
+ $display_settings = (isset($options['display'])) ? $options['display'] : '';
66
 
67
+ // n_show_hide
68
+ $check_global_display = (isset($display_settings['global_display'])) ? esc_html($display_settings['global_display']) : 'show';
69
 
70
+ // post id
71
+ $list_hideon_pages = (isset($display_settings['list_hideon_pages'])) ? esc_html($display_settings['list_hideon_pages']) : '';
72
+ $list_showon_pages = (isset($display_settings['list_showon_pages'])) ? esc_html($display_settings['list_showon_pages']) : '';
73
+ // category
74
+ $list_hideon_cat = (isset($display_settings['list_hideon_cat'])) ? esc_html($display_settings['list_hideon_cat']) : '';
75
+ $list_showon_cat = (isset($display_settings['list_showon_cat'])) ? esc_html($display_settings['list_showon_cat']) : '';
76
 
77
+ $display_desktop = (isset( $options['display_desktop'])) ? esc_attr( $options['display_desktop'] ) : 'show';
78
+ $display_mobile = (isset($options['display_mobile'])) ? esc_attr( $options['display_mobile'] ) : 'show';
79
+ ?>
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
 
82
 
83
+ <div class="row">
84
+ <p class="col s3">
85
+ <span class="dashicons dashicons-desktop"></span>
86
+ <?php _e( 'Desktop', 'click-to-chat-for-whatsapp' ); ?>
87
+ </p>
88
+ <p class="col s4">
89
  <label>
90
+ <input name="<?= $dbrow; ?>[display_desktop]" value="show" type="radio" <?php checked( 'show' == $display_desktop ); ?> class="with-gap device_display radio_desktop"/>
91
+ <span><?php _e( 'Show', 'click-to-chat-for-whatsapp' ); ?></span>
92
+ <span class="dashicons dashicons-visibility"></span>
93
  </label>
94
  </p>
95
+ <p class="col s4">
 
 
 
96
  <label>
97
+ <input name="<?= $dbrow; ?>[display_desktop]" value="hide" type="radio" <?php checked( 'hide' == $display_desktop ); ?> class="with-gap device_display radio_desktop"/>
98
+ <span><?php _e( 'Hide', 'click-to-chat-for-whatsapp' ); ?></span>
99
+ <span class="dashicons dashicons-hidden"></span>
100
  </label>
101
  </p>
102
+ </div>
 
 
 
 
103
 
104
+ <!-- display mobile -->
105
+ <div class="row">
106
+ <p class="col s3">
107
+ <span class="dashicons dashicons-smartphone"></span>
108
+ <?php _e( 'Mobile', 'click-to-chat-for-whatsapp' ); ?>
109
+ </p>
110
+ <p class="col s4">
111
  <label>
112
+ <input name="<?= $dbrow; ?>[display_mobile]" value="show" type="radio" <?php checked( 'show' == $display_mobile ); ?> class="with-gap device_display radio_mobile"/>
113
+ <span><?php _e( 'Show', 'click-to-chat-for-whatsapp' ); ?></span>
114
+ <span class="dashicons dashicons-visibility"></span>
115
  </label>
116
  </p>
117
+ <p class="col s4">
 
 
 
118
  <label>
119
+ <input name="<?= $dbrow; ?>[display_mobile]" value="hide" type="radio" <?php checked( 'hide' == $display_mobile ); ?> class="with-gap device_display radio_mobile"/>
120
+ <span><?php _e( 'Hide', 'click-to-chat-for-whatsapp' ); ?></span>
121
+ <span class="dashicons dashicons-hidden"></span>
122
  </label>
123
  </p>
124
+ </div>
 
125
 
126
+ <br>
127
+ <hr style="max-width: 500px;">
128
+ <br>
129
 
130
+ <div class="row">
131
+ <p class="col s3">
132
+ <!-- <span class="dashicons dashicons-admin-site-alt3"></span> -->
133
+ <strong><?php _e( 'Global', 'click-to-chat-for-whatsapp' ); ?></strong>
 
 
 
 
134
  </p>
135
+ <p class="col s4">
 
 
 
136
  <label>
137
+ <input name="<?= $dbrow; ?>[display][global_display]" value="show" type="radio" <?php checked( 'show' == $check_global_display ); ?> class="with-gap global_display"/>
138
+ <span><?php _e( 'Show on all pages', 'click-to-chat-for-whatsapp' ); ?></span>
139
+ <span class="dashicons dashicons-visibility"></span>
140
  </label>
141
  </p>
142
+ <p class="col s4">
 
 
 
 
 
 
 
 
143
  <label>
144
+ <input name="<?= $dbrow; ?>[display][global_display]" value="hide" type="radio" <?php checked( 'hide' == $check_global_display ); ?> class="with-gap global_display"/>
145
+ <span><?php _e( 'Hide on all pages', 'click-to-chat-for-whatsapp' ); ?></span>
146
+ <span class="dashicons dashicons-hidden"></span>
147
  </label>
148
  </p>
149
+ </div>
 
 
 
 
 
 
 
 
 
 
150
 
151
+ <br>
152
 
153
+ <p class="description" style="margin:16px 0px 20px 0px;"><strong>Override the Global settings</strong></p>
154
+ <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
 
156
+ foreach ($show_hide_settings as $key => $value) {
157
+
158
+ if ( '' == $value ) {
159
+ // heading
160
+ ?>
161
+ <strong><?= $key; ?>: </strong><br><br>
162
+ <?php
163
+ } else {
164
+ $is_checked_show_hide = (isset($display_settings[$key])) ? esc_html($display_settings[$key]) : 'g';
165
+ ?>
166
+ <div class="row show_hide_types">
167
+ <p class="col s3">
168
+ <?= $value; ?>:
169
+ </p>
170
+ <p class="col s3 m3 l2 show_box">
171
+ <label>
172
+ <input name="<?= $dbrow; ?>[display][<?= $key; ?>]" value="show" type="radio" <?php checked( 'show' == $is_checked_show_hide ); ?> class="with-gap show_btn <?= $key; ?>"/>
173
+ <span class="ctc_radio_text"><?php _e( 'Show', 'click-to-chat-for-whatsapp' ); ?></span>
174
+ <span class="dashicons dashicons-visibility"></span>
175
+ </label>
176
+ </p>
177
+ <p class="col s3 m3 l2 hide_box">
178
+ <label>
179
+ <input name="<?= $dbrow; ?>[display][<?= $key; ?>]" value="hide" type="radio" <?php checked( 'hide' == $is_checked_show_hide ); ?> class="with-gap hide_btn <?= $key; ?>"/>
180
+ <span class="ctc_radio_text"><?php _e( 'Hide', 'click-to-chat-for-whatsapp' ); ?></span>
181
+ <span class="dashicons dashicons-hidden"></span>
182
+ </label>
183
+ </p>
184
+ <p class="col s3 m3 l2 global_box">
185
+ <label>
186
+ <input name="<?= $dbrow; ?>[display][<?= $key; ?>]" value="g" type="radio" <?php checked( '' == $is_checked_show_hide || 'g' == $is_checked_show_hide ); ?> class="with-gap global_btn <?= $key; ?>"/>
187
+ <span class="ctc_radio_text"><?php _e( 'Global', 'click-to-chat-for-whatsapp' ); ?> <span class="global_show_or_hide_label"></span></span>
188
+ </label>
189
+ </p>
190
+ </div>
191
+
192
+ <?php
193
+ }
194
+
195
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  }
197
 
198
 
199
  ?>
200
+ <br>
201
+ <p class="description"><strong><?php _e( 'Post Id\'s', 'click-to-chat-for-whatsapp' ); ?></strong></p>
 
202
  <!-- ID's list to hide styles -->
203
+ <div class="row hide_settings">
204
  <div class="input-field col s7">
205
+ <input name="<?= $dbrow; ?>[display][list_hideon_pages]" value="<?= $list_hideon_pages ?>" id="ccw_list_id_tohide" type="text" class="input-margin">
206
+ <label for="ccw_list_id_tohide"><?php _e( "Hide on this pages", 'click-to-chat-for-whatsapp' ); ?></label>
207
  <p class="description"><?php _e( "Add post id's to hide. Add multiple post id's by separating with a comma ( , )", 'click-to-chat-for-whatsapp' ); ?></p>
208
  </div>
209
  </div>
210
 
211
+ <!-- ID's list to show styles -->
212
+ <div class="row show_settings">
213
  <div class="input-field col s7">
214
+ <input name="<?= $dbrow; ?>[display][list_showon_pages]" value="<?= $list_showon_pages ?>" id="ccw_list_id_toshow" type="text" class="input-margin">
215
+ <label for="ccw_list_id_toshow"><?php _e( "Show on this pages", 'click-to-chat-for-whatsapp' ); ?></label>
216
+ <p class="description"><?php _e( "Add Post, Page, Media - ID's to show styles, Add multiple id's by separating with a comma ( , )", 'click-to-chat-for-whatsapp' ); ?></p>
217
  </div>
218
  </div>
219
 
220
+ <p class="description"><strong><?php _e( 'Category names', 'click-to-chat-for-whatsapp' ); ?></strong></p>
221
+ <!-- Categorys list - to hide -->
222
+ <div class="row hide_settings">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
  <div class="input-field col s7">
224
+ <input name="<?= $dbrow; ?>[display][list_hideon_cat]" value="<?= $list_hideon_cat ?>" id="list_hideon_cat" type="text" class="input-margin">
225
+ <label for="list_hideon_cat"><?php _e( 'Hide on this Category posts' , 'click-to-chat-for-whatsapp' ) ?> </label>
226
+ <p class="description"><?php _e( 'Hides on this Category type pages, Add multiple Categories by separating with a comma ( , ) ', 'click-to-chat-for-whatsapp' ); ?></p>
227
  </div>
228
  </div>
229
 
 
230
  <!-- Categorys list - to show -->
231
+ <div class="row show_settings">
232
  <div class="input-field col s7">
233
+ <input name="<?= $dbrow; ?>[display][list_showon_cat]" value="<?= $list_showon_cat ?>" id="ccw_list_cat_toshow" type="text" class="input-margin">
234
+ <label for="ccw_list_cat_toshow"><?php _e( 'Show on this Category posts' , 'click-to-chat-for-whatsapp' ) ?> </label>
235
  <p class="description"><?php _e( 'Show on this Category type pages, Add multiple Categories by separating with a comma ( , )', 'click-to-chat-for-whatsapp' ); ?> </p>
236
  </div>
237
  </div>
238
 
239
+
240
  <?php
241
  if ( 'chat' == $type ) {
242
  do_action('ht_ctc_ah_admin_chat_after_showhide');
new/admin/admin_commons/admin-sidebar-content.php CHANGED
@@ -22,7 +22,7 @@ $othersettings = get_option('ht_ctc_othersettings');
22
  <div class="collapsible-body">
23
  <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=<?= get_bloginfo('url'); ?>%0AHi%20HoliThemes,%0AI%20have%20a%20Suggestion/Feedback:" target="_blank"><?php _e( 'WhatsApp', 'click-to-chat-for-whatsapp' ); ?></a></p>
24
  <p class="description"><?php _e( 'Mail', 'click-to-chat-for-whatsapp' ); ?>:<a href="mailto: ctc@holithemes.com"> ctc@holithemes.com</a></p>
25
- <p class="description">GitHub <a target="_blank" href="https://github.com/holithemes/ctc/discussions"> Discussions</a></p>
26
  <?php
27
  do_action('ht_ctc_ah_admin_sidebar_contact' );
28
  ?>
22
  <div class="collapsible-body">
23
  <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=<?= get_bloginfo('url'); ?>%0AHi%20HoliThemes,%0AI%20have%20a%20Suggestion/Feedback:" target="_blank"><?php _e( 'WhatsApp', 'click-to-chat-for-whatsapp' ); ?></a></p>
24
  <p class="description"><?php _e( 'Mail', 'click-to-chat-for-whatsapp' ); ?>:<a href="mailto: ctc@holithemes.com"> ctc@holithemes.com</a></p>
25
+ <p class="description">GitHub <a target="_blank" href="https://github.com/holithemes/click-to-chat/discussions"> Discussions</a></p>
26
  <?php
27
  do_action('ht_ctc_ah_admin_sidebar_contact' );
28
  ?>
new/admin/admin_commons/class-ht-ctc-admin-hooks.php CHANGED
@@ -23,18 +23,56 @@ class HT_CTC_Admin_Others {
23
 
24
  function admin_hooks() {
25
 
 
 
 
 
 
 
26
  // admin notices
27
  $this->admin_notice();
28
 
29
  // ht_ctc_ah_admin
30
  add_action( 'ht_ctc_ah_admin_after_sanitize', array( $this, 'after_sanitize') );
31
 
32
-
33
  // clear cache
34
  add_action( 'update_option_ht_ctc_admin_pages', array( $this, 'clear_cache') );
35
  // clear cache - customize styles
36
  add_action( 'update_option_ht_ctc_cs_options', array( $this, 'clear_cache') );
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  }
39
 
40
  // runs on all plugin admin pages (expect customize styles - in cs multiple register options are there)
23
 
24
  function admin_hooks() {
25
 
26
+ // if its a click to chat admin page
27
+ add_action( 'load-toplevel_page_click-to-chat', array( $this, 'ctc_admin_pages') );
28
+ add_action( 'load-click-to-chat_page_click-to-chat-customize-styles', array( $this, 'ctc_admin_pages') );
29
+ add_action( 'load-click-to-chat_page_click-to-chat-other-settings', array( $this, 'ctc_admin_pages') );
30
+ add_action( 'load-click-to-chat_page_click-to-chat-woocommerce', array( $this, 'ctc_admin_pages') );
31
+
32
  // admin notices
33
  $this->admin_notice();
34
 
35
  // ht_ctc_ah_admin
36
  add_action( 'ht_ctc_ah_admin_after_sanitize', array( $this, 'after_sanitize') );
37
 
 
38
  // clear cache
39
  add_action( 'update_option_ht_ctc_admin_pages', array( $this, 'clear_cache') );
40
  // clear cache - customize styles
41
  add_action( 'update_option_ht_ctc_cs_options', array( $this, 'clear_cache') );
42
 
43
+ }
44
+
45
+
46
+ // its Click to Chat - admin page
47
+ function ctc_admin_pages() {
48
+
49
+ do_action('ht_ctc_ah_admin_its_ctc_admin_page' );
50
+
51
+ /**
52
+ * when user enters any of the click to chat admin page
53
+ * and if options are not set the it will set.
54
+ *
55
+ * db: group, share, styles(style-2 adds while active)
56
+ * loads only if styles are not defined. checked using s1
57
+ *
58
+ * (db, db2 will also run when version changes from class-ht-ctc-register.php -> version_changed() )
59
+ */
60
+ $s1 = get_option('ht_ctc_s1');
61
+
62
+ if ( !isset($s1['s1_text_color']) ) {
63
+ include_once HT_CTC_PLUGIN_DIR . '/new/admin/db/class-ht-ctc-db2.php';
64
+ }
65
+
66
+
67
+ // if need to run the updater backup
68
+ $chat = get_option('ht_ctc_chat_options');
69
+ if ( !isset($chat['display_mobile']) ) {
70
+ include_once HT_CTC_PLUGIN_DIR . '/new/admin/db/class-ht-ctc-update-db-backup.php';
71
+ }
72
+
73
+
74
+
75
+
76
  }
77
 
78
  // runs on all plugin admin pages (expect customize styles - in cs multiple register options are there)
new/admin/class-ht-ctc-admin-group-page.php CHANGED
@@ -69,8 +69,7 @@ class HT_CTC_Admin_Group_Page {
69
  add_settings_field( 'group_id', __( 'WhatsApp Group ID', 'click-to-chat-for-whatsapp'), array( $this, 'group_id_cb' ), 'ht_ctc_group_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
70
  add_settings_field( 'group_cta', __( 'Call to Action', 'click-to-chat-for-whatsapp'), array( $this, 'group_cta_cb' ), 'ht_ctc_group_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
71
 
72
- add_settings_field( 'group_ctc_desktop', __( 'Desktop', 'click-to-chat-for-whatsapp'), array( $this, 'group_ctc_desktop_cb' ), 'ht_ctc_group_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
73
- add_settings_field( 'group_ctc_mobile', __( 'Mobile', 'click-to-chat-for-whatsapp'), array( $this, 'group_ctc_mobile_cb' ), 'ht_ctc_group_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
74
 
75
  add_settings_field( 'group_show_hide', __( 'Show/Hide', 'click-to-chat-for-whatsapp'), array( $this, 'group_show_hide_cb' ), 'ht_ctc_group_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
76
  add_settings_field( 'group_shortcode_cb', '', array( $this, 'group_shortcode_cb' ), 'ht_ctc_group_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
@@ -117,23 +116,13 @@ class HT_CTC_Admin_Group_Page {
117
  }
118
 
119
 
120
- // Desktop
121
- function group_ctc_desktop_cb() {
122
  $options = get_option('ht_ctc_group');
123
  $dbrow = 'ht_ctc_group';
124
  $type = 'group';
125
 
126
- include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-desktop.php';
127
- }
128
-
129
-
130
- // Mobile
131
- function group_ctc_mobile_cb() {
132
- $options = get_option('ht_ctc_group');
133
- $dbrow = 'ht_ctc_group';
134
- $type = 'group';
135
-
136
- include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-mobile.php';
137
  }
138
 
139
 
@@ -180,6 +169,8 @@ class HT_CTC_Admin_Group_Page {
180
  $input[$key] = '0px';
181
  }
182
  $new_input[$key] = sanitize_text_field( $input[$key] );
 
 
183
  } else {
184
  $new_input[$key] = sanitize_text_field( $input[$key] );
185
  }
69
  add_settings_field( 'group_id', __( 'WhatsApp Group ID', 'click-to-chat-for-whatsapp'), array( $this, 'group_id_cb' ), 'ht_ctc_group_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
70
  add_settings_field( 'group_cta', __( 'Call to Action', 'click-to-chat-for-whatsapp'), array( $this, 'group_cta_cb' ), 'ht_ctc_group_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
71
 
72
+ add_settings_field( 'group_ctc_desktop', __( 'Style, Position', 'click-to-chat-for-whatsapp'), array( $this, 'group_ctc_device_cb' ), 'ht_ctc_group_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
 
73
 
74
  add_settings_field( 'group_show_hide', __( 'Show/Hide', 'click-to-chat-for-whatsapp'), array( $this, 'group_show_hide_cb' ), 'ht_ctc_group_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
75
  add_settings_field( 'group_shortcode_cb', '', array( $this, 'group_shortcode_cb' ), 'ht_ctc_group_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
116
  }
117
 
118
 
119
+ // device based settings - style, position
120
+ function group_ctc_device_cb() {
121
  $options = get_option('ht_ctc_group');
122
  $dbrow = 'ht_ctc_group';
123
  $type = 'group';
124
 
125
+ include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-device-settings.php';
 
 
 
 
 
 
 
 
 
 
126
  }
127
 
128
 
169
  $input[$key] = '0px';
170
  }
171
  $new_input[$key] = sanitize_text_field( $input[$key] );
172
+ } elseif ( 'display' == $key ) {
173
+ $new_input[$key] = array_map( 'sanitize_text_field', $input[$key] );
174
  } else {
175
  $new_input[$key] = sanitize_text_field( $input[$key] );
176
  }
new/admin/class-ht-ctc-admin-main-page.php CHANGED
@@ -6,8 +6,6 @@
6
  *
7
  * enable options .. like chat default enabled, group, share, woocommerce
8
  *
9
- * switch option
10
- *
11
  * @package ctc
12
  * @subpackage admin
13
  * @since 2.0
@@ -91,14 +89,9 @@ class HT_CTC_Admin_Main_Page {
91
  add_settings_field( 'prefilled', __( 'Pre-Filled Message', 'click-to-chat-for-whatsapp'), array( $this, 'prefilled_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
92
  add_settings_field( 'cta', __( 'Call to Action', 'click-to-chat-for-whatsapp'), array( $this, 'cta_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
93
  add_settings_field( 'ctc_webandapi', __( 'Web WhatsApp', 'click-to-chat-for-whatsapp'), array( $this, 'ctc_webandapi_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
94
- add_settings_field( 'ctc_desktop', __( 'Dekstop', 'click-to-chat-for-whatsapp'), array( $this, 'ctc_desktop_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
95
- add_settings_field( 'ctc_mobile', __( 'Mobile', 'click-to-chat-for-whatsapp'), array( $this, 'ctc_mobile_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
96
  add_settings_field( 'ctc_show_hide', __( 'Display Settings', 'click-to-chat-for-whatsapp'), array( $this, 'ctc_show_hide_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
97
 
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
-
102
  add_settings_field( 'options', '', array( $this, 'options_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
103
 
104
  add_settings_field( 'ctc_notes', '', array( $this, 'ctc_notes_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
@@ -132,7 +125,6 @@ class HT_CTC_Admin_Main_Page {
132
 
133
  include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/class-ht-ctc-static.php';
134
  $cc_list = HT_CTC_Static::$cc;
135
-
136
  ?>
137
 
138
  <style>
@@ -268,23 +260,13 @@ class HT_CTC_Admin_Main_Page {
268
  }
269
 
270
 
271
- // Dekstop
272
- function ctc_desktop_cb() {
273
- $options = get_option('ht_ctc_chat_options');
274
- $dbrow = 'ht_ctc_chat_options';
275
- $type = 'chat';
276
-
277
- include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-desktop.php';
278
- }
279
-
280
-
281
- // Mobile
282
- function ctc_mobile_cb() {
283
  $options = get_option('ht_ctc_chat_options');
284
  $dbrow = 'ht_ctc_chat_options';
285
  $type = 'chat';
286
 
287
- include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-mobile.php';
288
  }
289
 
290
 
@@ -298,12 +280,6 @@ class HT_CTC_Admin_Main_Page {
298
  }
299
 
300
 
301
- // WooCommerce related settings
302
- public function ctc_woo_cb() {
303
- do_action('ht_ctc_ah_admin_chat_woo_settings');
304
- }
305
-
306
-
307
  // More options - for addon plugins
308
  function options_cb() {
309
  do_action('ht_ctc_ah_admin_chat_more_options');
@@ -366,7 +342,7 @@ class HT_CTC_Admin_Main_Page {
366
  $input[$key] = '0px';
367
  }
368
  $new_input[$key] = sanitize_text_field( $input[$key] );
369
- } elseif ( 'r_nums' == $key ) {
370
  $new_input[$key] = array_map( 'sanitize_text_field', $input[$key] );
371
  } else {
372
  $new_input[$key] = sanitize_text_field( $input[$key] );
6
  *
7
  * enable options .. like chat default enabled, group, share, woocommerce
8
  *
 
 
9
  * @package ctc
10
  * @subpackage admin
11
  * @since 2.0
89
  add_settings_field( 'prefilled', __( 'Pre-Filled Message', 'click-to-chat-for-whatsapp'), array( $this, 'prefilled_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
90
  add_settings_field( 'cta', __( 'Call to Action', 'click-to-chat-for-whatsapp'), array( $this, 'cta_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
91
  add_settings_field( 'ctc_webandapi', __( 'Web WhatsApp', 'click-to-chat-for-whatsapp'), array( $this, 'ctc_webandapi_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
92
+ add_settings_field( 'ctc_desktop', __( 'Style, Position', 'click-to-chat-for-whatsapp'), array( $this, 'ctc_device_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
 
93
  add_settings_field( 'ctc_show_hide', __( 'Display Settings', 'click-to-chat-for-whatsapp'), array( $this, 'ctc_show_hide_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
94
 
 
 
 
 
95
  add_settings_field( 'options', '', array( $this, 'options_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
96
 
97
  add_settings_field( 'ctc_notes', '', array( $this, 'ctc_notes_cb' ), 'ht_ctc_main_page_settings_sections_do', 'ht_ctc_chat_page_settings_sections_add' );
125
 
126
  include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/class-ht-ctc-static.php';
127
  $cc_list = HT_CTC_Static::$cc;
 
128
  ?>
129
 
130
  <style>
260
  }
261
 
262
 
263
+ // device based settings - style, position
264
+ function ctc_device_cb() {
 
 
 
 
 
 
 
 
 
 
265
  $options = get_option('ht_ctc_chat_options');
266
  $dbrow = 'ht_ctc_chat_options';
267
  $type = 'chat';
268
 
269
+ include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-device-settings.php';
270
  }
271
 
272
 
280
  }
281
 
282
 
 
 
 
 
 
 
283
  // More options - for addon plugins
284
  function options_cb() {
285
  do_action('ht_ctc_ah_admin_chat_more_options');
342
  $input[$key] = '0px';
343
  }
344
  $new_input[$key] = sanitize_text_field( $input[$key] );
345
+ } elseif ( 'display' == $key || 'r_nums' == $key ) {
346
  $new_input[$key] = array_map( 'sanitize_text_field', $input[$key] );
347
  } else {
348
  $new_input[$key] = sanitize_text_field( $input[$key] );
new/admin/class-ht-ctc-admin-other-settings.php CHANGED
@@ -143,9 +143,6 @@ class HT_CTC_Admin_Other_Settings {
143
  <?php
144
  }
145
  ?>
146
- <!-- todo link ga4 -->
147
- <!-- <p class="description ctc_ga4" style="margin-left:40px;"> <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/google-analytics-4/"><?php _e( 'Google Analytics 4', 'click-to-chat-for-whatsapp' ); ?></a> </p> -->
148
-
149
  <p class="description"><?php _e( 'If Google Analytics installed creates an Event there', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/google-analytics/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
150
  <br>
151
 
143
  <?php
144
  }
145
  ?>
 
 
 
146
  <p class="description"><?php _e( 'If Google Analytics installed creates an Event there', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/google-analytics/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
147
  <br>
148
 
new/admin/class-ht-ctc-admin-scripts.php CHANGED
@@ -21,10 +21,10 @@ class HT_CTC_Admin_Scripts {
21
  $load_js_bottom = apply_filters( 'ht_ctc_fh_load_admin_js_bottom', true );
22
 
23
  // $admin_js = 'admin.js';
24
- $admin_js = '331.admin.js';
25
 
26
  // hook ..
27
- if( 'toplevel_page_click-to-chat' == $hook || 'click-to-chat_page_click-to-chat-chat-feature' == $hook || 'click-to-chat_page_click-to-chat-group-feature' == $hook || 'click-to-chat_page_click-to-chat-share-feature' == $hook || 'click-to-chat_page_click-to-chat-customize-styles' == $hook || 'click-to-chat_page_click-to-chat-other-settings' == $hook ) {
28
 
29
  do_action('ht_ctc_ah_admin_scripts_start');
30
 
21
  $load_js_bottom = apply_filters( 'ht_ctc_fh_load_admin_js_bottom', true );
22
 
23
  // $admin_js = 'admin.js';
24
+ $admin_js = '333.admin.js';
25
 
26
  // hook ..
27
+ if( 'toplevel_page_click-to-chat' == $hook || 'click-to-chat_page_click-to-chat-chat-feature' == $hook || 'click-to-chat_page_click-to-chat-group-feature' == $hook || 'click-to-chat_page_click-to-chat-share-feature' == $hook || 'click-to-chat_page_click-to-chat-customize-styles' == $hook || 'click-to-chat_page_click-to-chat-other-settings' == $hook || 'click-to-chat_page_click-to-chat-woocommerce' == $hook ) {
28
 
29
  do_action('ht_ctc_ah_admin_scripts_start');
30
 
new/admin/class-ht-ctc-admin-share-page.php CHANGED
@@ -70,8 +70,7 @@ class HT_CTC_Admin_Share_Page {
70
  add_settings_field( 'share_cta', __( 'Call to Action', 'click-to-chat-for-whatsapp'), array( $this, 'share_cta_cb' ), 'ht_ctc_share_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
71
  add_settings_field( 'share_ctc_webandapi', __( 'Web WhatsApp', 'click-to-chat-for-whatsapp'), array( $this, 'share_ctc_webandapi_cb' ), 'ht_ctc_share_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
72
 
73
- add_settings_field( 'share_ctc_desktop', __( 'Desktop', 'click-to-chat-for-whatsapp'), array( $this, 'share_ctc_desktop_cb' ), 'ht_ctc_share_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
74
- add_settings_field( 'share_ctc_mobile', __( 'Mobile', 'click-to-chat-for-whatsapp'), array( $this, 'share_ctc_mobile_cb' ), 'ht_ctc_share_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
75
 
76
  add_settings_field( 'share_show_hide', __( 'Show/Hide', 'click-to-chat-for-whatsapp'), array( $this, 'share_show_hide_cb' ), 'ht_ctc_share_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
77
  add_settings_field( 'share_shortcode', '', array( $this, 'share_shortcode_cb' ), 'ht_ctc_share_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
@@ -149,23 +148,13 @@ class HT_CTC_Admin_Share_Page {
149
  }
150
 
151
 
152
- // Desktop
153
- function share_ctc_desktop_cb() {
154
  $options = get_option('ht_ctc_share');
155
  $dbrow = 'ht_ctc_share';
156
  $type = 'share';
157
 
158
- include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-desktop.php';
159
- }
160
-
161
-
162
- // Mobile
163
- function share_ctc_mobile_cb() {
164
- $options = get_option('ht_ctc_share');
165
- $dbrow = 'ht_ctc_share';
166
- $type = 'share';
167
-
168
- include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-mobile.php';
169
  }
170
 
171
 
@@ -215,6 +204,8 @@ class HT_CTC_Admin_Share_Page {
215
  $input[$key] = '0px';
216
  }
217
  $new_input[$key] = sanitize_text_field( $input[$key] );
 
 
218
  } else {
219
  $new_input[$key] = sanitize_text_field( $input[$key] );
220
  }
70
  add_settings_field( 'share_cta', __( 'Call to Action', 'click-to-chat-for-whatsapp'), array( $this, 'share_cta_cb' ), 'ht_ctc_share_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
71
  add_settings_field( 'share_ctc_webandapi', __( 'Web WhatsApp', 'click-to-chat-for-whatsapp'), array( $this, 'share_ctc_webandapi_cb' ), 'ht_ctc_share_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
72
 
73
+ add_settings_field( 'share_ctc_desktop', __( 'Style, Position', 'click-to-chat-for-whatsapp'), array( $this, 'share_ctc_device_cb' ), 'ht_ctc_share_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
 
74
 
75
  add_settings_field( 'share_show_hide', __( 'Show/Hide', 'click-to-chat-for-whatsapp'), array( $this, 'share_show_hide_cb' ), 'ht_ctc_share_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
76
  add_settings_field( 'share_shortcode', '', array( $this, 'share_shortcode_cb' ), 'ht_ctc_share_page_settings_sections_do', 'ht_ctc_main_page_settings_sections_add' );
148
  }
149
 
150
 
151
+ // device based settings - style, position
152
+ function share_ctc_device_cb() {
153
  $options = get_option('ht_ctc_share');
154
  $dbrow = 'ht_ctc_share';
155
  $type = 'share';
156
 
157
+ include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-device-settings.php';
 
 
 
 
 
 
 
 
 
 
158
  }
159
 
160
 
204
  $input[$key] = '0px';
205
  }
206
  $new_input[$key] = sanitize_text_field( $input[$key] );
207
+ } elseif ( 'display' == $key ) {
208
+ $new_input[$key] = array_map( 'sanitize_text_field', $input[$key] );
209
  } else {
210
  $new_input[$key] = sanitize_text_field( $input[$key] );
211
  }
new/admin/class-ht-ctc-update-db.php DELETED
@@ -1,150 +0,0 @@
1
- <?php
2
- /**
3
- * When plugin upgrades
4
- *
5
- * update the db values to compatibile with in versions
6
- *
7
- * @package ctc
8
- * @since 3.2.2
9
- * @from ht-ctc-db.php -> db()
10
- */
11
-
12
- if ( ! defined( 'ABSPATH' ) ) exit;
13
-
14
- if ( ! class_exists( 'HT_CTC_Update_DB' ) ) :
15
-
16
- class HT_CTC_Update_DB {
17
-
18
-
19
- public function __construct() {
20
- $this->ht_ctc_updatedb();
21
- }
22
-
23
-
24
- /**
25
- * update db - First
26
- * @since 3.2.2 ( intiall 3.0, later 3.2.2 moved form class-ht-ctc-db.php )
27
- */
28
- public function ht_ctc_updatedb() {
29
-
30
- $ht_ctc_plugin_details = get_option('ht_ctc_plugin_details');
31
-
32
- // $ht_ctc_chat_options = get_option('ht_ctc_chat_options');
33
- // $ht_ctc_group = get_option('ht_ctc_group');
34
- // $ht_ctc_share = get_option('ht_ctc_share');
35
-
36
- // only if already installed.
37
- if ( isset( $ht_ctc_plugin_details['version'] ) ) {
38
-
39
- // v3: if not yet updated to v3 or above (in v3 $ht_ctc_plugin_details['v3'] is added)
40
- if ( !isset( $ht_ctc_plugin_details['v3'] ) ) {
41
- $this->v3_update();
42
- }
43
-
44
- }
45
-
46
-
47
- }
48
-
49
-
50
- /**
51
- * Database updates..
52
- */
53
-
54
- /**
55
- * updating to v3 or above.
56
- * - style 3 Extend to Style-3_1
57
- * - analytics, .. switch to other settings..
58
- */
59
- public function v3_update() {
60
-
61
- $ht_ctc_othersettings = get_option('ht_ctc_othersettings');
62
- $ht_ctc_s3 = get_option('ht_ctc_s3');
63
-
64
- // ht_ctc_main_options to ht_ctc_othersettings
65
- $ht_ctc_main_options = get_option('ht_ctc_main_options');
66
-
67
- if ( $ht_ctc_main_options ) {
68
-
69
- $os = array(
70
- 'hello' => 'world',
71
- );
72
-
73
- if ( isset ( $ht_ctc_main_options['google_analytics'] ) ) {
74
- $os['google_analytics'] = '1';
75
- }
76
- if ( isset ( $ht_ctc_main_options['fb_pixel'] ) ) {
77
- $os['fb_pixel'] = '1';
78
- }
79
- if ( isset ( $ht_ctc_main_options['enable_group'] ) ) {
80
- $os['enable_group'] = '1';
81
- }
82
- if ( isset ( $ht_ctc_main_options['enable_share'] ) ) {
83
- $os['enable_share'] = '1';
84
- }
85
-
86
- $db_os = get_option( 'ht_ctc_othersettings', array() );
87
- $update_os = array_merge($os, $db_os);
88
- update_option('ht_ctc_othersettings', $update_os);
89
-
90
- // delete ht_ctc_main_options settings, as transfered to other settings
91
- delete_option( 'ht_ctc_main_options' );
92
- }
93
-
94
-
95
- // style-3 type extend is selected.. and if style 3 to 3_1
96
- if ( isset($ht_ctc_s3['s3_type']) && 'extend' == $ht_ctc_s3['s3_type'] ) {
97
-
98
- $ht_ctc_chat_options = get_option('ht_ctc_chat_options');
99
- $ht_ctc_group = get_option('ht_ctc_group');
100
- $ht_ctc_share = get_option('ht_ctc_share');
101
-
102
- // this works as s3 type extend came later version of select style dekstop, mobile.
103
- // chat
104
- if ( isset($ht_ctc_chat_options['style_desktop']) && isset($ht_ctc_chat_options['style_mobile']) ) {
105
- if ( '3' == $ht_ctc_chat_options['style_desktop']) {
106
- $ht_ctc_chat_options['style_desktop'] = '3_1';
107
- }
108
- if ( '3' == $ht_ctc_chat_options['style_mobile']) {
109
- $ht_ctc_chat_options['style_mobile'] = '3_1';
110
- }
111
- update_option( 'ht_ctc_chat_options', $ht_ctc_chat_options);
112
- }
113
-
114
- // group
115
- if (isset($ht_ctc_group['style_desktop'])) {
116
- if ( '3' == $ht_ctc_group['style_desktop']) {
117
- $ht_ctc_group['style_desktop'] = '3_1';
118
- }
119
- if ( '3' == $ht_ctc_group['style_mobile']) {
120
- $ht_ctc_group['style_mobile'] = '3_1';
121
- }
122
- update_option( 'ht_ctc_group', $ht_ctc_group);
123
- }
124
-
125
- // share
126
- if (isset($ht_ctc_share['style_desktop'])) {
127
- if ( '3' == $ht_ctc_share['style_desktop']) {
128
- $ht_ctc_share['style_desktop'] = '3_1';
129
- }
130
- if ( '3' == $ht_ctc_share['style_mobile']) {
131
- $ht_ctc_share['style_mobile'] = '3_1';
132
- }
133
- update_option( 'ht_ctc_share', $ht_ctc_share);
134
- }
135
-
136
- }
137
-
138
- }
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
- }
147
-
148
- new HT_CTC_Update_DB();
149
-
150
- endif; // END class_exists check
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
new/admin/db/class-ht-ctc-db.php ADDED
@@ -0,0 +1,237 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Default Values
4
+ *
5
+ * set the default values
6
+ * which stores in database options table
7
+ *
8
+ * @package ctc
9
+ * @since 2.0
10
+ * @from ht-ccw-register.php
11
+ */
12
+
13
+ if ( ! defined( 'ABSPATH' ) ) exit;
14
+
15
+ if ( ! class_exists( 'HT_CTC_DB' ) ) :
16
+
17
+ class HT_CTC_DB {
18
+
19
+
20
+ public $os = '';
21
+
22
+ public function __construct() {
23
+ $this->db();
24
+ }
25
+
26
+
27
+ /**
28
+ * based on condition.. update the db ..
29
+ *
30
+ */
31
+ public function db() {
32
+
33
+ $this->os = array();
34
+ $ht_ctc_plugin_details = get_option('ht_ctc_plugin_details');
35
+
36
+ if ( is_array($ht_ctc_plugin_details) ) {
37
+ $this->os = $ht_ctc_plugin_details;
38
+ }
39
+
40
+ // only if already installed - then only call db updater
41
+ if ( isset( $ht_ctc_plugin_details['version'] ) ) {
42
+ // @since 3.2.2
43
+ include_once HT_CTC_PLUGIN_DIR .'/new/admin/db/class-ht-ctc-update-db.php';
44
+ }
45
+
46
+
47
+ $this->ht_ctc_othersettings();
48
+ $this->ht_ctc_chat_options();
49
+ $this->ht_ctc_s2();
50
+ $this->ht_ctc_plugin_details();
51
+ // $this->ht_ctc_one_time();
52
+
53
+ }
54
+
55
+
56
+ /**
57
+ * table name: "ht_ctc_othersettings"
58
+ *
59
+ * other settings
60
+ *
61
+ * checkboxes ..
62
+ * select_styles_issue
63
+ * enable_group enable_group chat
64
+ * enable_share enable_share
65
+ * google_analytics
66
+ * fb_pixel
67
+ * ga_ads
68
+ * delete options on plugin uninstall
69
+ *
70
+ */
71
+ public function ht_ctc_othersettings() {
72
+
73
+ $values = array(
74
+ 'an_type' => 'no-animation',
75
+ 'an_delay' => '0',
76
+ 'an_itr' => '1',
77
+ 'show_effect' => 'no-show-effects',
78
+ 'amp' => '1',
79
+ );
80
+
81
+ // enable by default for new installs.
82
+ if ( !isset ( $this->os['version'] ) ) {
83
+ $values['google_analytics'] = '1';
84
+ $values['fb_pixel'] = '1';
85
+ $values['show_effect'] = 'From Corner';
86
+ }
87
+
88
+ $db_values = get_option( 'ht_ctc_othersettings', array() );
89
+ $update_values = array_merge($values, $db_values);
90
+ update_option('ht_ctc_othersettings', $update_values);
91
+
92
+ }
93
+
94
+
95
+
96
+
97
+
98
+ /**
99
+ * table name: "ht_ctc_chat_options"
100
+ *
101
+ * Chat options, main page .. some feature enable options ..
102
+ *
103
+ * checkboxes ..
104
+ * hide/show options ..
105
+ * same_settings - desktop, mobile same settings. i.e. apply dekstop setting to mobile - since v3.3.3 for new users auto checks
106
+ *
107
+ * webandapi if checked ? web/api.whatsapp(mobile,desktop) : wa.me
108
+ *
109
+ * @since 3.2.7 - cc, num - better user interface to add number
110
+ *
111
+ */
112
+ public function ht_ctc_chat_options() {
113
+
114
+ $values = array(
115
+ 'cc' => '',
116
+ 'num' => '',
117
+ 'number' => '',
118
+ 'pre_filled' => '',
119
+ 'call_to_action' => 'WhatsApp us',
120
+ 'style_desktop' => '2',
121
+ 'style_mobile' => '2',
122
+
123
+ 'side_1' => 'bottom',
124
+ 'side_1_value' => '15px',
125
+ 'side_2' => 'right',
126
+ 'side_2_value' => '15px',
127
+
128
+ // 'show_or_hide' => 'hide',
129
+ 'list_hideon_pages' => '',
130
+ 'list_hideon_cat' => '',
131
+ 'list_showon_pages' => '',
132
+ 'list_showon_cat' => '',
133
+
134
+ );
135
+
136
+ $options = get_option('ht_ctc_chat_options');
137
+ // mobile position if not set
138
+ if ( !isset($options['mobile_side_1_value']) && !isset($options['mobile_side_2_value']) ) {
139
+ $mobile_values = array(
140
+ 'mobile_side_1' => ( isset( $options['side_1']) ) ? esc_attr( $options['side_1'] ) : 'bottom',
141
+ 'mobile_side_1_value' => ( isset( $options['side_1_value'])) ? esc_attr( $options['side_1_value'] ) : '10px',
142
+ 'mobile_side_2' => ( isset( $options['side_2']) ) ? esc_attr( $options['side_2'] ) : 'right',
143
+ 'mobile_side_2_value' => ( isset( $options['side_2_value'])) ? esc_attr( $options['side_2_value'] ) : '10px',
144
+ );
145
+ $values = array_merge($values, $mobile_values);
146
+ }
147
+
148
+ // for new installs.
149
+ if ( !isset ( $this->os['version'] ) ) {
150
+ $values['same_settings'] = '1';
151
+ $values['display_desktop'] = 'show';
152
+ $values['display_mobile'] = 'show';
153
+ $values['display']['global_display'] = 'show';
154
+ }
155
+
156
+ $db_values = get_option( 'ht_ctc_chat_options', array() );
157
+ $update_values = array_merge($values, $db_values);
158
+ update_option('ht_ctc_chat_options', $update_values);
159
+
160
+ }
161
+
162
+
163
+ // styles
164
+
165
+ /**
166
+ * name: ht_ctc_s2
167
+ *
168
+ * Style-2
169
+ * green square icon
170
+ *
171
+ * cta_type - hover only, show, hide - if new install dispaly on hover.
172
+ */
173
+ public function ht_ctc_s2() {
174
+
175
+ $style_2 = array(
176
+
177
+ 's2_img_size' => '50px',
178
+ 'cta_textcolor' => '#ffffff',
179
+ 'cta_bgcolor' => '#25D366',
180
+
181
+ );
182
+
183
+ // new install
184
+ if ( !isset ( $this->os['version'] ) ) {
185
+ $style_2['cta_type'] = 'hover';
186
+ $style_2['cta_font_size'] = '15px';
187
+ } else {
188
+ $style_2['cta_type'] = 'hide';
189
+ }
190
+
191
+ $db_values = get_option( 'ht_ctc_s2', array() );
192
+ $update_values = array_merge($style_2, $db_values);
193
+ update_option('ht_ctc_s2', $update_values);
194
+
195
+ }
196
+
197
+
198
+
199
+ /**
200
+ * name: ht_ctc_plugin_details
201
+ *
202
+ * don't preseve already existing values
203
+ * Always use update_option - override new values ..
204
+ *
205
+ * Add plugin Details to db
206
+ * Add plugin version to db - useful while updating plugin
207
+ *
208
+ *
209
+ * v_ - from version. 3.0 v3 3.1 as v3_1
210
+ *
211
+ * v3
212
+ * - 'ht_ctc_main_options' option 'google anlayitcs', 'fb pixel' shift to 'ht_ctc_othersettings'
213
+ *
214
+ *
215
+ */
216
+ public function ht_ctc_plugin_details() {
217
+
218
+ // plugin details
219
+ $values = array(
220
+ 'version' => HT_CTC_VERSION,
221
+ 'v3' => 'v3',
222
+ 'v3_2_5' => 'v3_2_5',
223
+ 'v3_3_3' => 'v3_3_3',
224
+ );
225
+
226
+ // Always use update_option - override new values .. don't preseve already existing values
227
+ update_option( 'ht_ctc_plugin_details', $values );
228
+ }
229
+
230
+
231
+
232
+
233
+ }
234
+
235
+ new HT_CTC_DB();
236
+
237
+ endif; // END class_exists check
new/admin/{class-ht-ctc-db.php → db/class-ht-ctc-db2.php} RENAMED
@@ -7,14 +7,15 @@
7
  *
8
  * @package ctc
9
  * @since 2.0
10
- * @from ht-ccw-register.php
 
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit;
14
 
15
- if ( ! class_exists( 'HT_CTC_DB' ) ) :
16
 
17
- class HT_CTC_DB {
18
 
19
 
20
  public $os = '';
@@ -30,10 +31,6 @@ class HT_CTC_DB {
30
  */
31
  public function db() {
32
 
33
- // @since 3.2.2
34
- include_once HT_CTC_PLUGIN_DIR .'/new/admin/class-ht-ctc-update-db.php';
35
-
36
-
37
  $this->os = array();
38
  $ht_ctc_plugin_details = get_option('ht_ctc_plugin_details');
39
 
@@ -42,16 +39,17 @@ class HT_CTC_DB {
42
  }
43
 
44
 
45
- $this->ht_ctc_othersettings();
46
-
47
- $this->ht_ctc_chat_options();
48
  $this->ht_ctc_group();
49
  $this->ht_ctc_share();
50
 
51
- $this->ht_ctc_switch();
 
52
 
53
  $this->ht_ctc_s1();
54
- $this->ht_ctc_s2();
 
 
 
55
  $this->ht_ctc_s3();
56
  $this->ht_ctc_s3_1();
57
  $this->ht_ctc_s4();
@@ -61,119 +59,14 @@ class HT_CTC_DB {
61
  $this->ht_ctc_s7_1();
62
  $this->ht_ctc_s8();
63
  $this->ht_ctc_s99();
64
- // $this->ht_ctc_cs_options();
65
-
66
- $this->ht_ctc_plugin_details();
67
- $this->ht_ctc_one_time();
68
 
69
- }
70
 
71
-
72
- /**
73
- * table name: "ht_ctc_othersettings"
74
- *
75
- * other settings
76
- *
77
- * checkboxes ..
78
- * select_styles_issue
79
- * enable_group enable_group chat
80
- * enable_share enable_share
81
- * google_analytics
82
- * fb_pixel
83
- * ga_ads
84
- * delete options on plugin uninstall
85
- *
86
- */
87
- public function ht_ctc_othersettings() {
88
 
89
- $values = array(
90
- 'an_type' => 'no-animation',
91
- 'an_delay' => '0',
92
- 'an_itr' => '1',
93
- 'show_effect' => 'no-show-effects',
94
- 'amp' => '1',
95
- );
96
-
97
- // enable by default for new installs.
98
- if ( !isset ( $this->os['version'] ) ) {
99
- $values['google_analytics'] = '1';
100
- $values['fb_pixel'] = '1';
101
- $values['show_effect'] = 'From Corner';
102
- }
103
-
104
- $db_values = get_option( 'ht_ctc_othersettings', array() );
105
- $update_values = array_merge($values, $db_values);
106
- update_option('ht_ctc_othersettings', $update_values);
107
-
108
- }
109
-
110
-
111
-
112
-
113
-
114
- /**
115
- * table name: "ht_ctc_chat_options"
116
- *
117
- * Chat options, main page .. some feature enable options ..
118
- *
119
- * checkboxes ..
120
- * hide/show options ..
121
- *
122
- * webandapi if checked ? web/api.whatsapp(mobile,desktop) : wa.me
123
- *
124
- * @since 3.2.7 - cc, num - better user interface to add number
125
- *
126
- */
127
- public function ht_ctc_chat_options() {
128
-
129
- $values = array(
130
- 'cc' => '',
131
- 'num' => '',
132
- 'number' => '',
133
- 'pre_filled' => '',
134
- 'call_to_action' => 'WhatsApp us',
135
- 'style_desktop' => '2',
136
- 'style_mobile' => '2',
137
-
138
- 'side_1' => 'bottom',
139
- 'side_1_value' => '15px',
140
- 'side_2' => 'right',
141
- 'side_2_value' => '15px',
142
-
143
- 'show_or_hide' => 'hide',
144
- 'list_hideon_pages' => '',
145
- 'list_hideon_cat' => '',
146
- 'list_showon_pages' => '',
147
- 'list_showon_cat' => '',
148
-
149
- );
150
-
151
- $options = get_option('ht_ctc_chat_options');
152
- // mobile position if not set
153
- if ( !isset($options['mobile_side_1_value']) && !isset($options['mobile_side_2_value']) ) {
154
- $mobile_values = array(
155
- 'mobile_side_1' => ( isset( $options['side_1']) ) ? esc_attr( $options['side_1'] ) : 'bottom',
156
- 'mobile_side_1_value' => ( isset( $options['side_1_value'])) ? esc_attr( $options['side_1_value'] ) : '10px',
157
- 'mobile_side_2' => ( isset( $options['side_2']) ) ? esc_attr( $options['side_2'] ) : 'right',
158
- 'mobile_side_2_value' => ( isset( $options['side_2_value'])) ? esc_attr( $options['side_2_value'] ) : '10px',
159
- );
160
- $values = array_merge($values, $mobile_values);
161
- }
162
-
163
- // for new installs.
164
- // if ( !isset ( $this->os['version'] ) ) {
165
- // $values['same_settings'] = '1';
166
- // }
167
-
168
- $db_values = get_option( 'ht_ctc_chat_options', array() );
169
- $update_values = array_merge($values, $db_values);
170
- update_option('ht_ctc_chat_options', $update_values);
171
-
172
  }
173
 
174
 
175
 
176
-
177
  /**
178
  * table name: "ht_ctc_group"
179
  *
@@ -214,6 +107,14 @@ class HT_CTC_DB {
214
  $values = array_merge($values, $mobile_values);
215
  }
216
 
 
 
 
 
 
 
 
 
217
 
218
  $db_values = get_option( 'ht_ctc_group', array() );
219
  $update_values = array_merge($values, $db_values);
@@ -265,43 +166,40 @@ class HT_CTC_DB {
265
  $values = array_merge($values, $mobile_values);
266
  }
267
 
 
 
 
 
 
 
 
 
268
  $db_values = get_option( 'ht_ctc_share', array() );
269
  $update_values = array_merge($values, $db_values);
270
  update_option('ht_ctc_share', $update_values);
271
  }
272
 
273
 
274
-
275
-
276
-
277
-
278
  /**
279
- * name: ht_ctc_switch
280
- *
281
- * interface - option - 1 new interface, 2 previous interface
282
- * 'yes' 'no'
283
  *
 
 
284
  */
285
- public function ht_ctc_switch() {
286
-
287
- $interface = 'yes';
288
 
289
  $values = array(
290
- 'interface' => $interface,
291
- );
292
 
 
 
 
293
 
294
- $db_values = get_option( 'ht_ctc_switch', array() );
295
  $update_values = array_merge($values, $db_values);
296
- update_option('ht_ctc_switch', $update_values);
297
-
298
  }
299
 
300
-
301
-
302
-
303
-
304
-
305
 
306
  // styles
307
 
@@ -344,29 +242,29 @@ class HT_CTC_DB {
344
  *
345
  * cta_type - hover only, show, hide - if new install dispaly on hover.
346
  */
347
- public function ht_ctc_s2() {
348
 
349
- $style_2 = array(
350
 
351
- 's2_img_size' => '50px',
352
- 'cta_textcolor' => '#ffffff',
353
- 'cta_bgcolor' => '#25D366',
354
 
355
- );
356
 
357
- // new install
358
- if ( !isset ( $this->os['version'] ) ) {
359
- $style_2['cta_type'] = 'hover';
360
- $style_2['cta_font_size'] = '15px';
361
- } else {
362
- $style_2['cta_type'] = 'hide';
363
- }
364
 
365
- $db_values = get_option( 'ht_ctc_s2', array() );
366
- $update_values = array_merge($style_2, $db_values);
367
- update_option('ht_ctc_s2', $update_values);
368
 
369
- }
370
 
371
 
372
  /**
@@ -672,59 +570,6 @@ class HT_CTC_DB {
672
 
673
  }
674
 
675
- /**
676
- * name: ht_ctc_cs_options
677
- *
678
- * customize styles
679
- *
680
- * @uses clear cache way..
681
- * @note dont update anything from here for not clear cache when plugin updates..
682
- * if need better to update using plugins_loaded at admin pages or so..
683
- */
684
- // public function ht_ctc_cs_options() {
685
-
686
- // $values = array(
687
- // 'hello' => 'world',
688
- // );
689
-
690
- // $db_values = get_option( 'ht_ctc_cs_options', array() );
691
- // $update_values = array_merge($values, $db_values);
692
- // update_option('ht_ctc_cs_options', $update_values);
693
-
694
- // }
695
-
696
-
697
- /**
698
- * name: ht_ctc_plugin_details
699
- *
700
- * don't preseve already existing values
701
- * Always use update_option - override new values ..
702
- *
703
- * Add plugin Details to db
704
- * Add plugin version to db - useful while updating plugin
705
- *
706
- *
707
- * v_ - from version. 3.0 v3 3.1 as v3_1
708
- *
709
- * v3
710
- * - 'ht_ctc_main_options' option 'google anlayitcs', 'fb pixel' shift to 'ht_ctc_othersettings'
711
- *
712
- *
713
- */
714
- public function ht_ctc_plugin_details() {
715
-
716
- // plugin details
717
- $values = array(
718
- 'version' => HT_CTC_VERSION,
719
- 'v3' => 'v3',
720
- 'v3_2_5' => 'v3_2_5',
721
- );
722
-
723
- // Always use update_option - override new values .. don't preseve already existing values
724
- update_option( 'ht_ctc_plugin_details', $values );
725
- }
726
-
727
-
728
  /**
729
  * name: ht_ctc_one_time
730
  *
@@ -754,10 +599,8 @@ class HT_CTC_DB {
754
 
755
 
756
 
757
-
758
-
759
  }
760
 
761
- new HT_CTC_DB();
762
 
763
  endif; // END class_exists check
7
  *
8
  * @package ctc
9
  * @since 2.0
10
+ * @from class-ht-ctc-register.php -> version_changed() - when version changes
11
+ * @from class-ht-ctc-admin-hooks.php -> ctc_admin_pages() - calls for ctc admin pages
12
  */
13
 
14
  if ( ! defined( 'ABSPATH' ) ) exit;
15
 
16
+ if ( ! class_exists( 'HT_CTC_DB2' ) ) :
17
 
18
+ class HT_CTC_DB2 {
19
 
20
 
21
  public $os = '';
31
  */
32
  public function db() {
33
 
 
 
 
 
34
  $this->os = array();
35
  $ht_ctc_plugin_details = get_option('ht_ctc_plugin_details');
36
 
39
  }
40
 
41
 
 
 
 
42
  $this->ht_ctc_group();
43
  $this->ht_ctc_share();
44
 
45
+ // woocommerce
46
+ $this->ht_ctc_woo_options();
47
 
48
  $this->ht_ctc_s1();
49
+
50
+ // s2 at ht-ctc-db.php
51
+ // $this->ht_ctc_s2();
52
+
53
  $this->ht_ctc_s3();
54
  $this->ht_ctc_s3_1();
55
  $this->ht_ctc_s4();
59
  $this->ht_ctc_s7_1();
60
  $this->ht_ctc_s8();
61
  $this->ht_ctc_s99();
 
 
 
 
62
 
63
+ $this->ht_ctc_one_time();
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  }
67
 
68
 
69
 
 
70
  /**
71
  * table name: "ht_ctc_group"
72
  *
107
  $values = array_merge($values, $mobile_values);
108
  }
109
 
110
+ // new install
111
+ if ( !isset ( $this->os['version'] ) ) {
112
+ $values['same_settings'] = '1';
113
+ $values['display_desktop'] = 'show';
114
+ $values['display_mobile'] = 'show';
115
+ $values['display']['global_display'] = 'show';
116
+ }
117
+
118
 
119
  $db_values = get_option( 'ht_ctc_group', array() );
120
  $update_values = array_merge($values, $db_values);
166
  $values = array_merge($values, $mobile_values);
167
  }
168
 
169
+ // new install
170
+ if ( !isset ( $this->os['version'] ) ) {
171
+ $values['same_settings'] = '1';
172
+ $values['display_desktop'] = 'show';
173
+ $values['display_mobile'] = 'show';
174
+ $values['display']['global_display'] = 'show';
175
+ }
176
+
177
  $db_values = get_option( 'ht_ctc_share', array() );
178
  $update_values = array_merge($values, $db_values);
179
  update_option('ht_ctc_share', $update_values);
180
  }
181
 
182
 
 
 
 
 
183
  /**
184
+ * table name: "ht_ctc_woo_options"
 
 
 
185
  *
186
+ * woocommerce
187
+ * @var woo_is_single - checkbox - if checked display flaoting style on woo single product pages
188
  */
189
+ public function ht_ctc_woo_options() {
 
 
190
 
191
  $values = array(
 
 
192
 
193
+ 'woo_pre_filled' => '',
194
+ 'woo_call_to_action' => '',
195
+ );
196
 
197
+ $db_values = get_option( 'ht_ctc_woo_options', array() );
198
  $update_values = array_merge($values, $db_values);
199
+ update_option('ht_ctc_woo_options', $update_values);
 
200
  }
201
 
202
+
 
 
 
 
203
 
204
  // styles
205
 
242
  *
243
  * cta_type - hover only, show, hide - if new install dispaly on hover.
244
  */
245
+ // public function ht_ctc_s2() {
246
 
247
+ // $style_2 = array(
248
 
249
+ // 's2_img_size' => '50px',
250
+ // 'cta_textcolor' => '#ffffff',
251
+ // 'cta_bgcolor' => '#25D366',
252
 
253
+ // );
254
 
255
+ // // new install
256
+ // if ( !isset ( $this->os['version'] ) ) {
257
+ // $style_2['cta_type'] = 'hover';
258
+ // $style_2['cta_font_size'] = '15px';
259
+ // } else {
260
+ // $style_2['cta_type'] = 'hide';
261
+ // }
262
 
263
+ // $db_values = get_option( 'ht_ctc_s2', array() );
264
+ // $update_values = array_merge($style_2, $db_values);
265
+ // update_option('ht_ctc_s2', $update_values);
266
 
267
+ // }
268
 
269
 
270
  /**
570
 
571
  }
572
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
573
  /**
574
  * name: ht_ctc_one_time
575
  *
599
 
600
 
601
 
 
 
602
  }
603
 
604
+ new HT_CTC_DB2();
605
 
606
  endif; // END class_exists check
new/admin/db/class-ht-ctc-update-db-backup.php ADDED
@@ -0,0 +1,539 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * backup/fallback option - if the updater process not worked well.
4
+ *
5
+ * @package ctc
6
+ * @since 3.3.3
7
+ * @from
8
+ * class-ht-ctc-chat.php
9
+ *
10
+ *
11
+ */
12
+
13
+ if ( ! defined( 'ABSPATH' ) ) exit;
14
+
15
+ if ( ! class_exists( 'HT_CTC_Update_DB_Backup' ) ) :
16
+
17
+ class HT_CTC_Update_DB_Backup {
18
+
19
+
20
+ public function __construct() {
21
+ $this->ht_ctc_updatedb();
22
+ }
23
+
24
+
25
+ /**
26
+ * update db - First
27
+ * @since 3.2.2 ( intiall 3.0, later 3.2.2 moved form class-ht-ctc-db.php )
28
+ */
29
+ public function ht_ctc_updatedb() {
30
+
31
+ $ht_ctc_plugin_details = get_option('ht_ctc_plugin_details');
32
+
33
+ // only if already installed.
34
+ if ( isset( $ht_ctc_plugin_details['version'] ) ) {
35
+
36
+ $this->v3_3_3_update_woo();
37
+ $this->v3_3_3_update_show_hide_chat();
38
+ $this->v3_3_3_update_show_hide_group();
39
+ $this->v3_3_3_update_show_hide_share();
40
+
41
+ }
42
+
43
+
44
+ }
45
+
46
+
47
+ /**
48
+ * Database updates..
49
+ */
50
+
51
+
52
+ /**
53
+ * updating to v3.3.3 or above
54
+ *
55
+ * chat
56
+ */
57
+ public function v3_3_3_update_show_hide_chat() {
58
+
59
+ $options = get_option('ht_ctc_chat_options');
60
+
61
+ // show/hide select settings value 2.0 to 3.3.2
62
+ $show_or_hide = (isset($options['show_or_hide'])) ? esc_html($options['show_or_hide']) : '';
63
+
64
+ $n = array();
65
+
66
+ // desktop
67
+ $n['display_desktop'] = 'show';
68
+ if ( isset( $options['hideon_desktop'] ) ) {
69
+ $n['display_desktop'] = 'hide';
70
+ }
71
+
72
+ // mobile
73
+ $n['display_mobile'] = 'show';
74
+ if ( isset( $options['hideon_mobile'] ) ) {
75
+ $n['display_mobile'] = 'hide';
76
+ }
77
+
78
+ /**
79
+ * show / hide
80
+ *
81
+ * if its hide based on then default is hide and get only show settings and apply
82
+ * if its show based on then default is show and get only hide settings and apply
83
+ */
84
+
85
+ $n['display']['show_hide'] = 'setting';
86
+
87
+ if ( 'hide' == $show_or_hide ) {
88
+ // default show on all pages (check: show settings)
89
+
90
+ // new settings - select show
91
+ $n['display']['global_display'] = 'show';
92
+
93
+ // check if any hide settings added
94
+
95
+ // posts
96
+ if ( isset( $options['hideon_posts'] ) ) {
97
+ $n['display']['posts'] = 'hide';
98
+ }
99
+
100
+ // pages
101
+ if ( isset( $options['hideon_page'] ) ) {
102
+ $n['display']['pages'] = 'hide';
103
+ }
104
+
105
+ // home page
106
+ if ( isset( $options['hideon_homepage'] ) ) {
107
+ $n['display']['home'] = 'hide';
108
+ }
109
+
110
+ // category
111
+ if ( isset( $options['hideon_category'] ) ) {
112
+ $n['display']['category'] = 'hide';
113
+ }
114
+
115
+ // archive
116
+ if ( isset( $options['hideon_archive'] ) ) {
117
+ $n['display']['archive'] = 'hide';
118
+ }
119
+
120
+ // 404
121
+ if ( isset( $options['hideon_404'] ) ) {
122
+ $n['display']['page_404'] = 'hide';
123
+ }
124
+
125
+ // woocommerce product pages
126
+ if ( isset( $options['hideon_wooproduct'] ) ) {
127
+ $n['display']['woo_product'] = 'hide';
128
+ }
129
+
130
+ // post id's
131
+ if ( isset( $options['list_hideon_pages'] ) ) {
132
+ $n['display']['list_hideon_pages'] = $options['list_hideon_pages'];
133
+ }
134
+
135
+ // category names
136
+ if ( isset( $options['list_hideon_cat'] ) ) {
137
+ $n['display']['list_hideon_cat'] = $options['list_hideon_cat'];
138
+ }
139
+
140
+ } elseif ( 'show' == $show_or_hide ) {
141
+
142
+ // default hide on all pages (check: hide)
143
+
144
+ // new settings - select hide
145
+ $n['display']['global_display'] = 'hide';
146
+
147
+ // check if any hide settings added
148
+
149
+ // posts
150
+ if ( isset( $options['showon_posts'] ) ) {
151
+ $n['display']['posts'] = 'show';
152
+ }
153
+
154
+ // pages
155
+ if ( isset( $options['showon_page'] ) ) {
156
+ $n['display']['pages'] = 'show';
157
+ }
158
+
159
+ // home page
160
+ if ( isset( $options['showon_homepage'] ) ) {
161
+ $n['display']['home'] = 'show';
162
+ }
163
+
164
+ // category
165
+ if ( isset( $options['showon_category'] ) ) {
166
+ $n['display']['category'] = 'show';
167
+ }
168
+
169
+ // archive
170
+ if ( isset( $options['showon_archive'] ) ) {
171
+ $n['display']['archive'] = 'show';
172
+ }
173
+
174
+ // 404
175
+ if ( isset( $options['showon_404'] ) ) {
176
+ $n['display']['page_404'] = 'show';
177
+ }
178
+
179
+ // woocommerce product pages
180
+ if ( isset( $options['showon_wooproduct'] ) ) {
181
+ $n['display']['woo_product'] = 'show';
182
+ }
183
+
184
+ // post id's
185
+ if ( isset( $options['list_showon_pages'] ) ) {
186
+ $n['display']['list_showon_pages'] = $options['list_showon_pages'];
187
+ }
188
+
189
+ // category names
190
+ if ( isset( $options['list_showon_cat'] ) ) {
191
+ $n['display']['list_showon_cat'] = $options['list_showon_cat'];
192
+ }
193
+
194
+ }
195
+
196
+ $db_values = get_option( 'ht_ctc_chat_options', array() );
197
+ $update_os = array_merge($n, $db_values);
198
+ update_option('ht_ctc_chat_options', $update_os);
199
+
200
+ }
201
+
202
+
203
+ /**
204
+ * updating to v3.3.3 or above
205
+ *
206
+ * group
207
+ */
208
+ public function v3_3_3_update_show_hide_group() {
209
+
210
+ $options = get_option('ht_ctc_group');
211
+
212
+ // show/hide select settings value 2.0 to 3.3.2
213
+ $show_or_hide = (isset($options['show_or_hide'])) ? esc_html($options['show_or_hide']) : '';
214
+
215
+ $n = array();
216
+
217
+ // desktop
218
+ $n['display_desktop'] = 'show';
219
+ if ( isset( $options['hideon_desktop'] ) ) {
220
+ $n['display_desktop'] = 'hide';
221
+ }
222
+
223
+ // mobile
224
+ $n['display_mobile'] = 'show';
225
+ if ( isset( $options['hideon_mobile'] ) ) {
226
+ $n['display_mobile'] = 'hide';
227
+ }
228
+
229
+ /**
230
+ * show / hide
231
+ *
232
+ * if its hide based on then default is hide and get only show settings and apply
233
+ * if its show based on then default is show and get only hide settings and apply
234
+ */
235
+
236
+ $n['display']['show_hide'] = 'setting';
237
+
238
+ if ( 'hide' == $show_or_hide ) {
239
+ // default show on all pages (check: show settings)
240
+
241
+ // new settings - select show
242
+ $n['display']['global_display'] = 'show';
243
+
244
+ // check if any hide settings added
245
+
246
+ // posts
247
+ if ( isset( $options['hideon_posts'] ) ) {
248
+ $n['display']['posts'] = 'hide';
249
+ }
250
+
251
+ // pages
252
+ if ( isset( $options['hideon_page'] ) ) {
253
+ $n['display']['pages'] = 'hide';
254
+ }
255
+
256
+ // home page
257
+ if ( isset( $options['hideon_homepage'] ) ) {
258
+ $n['display']['home'] = 'hide';
259
+ }
260
+
261
+ // category
262
+ if ( isset( $options['hideon_category'] ) ) {
263
+ $n['display']['category'] = 'hide';
264
+ }
265
+
266
+ // archive
267
+ if ( isset( $options['hideon_archive'] ) ) {
268
+ $n['display']['archive'] = 'hide';
269
+ }
270
+
271
+ // 404
272
+ if ( isset( $options['hideon_404'] ) ) {
273
+ $n['display']['page_404'] = 'hide';
274
+ }
275
+
276
+ // woocommerce product pages
277
+ if ( isset( $options['hideon_wooproduct'] ) ) {
278
+ $n['display']['woo_product'] = 'hide';
279
+ }
280
+
281
+ // post id's
282
+ if ( isset( $options['list_hideon_pages'] ) ) {
283
+ $n['display']['list_hideon_pages'] = $options['list_hideon_pages'];
284
+ }
285
+
286
+ // category names
287
+ if ( isset( $options['list_hideon_cat'] ) ) {
288
+ $n['display']['list_hideon_cat'] = $options['list_hideon_cat'];
289
+ }
290
+
291
+ } elseif ( 'show' == $show_or_hide ) {
292
+
293
+ // default hide on all pages (check: hide)
294
+
295
+ // new settings - select hide
296
+ $n['display']['global_display'] = 'hide';
297
+
298
+ // check if any hide settings added
299
+
300
+ // posts
301
+ if ( isset( $options['showon_posts'] ) ) {
302
+ $n['display']['posts'] = 'show';
303
+ }
304
+
305
+ // pages
306
+ if ( isset( $options['showon_page'] ) ) {
307
+ $n['display']['pages'] = 'show';
308
+ }
309
+
310
+ // home page
311
+ if ( isset( $options['showon_homepage'] ) ) {
312
+ $n['display']['home'] = 'show';
313
+ }
314
+
315
+ // category
316
+ if ( isset( $options['showon_category'] ) ) {
317
+ $n['display']['category'] = 'show';
318
+ }
319
+
320
+ // archive
321
+ if ( isset( $options['showon_archive'] ) ) {
322
+ $n['display']['archive'] = 'show';
323
+ }
324
+
325
+ // 404
326
+ if ( isset( $options['showon_404'] ) ) {
327
+ $n['display']['page_404'] = 'show';
328
+ }
329
+
330
+ // woocommerce product pages
331
+ if ( isset( $options['showon_wooproduct'] ) ) {
332
+ $n['display']['woo_product'] = 'show';
333
+ }
334
+
335
+ // post id's
336
+ if ( isset( $options['list_showon_pages'] ) ) {
337
+ $n['display']['list_showon_pages'] = $options['list_showon_pages'];
338
+ }
339
+
340
+ // category names
341
+ if ( isset( $options['list_showon_cat'] ) ) {
342
+ $n['display']['list_showon_cat'] = $options['list_showon_cat'];
343
+ }
344
+
345
+ }
346
+
347
+ $db_values = get_option( 'ht_ctc_group', array() );
348
+ $update_os = array_merge($n, $db_values);
349
+ update_option('ht_ctc_group', $update_os);
350
+
351
+ }
352
+
353
+
354
+ /**
355
+ * updating to v3.3.3 or above
356
+ *
357
+ * share
358
+ */
359
+ public function v3_3_3_update_show_hide_share() {
360
+
361
+ $options = get_option('ht_ctc_share');
362
+
363
+ // show/hide select settings value 2.0 to 3.3.2
364
+ $show_or_hide = (isset($options['show_or_hide'])) ? esc_html($options['show_or_hide']) : '';
365
+
366
+ $n = array();
367
+
368
+ // desktop
369
+ $n['display_desktop'] = 'show';
370
+ if ( isset( $options['hideon_desktop'] ) ) {
371
+ $n['display_desktop'] = 'hide';
372
+ }
373
+
374
+ // mobile
375
+ $n['display_mobile'] = 'show';
376
+ if ( isset( $options['hideon_mobile'] ) ) {
377
+ $n['display_mobile'] = 'hide';
378
+ }
379
+
380
+ /**
381
+ * show / hide
382
+ *
383
+ * if its hide based on then default is hide and get only show settings and apply
384
+ * if its show based on then default is show and get only hide settings and apply
385
+ */
386
+
387
+ $n['display']['show_hide'] = 'setting';
388
+
389
+ if ( 'hide' == $show_or_hide ) {
390
+ // default show on all pages (check: show settings)
391
+
392
+ // new settings - select show
393
+ $n['display']['global_display'] = 'show';
394
+
395
+ // check if any hide settings added
396
+
397
+ // posts
398
+ if ( isset( $options['hideon_posts'] ) ) {
399
+ $n['display']['posts'] = 'hide';
400
+ }
401
+
402
+ // pages
403
+ if ( isset( $options['hideon_page'] ) ) {
404
+ $n['display']['pages'] = 'hide';
405
+ }
406
+
407
+ // home page
408
+ if ( isset( $options['hideon_homepage'] ) ) {
409
+ $n['display']['home'] = 'hide';
410
+ }
411
+
412
+ // category
413
+ if ( isset( $options['hideon_category'] ) ) {
414
+ $n['display']['category'] = 'hide';
415
+ }
416
+
417
+ // archive
418
+ if ( isset( $options['hideon_archive'] ) ) {
419
+ $n['display']['archive'] = 'hide';
420
+ }
421
+
422
+ // 404
423
+ if ( isset( $options['hideon_404'] ) ) {
424
+ $n['display']['page_404'] = 'hide';
425
+ }
426
+
427
+ // woocommerce product pages
428
+ if ( isset( $options['hideon_wooproduct'] ) ) {
429
+ $n['display']['woo_product'] = 'hide';
430
+ }
431
+
432
+ // post id's
433
+ if ( isset( $options['list_hideon_pages'] ) ) {
434
+ $n['display']['list_hideon_pages'] = $options['list_hideon_pages'];
435
+ }
436
+
437
+ // category names
438
+ if ( isset( $options['list_hideon_cat'] ) ) {
439
+ $n['display']['list_hideon_cat'] = $options['list_hideon_cat'];
440
+ }
441
+
442
+ } elseif ( 'show' == $show_or_hide ) {
443
+
444
+ // default hide on all pages (check: hide)
445
+
446
+ // new settings - select hide
447
+ $n['display']['global_display'] = 'hide';
448
+
449
+ // check if any hide settings added
450
+
451
+ // posts
452
+ if ( isset( $options['showon_posts'] ) ) {
453
+ $n['display']['posts'] = 'show';
454
+ }
455
+
456
+ // pages
457
+ if ( isset( $options['showon_page'] ) ) {
458
+ $n['display']['pages'] = 'show';
459
+ }
460
+
461
+ // home page
462
+ if ( isset( $options['showon_homepage'] ) ) {
463
+ $n['display']['home'] = 'show';
464
+ }
465
+
466
+ // category
467
+ if ( isset( $options['showon_category'] ) ) {
468
+ $n['display']['category'] = 'show';
469
+ }
470
+
471
+ // archive
472
+ if ( isset( $options['showon_archive'] ) ) {
473
+ $n['display']['archive'] = 'show';
474
+ }
475
+
476
+ // 404
477
+ if ( isset( $options['showon_404'] ) ) {
478
+ $n['display']['page_404'] = 'show';
479
+ }
480
+
481
+ // woocommerce product pages
482
+ if ( isset( $options['showon_wooproduct'] ) ) {
483
+ $n['display']['woo_product'] = 'show';
484
+ }
485
+
486
+ // post id's
487
+ if ( isset( $options['list_showon_pages'] ) ) {
488
+ $n['display']['list_showon_pages'] = $options['list_showon_pages'];
489
+ }
490
+
491
+ // category names
492
+ if ( isset( $options['list_showon_cat'] ) ) {
493
+ $n['display']['list_showon_cat'] = $options['list_showon_cat'];
494
+ }
495
+
496
+ }
497
+
498
+ $db_values = get_option( 'ht_ctc_share', array() );
499
+ $update_os = array_merge($n, $db_values);
500
+ update_option('ht_ctc_share', $update_os);
501
+
502
+ }
503
+
504
+
505
+ /**
506
+ * updating to v3.3.3 or above
507
+ * - woocommerce option changed from ht_ctc_chat_options settings to ht_ctc_woo_options
508
+ *
509
+ * chat
510
+ */
511
+ public function v3_3_3_update_woo() {
512
+
513
+ $options = get_option('ht_ctc_woo_options');
514
+
515
+ $chat = get_option('ht_ctc_chat_options');
516
+
517
+
518
+ $woo = array(
519
+ 'woo' => 'settings',
520
+ );
521
+
522
+ if ( isset($chat['woo_pre_filled']) ) {
523
+ $woo['woo_pre_filled'] = $chat['woo_pre_filled'];
524
+ }
525
+ if ( isset($chat['woo_call_to_action']) ) {
526
+ $woo['woo_call_to_action'] = $chat['woo_call_to_action'];
527
+ }
528
+
529
+ $db_woo = get_option( 'ht_ctc_woo_options', array() );
530
+ $update_os = array_merge($woo, $db_woo);
531
+ update_option('ht_ctc_woo_options', $update_os);
532
+ }
533
+
534
+
535
+ }
536
+
537
+ new HT_CTC_Update_DB_Backup();
538
+
539
+ endif; // END class_exists check
new/admin/db/class-ht-ctc-update-db.php ADDED
@@ -0,0 +1,637 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * When plugin upgrades
4
+ *
5
+ * update the db values to compatibile with in versions
6
+ *
7
+ * @package ctc
8
+ * @since 3.2.2
9
+ * @from ht-ctc-db.php -> db()
10
+ */
11
+
12
+ if ( ! defined( 'ABSPATH' ) ) exit;
13
+
14
+ if ( ! class_exists( 'HT_CTC_Update_DB' ) ) :
15
+
16
+ class HT_CTC_Update_DB {
17
+
18
+
19
+ public function __construct() {
20
+ $this->ht_ctc_updatedb();
21
+ }
22
+
23
+
24
+ /**
25
+ * update db - First
26
+ * @since 3.2.2 ( intiall 3.0, later 3.2.2 moved form class-ht-ctc-db.php )
27
+ */
28
+ public function ht_ctc_updatedb() {
29
+
30
+ $ht_ctc_plugin_details = get_option('ht_ctc_plugin_details');
31
+
32
+ // only if already installed.
33
+ if ( isset( $ht_ctc_plugin_details['version'] ) ) {
34
+
35
+ // v3: if not yet updated to v3 or above (in v3 $ht_ctc_plugin_details['v3'] is not added)
36
+ if ( !isset( $ht_ctc_plugin_details['v3'] ) ) {
37
+ $this->v3_update();
38
+ }
39
+
40
+ // v3.3.3: if not yet updated to v3.3.3 or above (in v3 $ht_ctc_plugin_details['v3_3_3'] is not added)
41
+ if ( !isset( $ht_ctc_plugin_details['v3_3_3'] ) ) {
42
+ $this->v3_3_3_update_woo();
43
+ $this->v3_3_3_update_show_hide_chat();
44
+ $this->v3_3_3_update_show_hide_group();
45
+ $this->v3_3_3_update_show_hide_share();
46
+ }
47
+
48
+ }
49
+
50
+
51
+ }
52
+
53
+
54
+ /**
55
+ * Database updates..
56
+ */
57
+
58
+
59
+ /**
60
+ * updating to v3.3.3 or above
61
+ *
62
+ * chat
63
+ */
64
+ public function v3_3_3_update_show_hide_chat() {
65
+
66
+ $options = get_option('ht_ctc_chat_options');
67
+
68
+ // show/hide select settings value 2.0 to 3.3.2
69
+ $show_or_hide = (isset($options['show_or_hide'])) ? esc_html($options['show_or_hide']) : '';
70
+
71
+ $n = array();
72
+
73
+ // desktop
74
+ $n['display_desktop'] = 'show';
75
+ if ( isset( $options['hideon_desktop'] ) ) {
76
+ $n['display_desktop'] = 'hide';
77
+ }
78
+
79
+ // mobile
80
+ $n['display_mobile'] = 'show';
81
+ if ( isset( $options['hideon_mobile'] ) ) {
82
+ $n['display_mobile'] = 'hide';
83
+ }
84
+
85
+ /**
86
+ * show / hide
87
+ *
88
+ * if its hide based on then default is hide and get only show settings and apply
89
+ * if its show based on then default is show and get only hide settings and apply
90
+ */
91
+
92
+ $n['display']['show_hide'] = 'setting';
93
+
94
+ if ( 'hide' == $show_or_hide ) {
95
+ // default show on all pages (check: show settings)
96
+
97
+ // new settings - select show
98
+ $n['display']['global_display'] = 'show';
99
+
100
+ // check if any hide settings added
101
+
102
+ // posts
103
+ if ( isset( $options['hideon_posts'] ) ) {
104
+ $n['display']['posts'] = 'hide';
105
+ }
106
+
107
+ // pages
108
+ if ( isset( $options['hideon_page'] ) ) {
109
+ $n['display']['pages'] = 'hide';
110
+ }
111
+
112
+ // home page
113
+ if ( isset( $options['hideon_homepage'] ) ) {
114
+ $n['display']['home'] = 'hide';
115
+ }
116
+
117
+ // category
118
+ if ( isset( $options['hideon_category'] ) ) {
119
+ $n['display']['category'] = 'hide';
120
+ }
121
+
122
+ // archive
123
+ if ( isset( $options['hideon_archive'] ) ) {
124
+ $n['display']['archive'] = 'hide';
125
+ }
126
+
127
+ // 404
128
+ if ( isset( $options['hideon_404'] ) ) {
129
+ $n['display']['page_404'] = 'hide';
130
+ }
131
+
132
+ // woocommerce product pages
133
+ if ( isset( $options['hideon_wooproduct'] ) ) {
134
+ $n['display']['woo_product'] = 'hide';
135
+ }
136
+
137
+ // post id's
138
+ if ( isset( $options['list_hideon_pages'] ) ) {
139
+ $n['display']['list_hideon_pages'] = $options['list_hideon_pages'];
140
+ }
141
+
142
+ // category names
143
+ if ( isset( $options['list_hideon_cat'] ) ) {
144
+ $n['display']['list_hideon_cat'] = $options['list_hideon_cat'];
145
+ }
146
+
147
+ } elseif ( 'show' == $show_or_hide ) {
148
+
149
+ // default hide on all pages (check: hide)
150
+
151
+ // new settings - select hide
152
+ $n['display']['global_display'] = 'hide';
153
+
154
+ // check if any hide settings added
155
+
156
+ // posts
157
+ if ( isset( $options['showon_posts'] ) ) {
158
+ $n['display']['posts'] = 'show';
159
+ }
160
+
161
+ // pages
162
+ if ( isset( $options['showon_page'] ) ) {
163
+ $n['display']['pages'] = 'show';
164
+ }
165
+
166
+ // home page
167
+ if ( isset( $options['showon_homepage'] ) ) {
168
+ $n['display']['home'] = 'show';
169
+ }
170
+
171
+ // category
172
+ if ( isset( $options['showon_category'] ) ) {
173
+ $n['display']['category'] = 'show';
174
+ }
175
+
176
+ // archive
177
+ if ( isset( $options['showon_archive'] ) ) {
178
+ $n['display']['archive'] = 'show';
179
+ }
180
+
181
+ // 404
182
+ if ( isset( $options['showon_404'] ) ) {
183
+ $n['display']['page_404'] = 'show';
184
+ }
185
+
186
+ // woocommerce product pages
187
+ if ( isset( $options['showon_wooproduct'] ) ) {
188
+ $n['display']['woo_product'] = 'show';
189
+ }
190
+
191
+ // post id's
192
+ if ( isset( $options['list_showon_pages'] ) ) {
193
+ $n['display']['list_showon_pages'] = $options['list_showon_pages'];
194
+ }
195
+
196
+ // category names
197
+ if ( isset( $options['list_showon_cat'] ) ) {
198
+ $n['display']['list_showon_cat'] = $options['list_showon_cat'];
199
+ }
200
+
201
+ }
202
+
203
+ $db_values = get_option( 'ht_ctc_chat_options', array() );
204
+ $update_os = array_merge($n, $db_values);
205
+ update_option('ht_ctc_chat_options', $update_os);
206
+
207
+ }
208
+
209
+
210
+ /**
211
+ * updating to v3.3.3 or above
212
+ *
213
+ * group
214
+ */
215
+ public function v3_3_3_update_show_hide_group() {
216
+
217
+ $options = get_option('ht_ctc_group');
218
+
219
+ // show/hide select settings value 2.0 to 3.3.2
220
+ $show_or_hide = (isset($options['show_or_hide'])) ? esc_html($options['show_or_hide']) : '';
221
+
222
+ $n = array();
223
+
224
+ // desktop
225
+ $n['display_desktop'] = 'show';
226
+ if ( isset( $options['hideon_desktop'] ) ) {
227
+ $n['display_desktop'] = 'hide';
228
+ }
229
+
230
+ // mobile
231
+ $n['display_mobile'] = 'show';
232
+ if ( isset( $options['hideon_mobile'] ) ) {
233
+ $n['display_mobile'] = 'hide';
234
+ }
235
+
236
+ /**
237
+ * show / hide
238
+ *
239
+ * if its hide based on then default is hide and get only show settings and apply
240
+ * if its show based on then default is show and get only hide settings and apply
241
+ */
242
+
243
+ $n['display']['show_hide'] = 'setting';
244
+
245
+ if ( 'hide' == $show_or_hide ) {
246
+ // default show on all pages (check: show settings)
247
+
248
+ // new settings - select show
249
+ $n['display']['global_display'] = 'show';
250
+
251
+ // check if any hide settings added
252
+
253
+ // posts
254
+ if ( isset( $options['hideon_posts'] ) ) {
255
+ $n['display']['posts'] = 'hide';
256
+ }
257
+
258
+ // pages
259
+ if ( isset( $options['hideon_page'] ) ) {
260
+ $n['display']['pages'] = 'hide';
261
+ }
262
+
263
+ // home page
264
+ if ( isset( $options['hideon_homepage'] ) ) {
265
+ $n['display']['home'] = 'hide';
266
+ }
267
+
268
+ // category
269
+ if ( isset( $options['hideon_category'] ) ) {
270
+ $n['display']['category'] = 'hide';
271
+ }
272
+
273
+ // archive
274
+ if ( isset( $options['hideon_archive'] ) ) {
275
+ $n['display']['archive'] = 'hide';
276
+ }
277
+
278
+ // 404
279
+ if ( isset( $options['hideon_404'] ) ) {
280
+ $n['display']['page_404'] = 'hide';
281
+ }
282
+
283
+ // woocommerce product pages
284
+ if ( isset( $options['hideon_wooproduct'] ) ) {
285
+ $n['display']['woo_product'] = 'hide';
286
+ }
287
+
288
+ // post id's
289
+ if ( isset( $options['list_hideon_pages'] ) ) {
290
+ $n['display']['list_hideon_pages'] = $options['list_hideon_pages'];
291
+ }
292
+
293
+ // category names
294
+ if ( isset( $options['list_hideon_cat'] ) ) {
295
+ $n['display']['list_hideon_cat'] = $options['list_hideon_cat'];
296
+ }
297
+
298
+ } elseif ( 'show' == $show_or_hide ) {
299
+
300
+ // default hide on all pages (check: hide)
301
+
302
+ // new settings - select hide
303
+ $n['display']['global_display'] = 'hide';
304
+
305
+ // check if any hide settings added
306
+
307
+ // posts
308
+ if ( isset( $options['showon_posts'] ) ) {
309
+ $n['display']['posts'] = 'show';
310
+ }
311
+
312
+ // pages
313
+ if ( isset( $options['showon_page'] ) ) {
314
+ $n['display']['pages'] = 'show';
315
+ }
316
+
317
+ // home page
318
+ if ( isset( $options['showon_homepage'] ) ) {
319
+ $n['display']['home'] = 'show';
320
+ }
321
+
322
+ // category
323
+ if ( isset( $options['showon_category'] ) ) {
324
+ $n['display']['category'] = 'show';
325
+ }
326
+
327
+ // archive
328
+ if ( isset( $options['showon_archive'] ) ) {
329
+ $n['display']['archive'] = 'show';
330
+ }
331
+
332
+ // 404
333
+ if ( isset( $options['showon_404'] ) ) {
334
+ $n['display']['page_404'] = 'show';
335
+ }
336
+
337
+ // woocommerce product pages
338
+ if ( isset( $options['showon_wooproduct'] ) ) {
339
+ $n['display']['woo_product'] = 'show';
340
+ }
341
+
342
+ // post id's
343
+ if ( isset( $options['list_showon_pages'] ) ) {
344
+ $n['display']['list_showon_pages'] = $options['list_showon_pages'];
345
+ }
346
+
347
+ // category names
348
+ if ( isset( $options['list_showon_cat'] ) ) {
349
+ $n['display']['list_showon_cat'] = $options['list_showon_cat'];
350
+ }
351
+
352
+ }
353
+
354
+ $db_values = get_option( 'ht_ctc_group', array() );
355
+ $update_os = array_merge($n, $db_values);
356
+ update_option('ht_ctc_group', $update_os);
357
+
358
+ }
359
+
360
+
361
+ /**
362
+ * updating to v3.3.3 or above
363
+ *
364
+ * share
365
+ */
366
+ public function v3_3_3_update_show_hide_share() {
367
+
368
+ $options = get_option('ht_ctc_share');
369
+
370
+ // show/hide select settings value 2.0 to 3.3.2
371
+ $show_or_hide = (isset($options['show_or_hide'])) ? esc_html($options['show_or_hide']) : '';
372
+
373
+ $n = array();
374
+
375
+ // desktop
376
+ $n['display_desktop'] = 'show';
377
+ if ( isset( $options['hideon_desktop'] ) ) {
378
+ $n['display_desktop'] = 'hide';
379
+ }
380
+
381
+ // mobile
382
+ $n['display_mobile'] = 'show';
383
+ if ( isset( $options['hideon_mobile'] ) ) {
384
+ $n['display_mobile'] = 'hide';
385
+ }
386
+
387
+ /**
388
+ * show / hide
389
+ *
390
+ * if its hide based on then default is hide and get only show settings and apply
391
+ * if its show based on then default is show and get only hide settings and apply
392
+ */
393
+
394
+ $n['display']['show_hide'] = 'setting';
395
+
396
+ if ( 'hide' == $show_or_hide ) {
397
+ // default show on all pages (check: show settings)
398
+
399
+ // new settings - select show
400
+ $n['display']['global_display'] = 'show';
401
+
402
+ // check if any hide settings added
403
+
404
+ // posts
405
+ if ( isset( $options['hideon_posts'] ) ) {
406
+ $n['display']['posts'] = 'hide';
407
+ }
408
+
409
+ // pages
410
+ if ( isset( $options['hideon_page'] ) ) {
411
+ $n['display']['pages'] = 'hide';
412
+ }
413
+
414
+ // home page
415
+ if ( isset( $options['hideon_homepage'] ) ) {
416
+ $n['display']['home'] = 'hide';
417
+ }
418
+
419
+ // category
420
+ if ( isset( $options['hideon_category'] ) ) {
421
+ $n['display']['category'] = 'hide';
422
+ }
423
+
424
+ // archive
425
+ if ( isset( $options['hideon_archive'] ) ) {
426
+ $n['display']['archive'] = 'hide';
427
+ }
428
+
429
+ // 404
430
+ if ( isset( $options['hideon_404'] ) ) {
431
+ $n['display']['page_404'] = 'hide';
432
+ }
433
+
434
+ // woocommerce product pages
435
+ if ( isset( $options['hideon_wooproduct'] ) ) {
436
+ $n['display']['woo_product'] = 'hide';
437
+ }
438
+
439
+ // post id's
440
+ if ( isset( $options['list_hideon_pages'] ) ) {
441
+ $n['display']['list_hideon_pages'] = $options['list_hideon_pages'];
442
+ }
443
+
444
+ // category names
445
+ if ( isset( $options['list_hideon_cat'] ) ) {
446
+ $n['display']['list_hideon_cat'] = $options['list_hideon_cat'];
447
+ }
448
+
449
+ } elseif ( 'show' == $show_or_hide ) {
450
+
451
+ // default hide on all pages (check: hide)
452
+
453
+ // new settings - select hide
454
+ $n['display']['global_display'] = 'hide';
455
+
456
+ // check if any hide settings added
457
+
458
+ // posts
459
+ if ( isset( $options['showon_posts'] ) ) {
460
+ $n['display']['posts'] = 'show';
461
+ }
462
+
463
+ // pages
464
+ if ( isset( $options['showon_page'] ) ) {
465
+ $n['display']['pages'] = 'show';
466
+ }
467
+
468
+ // home page
469
+ if ( isset( $options['showon_homepage'] ) ) {
470
+ $n['display']['home'] = 'show';
471
+ }
472
+
473
+ // category
474
+ if ( isset( $options['showon_category'] ) ) {
475
+ $n['display']['category'] = 'show';
476
+ }
477
+
478
+ // archive
479
+ if ( isset( $options['showon_archive'] ) ) {
480
+ $n['display']['archive'] = 'show';
481
+ }
482
+
483
+ // 404
484
+ if ( isset( $options['showon_404'] ) ) {
485
+ $n['display']['page_404'] = 'show';
486
+ }
487
+
488
+ // woocommerce product pages
489
+ if ( isset( $options['showon_wooproduct'] ) ) {
490
+ $n['display']['woo_product'] = 'show';
491
+ }
492
+
493
+ // post id's
494
+ if ( isset( $options['list_showon_pages'] ) ) {
495
+ $n['display']['list_showon_pages'] = $options['list_showon_pages'];
496
+ }
497
+
498
+ // category names
499
+ if ( isset( $options['list_showon_cat'] ) ) {
500
+ $n['display']['list_showon_cat'] = $options['list_showon_cat'];
501
+ }
502
+
503
+ }
504
+
505
+ $db_values = get_option( 'ht_ctc_share', array() );
506
+ $update_os = array_merge($n, $db_values);
507
+ update_option('ht_ctc_share', $update_os);
508
+
509
+ }
510
+
511
+
512
+ /**
513
+ * updating to v3.3.3 or above
514
+ * - woocommerce option changed from ht_ctc_chat_options settings to ht_ctc_woo_options
515
+ *
516
+ * chat
517
+ */
518
+ public function v3_3_3_update_woo() {
519
+
520
+ $options = get_option('ht_ctc_woo_options');
521
+
522
+ $chat = get_option('ht_ctc_chat_options');
523
+
524
+
525
+ $woo = array(
526
+ 'woo' => 'settings',
527
+ );
528
+
529
+ if ( isset($chat['woo_pre_filled']) ) {
530
+ $woo['woo_pre_filled'] = $chat['woo_pre_filled'];
531
+ }
532
+ if ( isset($chat['woo_call_to_action']) ) {
533
+ $woo['woo_call_to_action'] = $chat['woo_call_to_action'];
534
+ }
535
+
536
+ $db_woo = get_option( 'ht_ctc_woo_options', array() );
537
+ $update_os = array_merge($woo, $db_woo);
538
+ update_option('ht_ctc_woo_options', $update_os);
539
+ }
540
+
541
+ /**
542
+ * updating to v3 or above.
543
+ * - style 3 Extend to Style-3_1
544
+ * - analytics, .. switch to other settings..
545
+ */
546
+ public function v3_update() {
547
+
548
+ $ht_ctc_othersettings = get_option('ht_ctc_othersettings');
549
+ $ht_ctc_s3 = get_option('ht_ctc_s3');
550
+
551
+ // ht_ctc_main_options to ht_ctc_othersettings
552
+ $ht_ctc_main_options = get_option('ht_ctc_main_options');
553
+
554
+ if ( $ht_ctc_main_options ) {
555
+
556
+ $os = array(
557
+ 'hello' => 'world',
558
+ );
559
+
560
+ if ( isset ( $ht_ctc_main_options['google_analytics'] ) ) {
561
+ $os['google_analytics'] = '1';
562
+ }
563
+ if ( isset ( $ht_ctc_main_options['fb_pixel'] ) ) {
564
+ $os['fb_pixel'] = '1';
565
+ }
566
+ if ( isset ( $ht_ctc_main_options['enable_group'] ) ) {
567
+ $os['enable_group'] = '1';
568
+ }
569
+ if ( isset ( $ht_ctc_main_options['enable_share'] ) ) {
570
+ $os['enable_share'] = '1';
571
+ }
572
+
573
+ $db_os = get_option( 'ht_ctc_othersettings', array() );
574
+ $update_os = array_merge($os, $db_os);
575
+ update_option('ht_ctc_othersettings', $update_os);
576
+
577
+ // delete ht_ctc_main_options settings, as transfered to other settings
578
+ delete_option( 'ht_ctc_main_options' );
579
+ }
580
+
581
+
582
+ // style-3 type extend is selected.. and if style 3 to 3_1
583
+ if ( isset($ht_ctc_s3['s3_type']) && 'extend' == $ht_ctc_s3['s3_type'] ) {
584
+
585
+ $ht_ctc_chat_options = get_option('ht_ctc_chat_options');
586
+ $ht_ctc_group = get_option('ht_ctc_group');
587
+ $ht_ctc_share = get_option('ht_ctc_share');
588
+
589
+ // this works as s3 type extend came later version of select style dekstop, mobile.
590
+ // chat
591
+ if ( isset($ht_ctc_chat_options['style_desktop']) && isset($ht_ctc_chat_options['style_mobile']) ) {
592
+ if ( '3' == $ht_ctc_chat_options['style_desktop']) {
593
+ $ht_ctc_chat_options['style_desktop'] = '3_1';
594
+ }
595
+ if ( '3' == $ht_ctc_chat_options['style_mobile']) {
596
+ $ht_ctc_chat_options['style_mobile'] = '3_1';
597
+ }
598
+ update_option( 'ht_ctc_chat_options', $ht_ctc_chat_options);
599
+ }
600
+
601
+ // group
602
+ if (isset($ht_ctc_group['style_desktop'])) {
603
+ if ( '3' == $ht_ctc_group['style_desktop']) {
604
+ $ht_ctc_group['style_desktop'] = '3_1';
605
+ }
606
+ if ( '3' == $ht_ctc_group['style_mobile']) {
607
+ $ht_ctc_group['style_mobile'] = '3_1';
608
+ }
609
+ update_option( 'ht_ctc_group', $ht_ctc_group);
610
+ }
611
+
612
+ // share
613
+ if (isset($ht_ctc_share['style_desktop'])) {
614
+ if ( '3' == $ht_ctc_share['style_desktop']) {
615
+ $ht_ctc_share['style_desktop'] = '3_1';
616
+ }
617
+ if ( '3' == $ht_ctc_share['style_mobile']) {
618
+ $ht_ctc_share['style_mobile'] = '3_1';
619
+ }
620
+ update_option( 'ht_ctc_share', $ht_ctc_share);
621
+ }
622
+
623
+ }
624
+
625
+ }
626
+
627
+
628
+
629
+
630
+
631
+
632
+
633
+ }
634
+
635
+ new HT_CTC_Update_DB();
636
+
637
+ endif; // END class_exists check
new/inc/assets/js/dev/app.dev.js CHANGED
@@ -51,11 +51,14 @@ $(function () {
51
  // fixed position
52
  ht_ctc();
53
 
 
 
 
54
  // shortcode
55
  shortcode();
56
 
57
  // custom element
58
- link();
59
 
60
  }
61
 
@@ -308,7 +311,7 @@ $(function () {
308
  }
309
 
310
  // custom element
311
- function link() {
312
 
313
  $(document).on('click', '.ctc_chat, #ctc_chat', function () {
314
  console.log('class/Id: ctc_chat');
@@ -322,7 +325,13 @@ $(function () {
322
  });
323
  }
324
 
 
 
 
 
 
325
 
 
326
  function hook(number) {
327
 
328
  console.log('hook');
51
  // fixed position
52
  ht_ctc();
53
 
54
+ // woo positions
55
+ woo();
56
+
57
  // shortcode
58
  shortcode();
59
 
60
  // custom element
61
+ custom_link();
62
 
63
  }
64
 
311
  }
312
 
313
  // custom element
314
+ function custom_link() {
315
 
316
  $(document).on('click', '.ctc_chat, #ctc_chat', function () {
317
  console.log('class/Id: ctc_chat');
325
  });
326
  }
327
 
328
+ // woo positions
329
+ function woo() {
330
+ console.log('woo');
331
+ }
332
+
333
 
334
+ // webhooks
335
  function hook(number) {
336
 
337
  console.log('hook');
new/inc/chat/class-ht-ctc-chat-shortcode.php CHANGED
@@ -33,12 +33,16 @@ class HT_CTC_Chat_Shortcode {
33
  $call_to_action = __( $call_to_action_db , 'click-to-chat-for-whatsapp' );
34
  $pre_filled = __( $pre_filled_db , 'click-to-chat-for-whatsapp' );
35
 
36
- $style_desktop = esc_attr( $options['style_desktop'] );
37
- $style_mobile = esc_attr( $options['style_mobile'] );
 
 
 
 
38
 
39
  $is_mobile = ht_ctc()->device_type->is_mobile();
40
 
41
- $style = $style_desktop;;
42
  if ( 'yes' == $is_mobile ) {
43
  $style = $style_mobile;
44
  }
33
  $call_to_action = __( $call_to_action_db , 'click-to-chat-for-whatsapp' );
34
  $pre_filled = __( $pre_filled_db , 'click-to-chat-for-whatsapp' );
35
 
36
+ $style_desktop = (isset($options['style_desktop'])) ? esc_attr($options['style_desktop']) : '2';
37
+ if (isset($options['same_settings'])) {
38
+ $style_mobile = $style_desktop;
39
+ } else {
40
+ $style_mobile = (isset($options['style_mobile'])) ? esc_attr($options['style_mobile']) : '2';
41
+ }
42
 
43
  $is_mobile = ht_ctc()->device_type->is_mobile();
44
 
45
+ $style = $style_desktop;
46
  if ( 'yes' == $is_mobile ) {
47
  $style = $style_mobile;
48
  }
new/inc/chat/class-ht-ctc-chat.php CHANGED
@@ -11,6 +11,11 @@ if ( ! class_exists( 'HT_CTC_Chat' ) ) :
11
 
12
  class HT_CTC_Chat {
13
 
 
 
 
 
 
14
  public function chat() {
15
 
16
  $options = get_option('ht_ctc_chat_options');
@@ -57,7 +62,11 @@ class HT_CTC_Chat {
57
  $is_mobile = ht_ctc()->device_type->is_mobile();
58
  // style
59
  $ht_ctc_chat['style_desktop'] = (isset($options['style_desktop'])) ? esc_attr($options['style_desktop']) : '2';
60
- $ht_ctc_chat['style_mobile'] = (isset($options['style_mobile'])) ? esc_attr($options['style_mobile']) : '2';
 
 
 
 
61
 
62
  // position
63
  // default position override at js, but useful in amp pages
@@ -93,8 +102,13 @@ class HT_CTC_Chat {
93
  $ht_ctc_chat['webandapi'] = 'web';
94
  }
95
 
96
- $ht_ctc_chat['display_mobile'] = (isset($options['hideon_mobile'])) ? 'hide' : 'show';
97
- $ht_ctc_chat['display_desktop'] = (isset($options['hideon_desktop'])) ? 'hide' : 'show';
 
 
 
 
 
98
 
99
  // number not added and is administrator
100
  $no_number = '';
@@ -293,9 +307,7 @@ class HT_CTC_Chat {
293
  do_action('ht_ctc_ah_before_fixed_position');
294
  ?>
295
  <div class="<?= $ht_ctc_chat['class_names'] ?>" id="<?= $ht_ctc_chat['id'] ?>"
296
- style="<?= $display_css ?> <?= $default_position ?>"
297
- <?= $on ?>
298
- >
299
  <?php
300
  if ( isset( $othersettings['select_styles_issue'] ) ) {
301
  ?>
11
 
12
  class HT_CTC_Chat {
13
 
14
+ /**
15
+ * Chat
16
+ *
17
+ * @var $display - changes at show-hide.php
18
+ */
19
  public function chat() {
20
 
21
  $options = get_option('ht_ctc_chat_options');
62
  $is_mobile = ht_ctc()->device_type->is_mobile();
63
  // style
64
  $ht_ctc_chat['style_desktop'] = (isset($options['style_desktop'])) ? esc_attr($options['style_desktop']) : '2';
65
+ if (isset($options['same_settings'])) {
66
+ $ht_ctc_chat['style_mobile'] = $ht_ctc_chat['style_desktop'];
67
+ } else {
68
+ $ht_ctc_chat['style_mobile'] = (isset($options['style_mobile'])) ? esc_attr($options['style_mobile']) : '2';
69
+ }
70
 
71
  // position
72
  // default position override at js, but useful in amp pages
102
  $ht_ctc_chat['webandapi'] = 'web';
103
  }
104
 
105
+ // need to run the updater backup
106
+ if ( !isset($options['display_mobile']) ) {
107
+ include_once HT_CTC_PLUGIN_DIR . '/new/admin/db/class-ht-ctc-update-db-backup.php';
108
+ }
109
+
110
+ $ht_ctc_chat['display_mobile'] = (isset($options['display_mobile'])) ? esc_attr($options['display_mobile']) : 'show';
111
+ $ht_ctc_chat['display_desktop'] = (isset($options['display_desktop'])) ? esc_attr($options['display_desktop']) : 'show';
112
 
113
  // number not added and is administrator
114
  $no_number = '';
307
  do_action('ht_ctc_ah_before_fixed_position');
308
  ?>
309
  <div class="<?= $ht_ctc_chat['class_names'] ?>" id="<?= $ht_ctc_chat['id'] ?>"
310
+ style="<?= $display_css ?> <?= $default_position ?>" <?= $on ?> >
 
 
311
  <?php
312
  if ( isset( $othersettings['select_styles_issue'] ) ) {
313
  ?>
new/inc/class-ht-ctc-register.php CHANGED
@@ -22,7 +22,16 @@ class HT_CTC_Register {
22
  }
23
 
24
  // add default values to options db
25
- include_once( HT_CTC_PLUGIN_DIR . '/new/admin/class-ht-ctc-db.php' );
 
 
 
 
 
 
 
 
 
26
  }
27
 
28
  // when plugin deactivate
@@ -49,8 +58,10 @@ class HT_CTC_Register {
49
  delete_option( 'ccw_options_cs' );
50
  delete_option( 'ht_ccw_ga' );
51
  delete_option( 'ht_ccw_fb' );
 
 
52
 
53
- // deletes custom styles, share, switch
54
  $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE 'ht\_ctc\_s%';" );
55
 
56
  // deletes page level settings
@@ -71,7 +82,8 @@ class HT_CTC_Register {
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
 
76
  }
77
  }
22
  }
23
 
24
  // add default values to options db
25
+ // class-ht-ctc-db2.php - will call add ctc admin pages.
26
+ include_once HT_CTC_PLUGIN_DIR . '/new/admin/db/class-ht-ctc-db.php';
27
+ }
28
+
29
+ // version_changed
30
+ public static function version_changed() {
31
+
32
+ // add default values to options db
33
+ include_once HT_CTC_PLUGIN_DIR . '/new/admin/db/class-ht-ctc-db.php';
34
+ include_once HT_CTC_PLUGIN_DIR . '/new/admin/db/class-ht-ctc-db2.php';
35
  }
36
 
37
  // when plugin deactivate
58
  delete_option( 'ccw_options_cs' );
59
  delete_option( 'ht_ccw_ga' );
60
  delete_option( 'ht_ccw_fb' );
61
+ delete_option( 'ht_ctc_admin_pages' );
62
+ delete_option( 'ht_ctc_cs_options' );
63
 
64
+ // deletes custom styles, ht_ctc_share, ht_ctc_switch
65
  $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name LIKE 'ht\_ctc\_s%';" );
66
 
67
  // deletes page level settings
82
 
83
  if ( !isset($ht_ctc_plugin_details['version']) || HT_CTC_VERSION !== $ht_ctc_plugin_details['version'] ) {
84
  // to update the plugin - just like activate plugin
85
+ // self::activate();
86
+ self::version_changed();
87
 
88
  }
89
  }
new/inc/commons/position-to-place.php CHANGED
@@ -8,7 +8,7 @@
8
  $position_type = apply_filters( 'ht_ctc_fh_position_type', 'fixed', $options );
9
  $position_type_mobile = apply_filters( 'ht_ctc_fh_position_type_mobile', 'fixed', $options );
10
 
11
- // Dekstop position
12
  $side_1 = esc_attr( $options['side_1'] );
13
  $side_1_value = esc_attr( $options['side_1_value'] );
14
  $side_2 = esc_attr( $options['side_2'] );
@@ -18,18 +18,24 @@ $side_2_value = esc_attr( $options['side_2_value'] );
18
 
19
  $position = "position: $position_type; $side_1: $side_1_value; $side_2: $side_2_value;";
20
 
21
- // Mobile position
22
- $mobile_side_1 = ( isset( $options['mobile_side_1']) ) ? esc_attr( $options['mobile_side_1'] ) : '';
23
- $mobile_side_1_value = ( isset( $options['mobile_side_1_value'])) ? esc_attr( $options['mobile_side_1_value'] ) : '';
24
- $mobile_side_2 = ( isset( $options['mobile_side_2']) ) ? esc_attr( $options['mobile_side_2'] ) : '';
25
- $mobile_side_2 = apply_filters( 'ht_ctc_fh_mobile_side_2', $mobile_side_2 );
26
- $mobile_side_2_value = ( isset( $options['mobile_side_2_value'])) ? esc_attr( $options['mobile_side_2_value'] ) : '';
27
 
28
- $position_mobile = "position: $position_type_mobile; $mobile_side_1: $mobile_side_1_value; $mobile_side_2: $mobile_side_2_value;";
29
 
30
- // incase mobile position is null; - safeside can remove this later as db is handling the version updates
31
- if ( '' == $mobile_side_1_value && '' == $mobile_side_2_value ) {
32
  $position_mobile = $position;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  }
34
 
35
  // wp_is_mobile way of position (amp may need this)
8
  $position_type = apply_filters( 'ht_ctc_fh_position_type', 'fixed', $options );
9
  $position_type_mobile = apply_filters( 'ht_ctc_fh_position_type_mobile', 'fixed', $options );
10
 
11
+ // desktop position
12
  $side_1 = esc_attr( $options['side_1'] );
13
  $side_1_value = esc_attr( $options['side_1_value'] );
14
  $side_2 = esc_attr( $options['side_2'] );
18
 
19
  $position = "position: $position_type; $side_1: $side_1_value; $side_2: $side_2_value;";
20
 
 
 
 
 
 
 
21
 
 
22
 
23
+ if ( isset($options['same_settings']) ) {
 
24
  $position_mobile = $position;
25
+ } else {
26
+ // Mobile position
27
+ $mobile_side_1 = ( isset( $options['mobile_side_1']) ) ? esc_attr( $options['mobile_side_1'] ) : '';
28
+ $mobile_side_1_value = ( isset( $options['mobile_side_1_value'])) ? esc_attr( $options['mobile_side_1_value'] ) : '';
29
+ $mobile_side_2 = ( isset( $options['mobile_side_2']) ) ? esc_attr( $options['mobile_side_2'] ) : '';
30
+ $mobile_side_2 = apply_filters( 'ht_ctc_fh_mobile_side_2', $mobile_side_2 );
31
+ $mobile_side_2_value = ( isset( $options['mobile_side_2_value'])) ? esc_attr( $options['mobile_side_2_value'] ) : '';
32
+
33
+ $position_mobile = "position: $position_type_mobile; $mobile_side_1: $mobile_side_1_value; $mobile_side_2: $mobile_side_2_value;";
34
+
35
+ // incase mobile position is null; - safeside can remove this later as db is handling the version updates
36
+ if ( '' == $mobile_side_1_value && '' == $mobile_side_2_value ) {
37
+ $position_mobile = $position;
38
+ }
39
  }
40
 
41
  // wp_is_mobile way of position (amp may need this)
new/inc/commons/show-hide.php CHANGED
@@ -4,195 +4,290 @@
4
  * @included from - class-ht-ctc-{chat/group/share}.php
5
  *
6
  * sets $display - yes to show styles or no to hide styles
 
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) exit;
10
 
11
  $this_page_id = get_the_ID();
12
 
13
-
14
  // yes to display style and no to hide styles
15
  // @uses at 'class-ht-ctc-{chat/group/share}.php'
16
  $display = 'yes';
17
 
 
 
 
 
 
 
18
 
19
- // show / hide
20
- if ( 'show' == $options['show_or_hide'] ) {
21
- // show based no
22
 
23
- // in show - default display is no
 
 
 
 
 
24
  $display = 'no';
25
 
26
- $pages_list_toshow = (isset($options['list_showon_pages'])) ? esc_html($options['list_showon_pages']) : '';
27
- $pages_list_toshow_array = explode(',', $pages_list_toshow);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
- // based on post id's (is_singular maybe better)
30
- if( is_single() || is_page() ) {
31
  if ( is_array($pages_list_toshow_array) && $pages_list_toshow_array[0] ) {
32
  if ( in_array( $this_page_id, $pages_list_toshow_array ) ) {
33
  $display = 'yes';
34
  return;
35
  }
36
  }
37
- }
38
 
39
- // is_single (post type: posts or other, but not pages )
40
- if ( is_single() && isset( $options['showon_posts'] ) ) {
41
- $display = 'yes';
42
- return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  }
44
-
45
- // post type: page (but not home/front page)
46
- if ( is_page() && isset( $options['showon_page'] ) ) {
47
- if ( ( !is_home() ) && ( !is_front_page() ) ) {
48
- $display = 'yes';
 
49
  return;
50
  }
51
  }
52
-
 
 
 
 
 
 
53
  // is_home and is_front_page - combined.
54
- if ( ( is_home() || is_front_page() ) && ( isset( $options['showon_homepage'] ) ) ) {
55
- $display = 'yes';
56
- return;
57
- }
58
-
59
-
60
- if ( is_category() && isset( $options['showon_category'] ) ) {
61
- $display = 'yes';
62
- return;
63
- }
64
-
65
- if ( is_archive() && isset( $options['showon_archive'] ) ) {
66
- $display = 'yes';
67
- return;
68
- }
69
-
70
- if ( is_404() && isset( $options['showon_404'] ) ) {
71
- $display = 'yes';
72
- return;
73
  }
74
 
75
- // show on woocommerce single product pages.
76
- if ( isset( $options['showon_wooproduct'] ) ) {
77
- if ( function_exists( 'is_product' ) ) {
78
- if ( is_product() ) {
79
- $display = 'yes';
80
- return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  }
82
  }
83
- }
84
-
85
-
86
- // Hide styles on this catergorys - list
87
- $list_showon_cat = esc_html( $options['list_showon_cat'] );
88
-
89
- // avoid calling foreach, explode when hide on categorys list is empty
90
- if( $list_showon_cat ) {
91
-
92
- // Get current post Categorys list and create an array for that..
93
- $current_categorys_array = array();
94
- $current_categorys = get_the_category();
95
- foreach ( $current_categorys as $category ) {
96
- $current_categorys_array[] = strtolower($category->name);
97
  }
98
-
99
- $list_showon_cat_array = explode(',', $list_showon_cat);
100
-
101
- foreach ( $list_showon_cat_array as $category ) {
102
- $category_trim = trim($category);
103
- if ( in_array( strtolower($category_trim), $current_categorys_array ) ) {
104
- $display = 'yes';
105
- return;
106
  }
107
  }
108
- }
109
 
110
- } else {
111
 
112
- // hide based on
 
 
113
 
114
- // in hide - default display is yes
115
- $display = 'yes';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
 
 
117
 
118
- $pages_list_tohide = (isset($options['list_hideon_pages'])) ? esc_html($options['list_hideon_pages']) : '';
119
- $pages_list_tohide_array = explode(',', $pages_list_tohide);
120
 
121
- if( ( is_single() || is_page() ) ) {
122
- if( is_array($pages_list_tohide_array) && $pages_list_tohide_array[0] ) {
123
- if( in_array( $this_page_id, $pages_list_tohide_array ) ) {
124
  $display = 'no';
125
  return;
126
  }
127
  }
128
- }
129
-
130
- if ( is_single() && isset( $options['hideon_posts'] ) ) {
131
- $display = 'no';
132
- return;
133
- }
134
-
135
- if ( is_page() && isset( $options['hideon_page'] ) ) {
136
- if ( ( !is_home() ) && ( !is_front_page() ) ) {
137
- $display = 'no';
138
- return;
139
- }
140
- }
141
-
142
-
143
- // is_home and is_front_page - combined.
144
- if ( ( is_home() || is_front_page() ) && ( isset( $options['hideon_homepage'] ) ) ) {
145
- $display = 'no';
146
- return;
147
- }
148
-
149
- if ( is_category() && isset( $options['hideon_category'] ) ) {
150
- $display = 'no';
151
- return;
152
- }
153
-
154
- if ( is_archive() && isset( $options['hideon_archive'] ) ) {
155
- $display = 'no';
156
- return;
157
- }
158
-
159
- if ( is_404() && isset( $options['hideon_404'] ) ) {
160
- $display = 'no';
161
- return;
162
- }
163
-
164
- // hide on woocommerce single product pages.
165
- if ( isset( $options['hideon_wooproduct'] ) ) {
166
- if ( function_exists( 'is_product' ) ) {
167
- if ( is_product() ) {
168
  $display = 'no';
169
- return;
170
  }
171
  }
 
172
  }
173
 
174
- // Hide styles on this catergorys - list
175
- $list_hideon_cat = esc_html( $options['list_hideon_cat'] );
176
-
177
- // avoid calling foreach, explode when hide on categorys list is empty
178
- if( $list_hideon_cat ) {
179
-
180
- // Get current post Categorys list and create an array for that..
181
- $current_categorys_array = array();
182
- $current_categorys = get_the_category();
183
- foreach ( $current_categorys as $category ) {
184
- $current_categorys_array[] = strtolower($category->name);
185
  }
 
186
 
187
- $list_hideon_cat_array = explode(',', $list_hideon_cat);
188
 
189
- foreach ( $list_hideon_cat_array as $category ) {
190
- $category_trim = trim($category);
191
- if ( in_array( strtolower($category_trim), $current_categorys_array ) ) {
192
- $display = 'no';
193
- return;
194
- }
195
- }
196
- }
197
-
198
  }
4
  * @included from - class-ht-ctc-{chat/group/share}.php
5
  *
6
  * sets $display - yes to show styles or no to hide styles
7
+ * @updated 3.3.3
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit;
11
 
12
  $this_page_id = get_the_ID();
13
 
 
14
  // yes to display style and no to hide styles
15
  // @uses at 'class-ht-ctc-{chat/group/share}.php'
16
  $display = 'yes';
17
 
18
+ $display_fallback = array('global_display'=>'show');
19
+
20
+ $display_settings = (isset($options['display'])) ? $options['display'] : $display_fallback;
21
+
22
+ $post_type = get_post_type();
23
+
24
 
 
 
 
25
 
26
+ $show_or_hide = (isset($display_settings['global_display'])) ? esc_html($display_settings['global_display']) : 'show';
27
+
28
+
29
+ // new way..
30
+ if ( 'hide' == $show_or_hide ) {
31
+ // global value: hide on all pages
32
  $display = 'no';
33
 
34
+ // if any page override to show
35
+
36
+ // is_home and is_front_page - combined.
37
+ if ( is_home() || is_front_page() ) {
38
+ if ( isset( $display_settings['home'] ) && 'show' == $display_settings['home'] ) {
39
+ $display = 'yes';
40
+ return;
41
+ }
42
+ }
43
+
44
+
45
+ if ( is_singular() ) {
46
+ // singular post .. any post type, single page
47
+
48
+
49
+ // is_single (post type: posts or other(custom post type or so ..), but not pages )
50
+ if ( is_single() ) {
51
+
52
+ if ( 'post' == $post_type ) {
53
+ // post type: post (singular page)
54
+ if ( isset( $display_settings['posts'] ) && 'show' == $display_settings['posts'] ) {
55
+ $display = 'yes';
56
+ return;
57
+ }
58
+ } else {
59
+ // custom post type
60
+ $custom_post_types = get_post_types( array('public' => true, '_builtin' => false) );
61
+ unset($custom_post_types['product']);
62
+
63
+ if ( !empty($custom_post_types ) ) {
64
+ if ( in_array( $post_type, $custom_post_types ) ) {
65
+ if ( isset( $display_settings[$post_type] ) && 'show' == $display_settings[$post_type] ) {
66
+ $display = 'yes';
67
+ return;
68
+ }
69
+ }
70
+ }
71
+
72
+ }
73
+ }
74
+
75
+ // post type: page (but not home/front page)
76
+ if ( is_page() ) {
77
+ if ( ( !is_home() ) && ( !is_front_page() ) ) {
78
+ if ( isset( $display_settings['pages'] ) && 'show' == $display_settings['pages'] ) {
79
+ $display = 'yes';
80
+ return;
81
+ }
82
+ }
83
+ }
84
+
85
+ // woocommerce single product pages.
86
+ if ( class_exists( 'WooCommerce' ) && function_exists( 'is_product' ) ) {
87
+ if ( is_product() ) {
88
+ if ( isset( $display_settings['woo_product'] ) && 'show' == $display_settings['woo_product'] ) {
89
+ $display = 'yes';
90
+ return;
91
+ }
92
+ }
93
+ }
94
+
95
+ // based on post id's
96
+ $pages_list_toshow = (isset($display_settings['list_showon_pages'])) ? esc_html($display_settings['list_showon_pages']) : '';
97
+ $pages_list_toshow_array = explode(',', $pages_list_toshow);
98
 
 
 
99
  if ( is_array($pages_list_toshow_array) && $pages_list_toshow_array[0] ) {
100
  if ( in_array( $this_page_id, $pages_list_toshow_array ) ) {
101
  $display = 'yes';
102
  return;
103
  }
104
  }
 
105
 
106
+ // based on catergorys - list
107
+ $list_showon_cat = esc_html( $display_settings['list_showon_cat'] );
108
+
109
+ // avoid calling foreach, explode when hide on categorys list is empty
110
+ if( $list_showon_cat ) {
111
+
112
+ // Get current post Categorys list and create an array for that..
113
+ $current_categorys_array = array();
114
+ $current_categorys = get_the_category();
115
+ foreach ( $current_categorys as $category ) {
116
+ $current_categorys_array[] = strtolower($category->name);
117
+ }
118
+
119
+ $list_showon_cat_array = explode(',', $list_showon_cat);
120
+
121
+ foreach ( $list_showon_cat_array as $category ) {
122
+ $category_trim = trim($category);
123
+ if ( in_array( strtolower($category_trim), $current_categorys_array ) ) {
124
+ $display = 'yes';
125
+ return;
126
+ }
127
+ }
128
+ }
129
+ } elseif ( is_archive() ) {
130
+ // loop posts
131
+
132
+ // category
133
+ if ( is_category() ) {
134
+ if ( isset( $display_settings['category'] ) && 'show' == $display_settings['category'] ) {
135
+ $display = 'yes';
136
+ return;
137
+ }
138
+ }
139
+
140
+ // archive
141
+ if ( is_archive() ) {
142
+ if ( isset( $display_settings['archive'] ) && 'show' == $display_settings['archive'] ) {
143
+ $display = 'yes';
144
+ return;
145
+ }
146
+ }
147
  }
148
+
149
+
150
+ // 404 page
151
+ if ( is_404() ) {
152
+ if ( isset( $display_settings['page_404'] ) && 'show' == $display_settings['page_404'] ) {
153
+ $display = 'yes';
154
  return;
155
  }
156
  }
157
+
158
+ } else {
159
+ // global value: show on all pages
160
+ $display = 'yes';
161
+
162
+ // if any page override to hide
163
+
164
  // is_home and is_front_page - combined.
165
+ if ( is_home() || is_front_page() ) {
166
+ if ( isset( $display_settings['home'] ) && 'hide' == $display_settings['home'] ) {
167
+ $display = 'no';
168
+ return;
169
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
  }
171
 
172
+ if ( is_singular() ) {
173
+ // singular post .. any post type, single page
174
+
175
+ // is_single (post type: posts or other(custom post type or so ..), but not pages )
176
+ if ( is_single() ) {
177
+
178
+ if ( 'post' == $post_type ) {
179
+
180
+ if ( isset( $display_settings['posts'] ) && 'hide' == $display_settings['posts'] ) {
181
+ $display = 'no';
182
+ return;
183
+ }
184
+ } else {
185
+ // custom post type (but not woo single product pages)
186
+
187
+ $custom_post_types = get_post_types( array('public' => true, '_builtin' => false) );
188
+ unset($custom_post_types['product']);
189
+
190
+ if ( !empty($custom_post_types ) ) {
191
+ if ( in_array( $post_type, $custom_post_types ) ) {
192
+ if ( isset( $display_settings[$post_type] ) && 'hide' == $display_settings[$post_type] ) {
193
+ $display = 'yes';
194
+ return;
195
+ }
196
+ }
197
+ }
198
+
199
  }
200
  }
201
+
202
+ // page
203
+ if ( is_page() ) {
204
+ if ( ( !is_home() ) && ( !is_front_page() ) ) {
205
+ if ( isset( $display_settings['pages'] ) && 'hide' == $display_settings['pages'] ) {
206
+ $display = 'no';
207
+ return;
208
+ }
209
+ }
 
 
 
 
 
210
  }
211
+
212
+ // woocommerce single product pages.
213
+ if ( class_exists( 'WooCommerce' ) && function_exists( 'is_product' ) ) {
214
+ if ( is_product() ) {
215
+ if ( isset( $display_settings['woo_product'] ) && 'hide' == $display_settings['woo_product'] ) {
216
+ $display = 'no';
217
+ return;
218
+ }
219
  }
220
  }
 
221
 
222
+
223
 
224
+ // based on post id's'
225
+ $pages_list_tohide = (isset($display_settings['list_hideon_pages'])) ? esc_html($display_settings['list_hideon_pages']) : '';
226
+ $pages_list_tohide_array = explode(',', $pages_list_tohide);
227
 
228
+ if( ( is_single() || is_page() ) ) {
229
+ if( is_array($pages_list_tohide_array) && $pages_list_tohide_array[0] ) {
230
+ if( in_array( $this_page_id, $pages_list_tohide_array ) ) {
231
+ $display = 'no';
232
+ return;
233
+ }
234
+ }
235
+ }
236
+
237
+ // Hide styles on this catergorys - list
238
+ $list_hideon_cat = esc_html( $display_settings['list_hideon_cat'] );
239
+
240
+ // avoid calling foreach, explode when hide on categorys list is empty
241
+ if( $list_hideon_cat ) {
242
+
243
+ // Get current post Categorys list and create an array for that..
244
+ $current_categorys_array = array();
245
+ $current_categorys = get_the_category();
246
+ foreach ( $current_categorys as $category ) {
247
+ $current_categorys_array[] = strtolower($category->name);
248
+ }
249
+
250
+ $list_hideon_cat_array = explode(',', $list_hideon_cat);
251
+
252
+ foreach ( $list_hideon_cat_array as $category ) {
253
+ $category_trim = trim($category);
254
+ if ( in_array( strtolower($category_trim), $current_categorys_array ) ) {
255
+ $display = 'no';
256
+ return;
257
+ }
258
+ }
259
+ }
260
 
261
+
262
 
263
+ } elseif ( is_archive() ) {
264
+ // loop posts
265
 
266
+ // category
267
+ if ( is_category() ) {
268
+ if ( isset( $display_settings['category'] ) && 'hide' == $display_settings['category'] ) {
269
  $display = 'no';
270
  return;
271
  }
272
  }
273
+
274
+ // archive
275
+ if ( is_archive() ) {
276
+ if ( isset( $display_settings['archive'] ) && 'hide' == $display_settings['archive'] ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
277
  $display = 'no';
278
+ return;
279
  }
280
  }
281
+
282
  }
283
 
284
+ // 404 page
285
+ if ( is_404() ) {
286
+ if ( isset( $display_settings['page_404'] ) && 'hide' == $display_settings['page_404'] ) {
287
+ $display = 'no';
288
+ return;
 
 
 
 
 
 
289
  }
290
+ }
291
 
 
292
 
 
 
 
 
 
 
 
 
 
293
  }
new/inc/group/class-ht-ctc-group-shortcode.php CHANGED
@@ -31,12 +31,16 @@ class HT_CTC_Group_Shortcode {
31
  $group_id = __( $group_id , 'click-to-chat-for-whatsapp' );
32
  $call_to_action = __( $call_to_action_db , 'click-to-chat-for-whatsapp' );
33
 
34
- $style_desktop = esc_attr( $options['style_desktop'] );
35
- $style_mobile = esc_attr( $options['style_mobile'] );
 
 
 
 
36
 
37
  $is_mobile = ht_ctc()->device_type->is_mobile();
38
 
39
- $style = $style_desktop;;
40
  if ( 'yes' == $is_mobile ) {
41
  $style = $style_mobile;
42
  }
31
  $group_id = __( $group_id , 'click-to-chat-for-whatsapp' );
32
  $call_to_action = __( $call_to_action_db , 'click-to-chat-for-whatsapp' );
33
 
34
+ $style_desktop = (isset($options['style_desktop'])) ? esc_attr($options['style_desktop']) : '2';
35
+ if (isset($options['same_settings'])) {
36
+ $style_mobile = $style_desktop;
37
+ } else {
38
+ $style_mobile = (isset($options['style_mobile'])) ? esc_attr($options['style_mobile']) : '2';
39
+ }
40
 
41
  $is_mobile = ht_ctc()->device_type->is_mobile();
42
 
43
+ $style = $style_desktop;
44
  if ( 'yes' == $is_mobile ) {
45
  $style = $style_mobile;
46
  }
new/inc/group/class-ht-ctc-group.php CHANGED
@@ -49,8 +49,12 @@ class HT_CTC_Group {
49
  $is_mobile = ht_ctc()->device_type->is_mobile();
50
 
51
  // style
52
- $ht_ctc_group['style_desktop'] = esc_attr( $options['style_desktop'] );
53
- $ht_ctc_group['style_mobile'] = esc_attr( $options['style_mobile'] );
 
 
 
 
54
 
55
  // position
56
  include HT_CTC_PLUGIN_DIR .'new/inc/commons/position-to-place.php';
@@ -74,8 +78,8 @@ class HT_CTC_Group {
74
  $ht_ctc_group['group_id'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_group['group_id'], 'Click to Chat for WhatsApp', 'group_id__group' );
75
 
76
 
77
- $ht_ctc_group['display_mobile'] = (isset($options['hideon_mobile'])) ? 'hide' : 'show';
78
- $ht_ctc_group['display_desktop'] = (isset($options['hideon_desktop'])) ? 'hide' : 'show';
79
 
80
 
81
 
49
  $is_mobile = ht_ctc()->device_type->is_mobile();
50
 
51
  // style
52
+ $ht_ctc_group['style_desktop'] = (isset($options['style_desktop'])) ? esc_attr($options['style_desktop']) : '2';
53
+ if (isset($options['same_settings'])) {
54
+ $ht_ctc_group['style_mobile'] = $ht_ctc_group['style_desktop'];
55
+ } else {
56
+ $ht_ctc_group['style_mobile'] = (isset($options['style_mobile'])) ? esc_attr($options['style_mobile']) : '2';
57
+ }
58
 
59
  // position
60
  include HT_CTC_PLUGIN_DIR .'new/inc/commons/position-to-place.php';
78
  $ht_ctc_group['group_id'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_group['group_id'], 'Click to Chat for WhatsApp', 'group_id__group' );
79
 
80
 
81
+ $ht_ctc_group['display_mobile'] = (isset($options['display_mobile'])) ? esc_attr($options['display_mobile']) : 'show';
82
+ $ht_ctc_group['display_desktop'] = (isset($options['display_desktop'])) ? esc_attr($options['display_desktop']) : 'show';
83
 
84
 
85
 
new/inc/share/class-ht-ctc-share-shortcode.php CHANGED
@@ -31,12 +31,16 @@ class HT_CTC_Share_Shortcode {
31
  $share_text = __( $share_text_db , 'click-to-chat-for-whatsapp' );
32
  $call_to_action = __( $call_to_action_db , 'click-to-chat-for-whatsapp' );
33
 
34
- $style_desktop = esc_attr( $options['style_desktop'] );
35
- $style_mobile = esc_attr( $options['style_mobile'] );
 
 
 
 
36
 
37
  $is_mobile = ht_ctc()->device_type->is_mobile();
38
 
39
- $style = $style_desktop;;
40
  if ( 'yes' == $is_mobile ) {
41
  $style = $style_mobile;
42
  }
31
  $share_text = __( $share_text_db , 'click-to-chat-for-whatsapp' );
32
  $call_to_action = __( $call_to_action_db , 'click-to-chat-for-whatsapp' );
33
 
34
+ $style_desktop = (isset($options['style_desktop'])) ? esc_attr($options['style_desktop']) : '2';
35
+ if (isset($options['same_settings'])) {
36
+ $style_mobile = $style_desktop;
37
+ } else {
38
+ $style_mobile = (isset($options['style_mobile'])) ? esc_attr($options['style_mobile']) : '2';
39
+ }
40
 
41
  $is_mobile = ht_ctc()->device_type->is_mobile();
42
 
43
+ $style = $style_desktop;
44
  if ( 'yes' == $is_mobile ) {
45
  $style = $style_mobile;
46
  }
new/inc/share/class-ht-ctc-share.php CHANGED
@@ -59,8 +59,12 @@ class HT_CTC_Share {
59
  $is_mobile = ht_ctc()->device_type->is_mobile();
60
 
61
  // style
62
- $ht_ctc_share['style_desktop'] = esc_attr( $options['style_desktop'] );
63
- $ht_ctc_share['style_mobile'] = esc_attr( $options['style_mobile'] );
 
 
 
 
64
 
65
  // position
66
  include HT_CTC_PLUGIN_DIR .'new/inc/commons/position-to-place.php';
@@ -91,8 +95,8 @@ class HT_CTC_Share {
91
  $ht_ctc_share['webandapi'] = 'webapi';
92
  }
93
 
94
- $ht_ctc_share['display_mobile'] = (isset($options['hideon_mobile'])) ? 'hide' : 'show';
95
- $ht_ctc_share['display_desktop'] = (isset($options['hideon_desktop'])) ? 'hide' : 'show';
96
 
97
  $ht_ctc_share['css'] = "display: none; cursor: pointer; z-index: 99999999;";
98
 
59
  $is_mobile = ht_ctc()->device_type->is_mobile();
60
 
61
  // style
62
+ $ht_ctc_share['style_desktop'] = (isset($options['style_desktop'])) ? esc_attr($options['style_desktop']) : '2';
63
+ if (isset($options['same_settings'])) {
64
+ $ht_ctc_share['style_mobile'] = $ht_ctc_share['style_desktop'];
65
+ } else {
66
+ $ht_ctc_share['style_mobile'] = (isset($options['style_mobile'])) ? esc_attr($options['style_mobile']) : '2';
67
+ }
68
 
69
  // position
70
  include HT_CTC_PLUGIN_DIR .'new/inc/commons/position-to-place.php';
95
  $ht_ctc_share['webandapi'] = 'webapi';
96
  }
97
 
98
+ $ht_ctc_share['display_mobile'] = (isset($options['display_mobile'])) ? esc_attr($options['display_mobile']) : 'show';
99
+ $ht_ctc_share['display_desktop'] = (isset($options['display_desktop'])) ? esc_attr($options['display_desktop']) : 'show';
100
 
101
  $ht_ctc_share['css'] = "display: none; cursor: pointer; z-index: 99999999;";
102
 
new/inc/styles/style-2.php CHANGED
@@ -4,6 +4,15 @@
4
  *
5
  * Andriod like - WhatsApp icon
6
  *
 
 
 
 
 
 
 
 
 
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) exit;
@@ -21,7 +30,7 @@ if ( '' == $img_size ) {
21
  $s2_cta_type = (isset( $s2_options['cta_type'])) ? esc_attr( $s2_options['cta_type'] ) : 'hover';
22
 
23
  $s2_cta_order = "1";
24
- if ('right' == $side_2) {
25
  // if side_2 is right then cta is left
26
  $s2_cta_order = "0";
27
  }
4
  *
5
  * Andriod like - WhatsApp icon
6
  *
7
+ *
8
+ * @included from
9
+ * class-ht-ctc-chat.php (class-ht-ctc- chat/group/share .php)
10
+ * class-ht-ctc-woo.php
11
+ *
12
+ * External variable are from included files:
13
+ * $call_to_action
14
+ * $type
15
+ * $side_2 (sub file: position-to-place.php is included in some of the files that included this file )
16
  */
17
 
18
  if ( ! defined( 'ABSPATH' ) ) exit;
30
  $s2_cta_type = (isset( $s2_options['cta_type'])) ? esc_attr( $s2_options['cta_type'] ) : 'hover';
31
 
32
  $s2_cta_order = "1";
33
+ if ( isset($side_2) && 'right' == $side_2) {
34
  // if side_2 is right then cta is left
35
  $s2_cta_order = "0";
36
  }
new/inc/styles/style-3.php CHANGED
@@ -27,7 +27,7 @@ if ( function_exists('is_rtl') && is_rtl() ) {
27
  }
28
 
29
  $s3_cta_order = "1";
30
- if ('right' == $side_2) {
31
  // if side_2 is right then cta is left
32
  $s3_cta_order = "0";
33
  }
27
  }
28
 
29
  $s3_cta_order = "1";
30
+ if ( isset($side_2) && 'right' == $side_2) {
31
  // if side_2 is right then cta is left
32
  $s3_cta_order = "0";
33
  }
new/inc/styles/style-3_1.php CHANGED
@@ -18,7 +18,7 @@ if ( '' == $img_size ) {
18
  $s3_1_cta_type = (isset( $s3_1_options['cta_type'])) ? esc_attr( $s3_1_options['cta_type'] ) : 'hover';
19
 
20
  $s3_1_cta_order = "1";
21
- if ('right' == $side_2) {
22
  // if side_2 is right then cta is left
23
  $s3_1_cta_order = "0";
24
  }
18
  $s3_1_cta_type = (isset( $s3_1_options['cta_type'])) ? esc_attr( $s3_1_options['cta_type'] ) : 'hover';
19
 
20
  $s3_1_cta_order = "1";
21
+ if ( isset($side_2) && 'right' == $side_2) {
22
  // if side_2 is right then cta is left
23
  $s3_1_cta_order = "0";
24
  }
new/inc/styles/style-7.php CHANGED
@@ -29,9 +29,9 @@ if ( function_exists('is_rtl') && is_rtl() ) {
29
  $s7_n1_styles = "display:flex;justify-content:center;align-items:center;$rtl_css ";
30
  $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;";
31
 
32
- // Call to action
33
  $s7_cta_order = "1";
34
- if ('right' == $side_2) {
35
  // if side_2 is right then cta is left
36
  $s7_cta_order = "0";
37
  }
@@ -58,14 +58,6 @@ $s7_svg_attrs = array(
58
  'ht_ctc_svg_css' => "$ht_ctc_svg_css",
59
  );
60
 
61
- // cta order
62
- $s7_cta_order = "1";
63
- if ('right' == $side_2) {
64
- // if side_2 is right then cta is left
65
- $s7_cta_order = "0";
66
- }
67
-
68
-
69
  // hover
70
  $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;}";
71
 
29
  $s7_n1_styles = "display:flex;justify-content:center;align-items:center;$rtl_css ";
30
  $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;";
31
 
32
+ // Call to action - order
33
  $s7_cta_order = "1";
34
+ if ( isset($side_2) && 'right' == $side_2) {
35
  // if side_2 is right then cta is left
36
  $s7_cta_order = "0";
37
  }
58
  'ht_ctc_svg_css' => "$ht_ctc_svg_css",
59
  );
60
 
 
 
 
 
 
 
 
 
61
  // hover
62
  $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;}";
63
 
new/inc/styles/style-7_1.php CHANGED
@@ -35,7 +35,7 @@ $s7_cta_type = (isset( $s7_1_options['cta_type'])) ? esc_attr( $s7_1_options['ct
35
  $s7_cta_order = "1";
36
  $s7_hover_cta_padding_css = "padding-right: 21px;";
37
  $s7_show_cta_padding_css = "padding:5px 5px 5px 20px;";
38
- if ('right' == $side_2) {
39
  // if side_2 is right then cta is left
40
  $s7_cta_order = "0";
41
  $s7_hover_cta_padding_css = "padding-left: 21px;";
@@ -81,12 +81,6 @@ $s7_svg_attrs = array(
81
  'ht_ctc_svg_css' => "$ht_ctc_svg_css",
82
  );
83
 
84
- // cta order
85
- $s7_cta_order = "1";
86
- if ('right' == $side_2) {
87
- // if side_2 is right then cta is left
88
- $s7_cta_order = "0";
89
- }
90
 
91
  include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/ht-ctc-svg-images.php';
92
  ?>
35
  $s7_cta_order = "1";
36
  $s7_hover_cta_padding_css = "padding-right: 21px;";
37
  $s7_show_cta_padding_css = "padding:5px 5px 5px 20px;";
38
+ if ( isset($side_2) && 'right' == $side_2) {
39
  // if side_2 is right then cta is left
40
  $s7_cta_order = "0";
41
  $s7_hover_cta_padding_css = "padding-left: 21px;";
81
  'ht_ctc_svg_css' => "$ht_ctc_svg_css",
82
  );
83
 
 
 
 
 
 
 
84
 
85
  include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/ht-ctc-svg-images.php';
86
  ?>
new/tools/woo/class-ht-ctc-admin-woo.php DELETED
@@ -1,84 +0,0 @@
1
- <?php
2
- /**
3
- * woocommerce related setting at chat settings page
4
- *
5
- * @package ctc
6
- * @subpackage admin
7
- * @since 2.9
8
- */
9
-
10
- if ( ! defined( 'ABSPATH' ) ) exit;
11
-
12
- if ( ! class_exists( 'HT_CTC_Admin_WOO' ) ) :
13
-
14
- class HT_CTC_Admin_WOO {
15
-
16
- public function __construct() {
17
- $this->woo_admin_hooks();
18
- }
19
-
20
- // Hooks
21
- function woo_admin_hooks() {
22
- add_action( 'ht_ctc_ah_admin_chat_woo_settings', array($this, 'ht_ctc_chat_settings') );
23
- }
24
-
25
-
26
-
27
- function ht_ctc_chat_settings() {
28
-
29
- $options = get_option('ht_ctc_chat_options');
30
-
31
- $woo_pre_filled = '';
32
- if ( isset( $options['woo_pre_filled'] ) ) {
33
- $woo_pre_filled = esc_attr( $options['woo_pre_filled'] );
34
- }
35
- $woo_call_to_action = '';
36
- if ( isset( $options['woo_call_to_action'] ) ) {
37
- $woo_call_to_action = esc_attr( $options['woo_call_to_action'] );
38
- }
39
- $blogname = HT_CTC_BLOG_NAME;
40
- $placeholder = "Hello $blogname!! \nName: \nLike to buy this {{product}}, {{url}}";
41
- ?>
42
-
43
- <ul class="collapsible">
44
- <li class="active">
45
- <div class="collapsible-header">WooCommerce</div>
46
- <div class="collapsible-body">
47
-
48
- <!-- prefilled message -->
49
- <div class="row">
50
- <div class="input-field col s12">
51
- <textarea name="ht_ctc_chat_options[woo_pre_filled]" id="woo_pre_filled" class="materialize-textarea input-margin" style="min-height: 84px;" placeholder="<?= $placeholder ?>"><?= $woo_pre_filled ?></textarea>
52
- <label for="woo_pre_filled">Pre-filled message</label>
53
- <p class="description">Pre-filled message for WooCommerce Single Product pages. Leave blank to get default pre-filled message.</p>
54
- <p class="description">Variables: {product}, {price}, {regular_price}, {sku}, {site}, {url}, {title} - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/woocommerce_pre-filled-message/">more info</a> </p>
55
- </div>
56
- </div>
57
-
58
- <!-- Call to Action -->
59
- <div class="row">
60
- <div class="input-field col s12">
61
- <input name="ht_ctc_chat_options[woo_call_to_action]" value="<?= $woo_call_to_action ?>" id="woo_call_to_action" type="text" class="input-margin">
62
- <label for="woo_call_to_action">Call to Action</label>
63
- <p class="description">Call-to-Action for WooCommerce Single Product pages. Leave blank to get default call-to-action - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/woocommerce_call-to-action/">more info</a> </p>
64
- </div>
65
- </div>
66
-
67
-
68
- </div>
69
- </div>
70
- </li>
71
- <ul>
72
-
73
- <?php
74
- }
75
-
76
-
77
-
78
-
79
-
80
-
81
- }
82
- new HT_CTC_Admin_WOO();
83
-
84
- endif; // END class_exists check
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
new/tools/woo/class-ht-ctc-woo.php CHANGED
@@ -20,12 +20,46 @@ class HT_CTC_Admin_WOO {
20
  function woo_hooks() {
21
 
22
  add_filter( 'ht_ctc_fh_chat', array($this, 'chat') );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  }
24
 
25
 
26
  function chat( $ht_ctc_chat ) {
27
 
28
- $options = get_option('ht_ctc_chat_options');
 
 
29
 
30
  // if woocommerce single product page
31
  if ( function_exists( 'is_product' ) && function_exists( 'wc_get_product' )) {
@@ -40,16 +74,16 @@ class HT_CTC_Admin_WOO {
40
  $sku = $product->get_sku();
41
 
42
  // pre-filled
43
- if ( isset( $options['woo_pre_filled'] ) && '' !== $options['woo_pre_filled'] ) {
44
- $ht_ctc_chat['pre_filled'] = esc_attr( $options['woo_pre_filled'] );
45
  $ht_ctc_chat['pre_filled'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_chat['pre_filled'], 'Click to Chat for WhatsApp', 'woo_pre_filled' );
46
  }
47
- // variables now works in default pre_filled also
48
  $ht_ctc_chat['pre_filled'] = str_replace( array('{product}', '{price}', '{regular_price}', '{sku}' ), array( $name, $price, $regular_price, $sku ), $ht_ctc_chat['pre_filled'] );
49
 
50
  // call to action
51
- if ( isset( $options['woo_call_to_action'] ) && '' !== $options['woo_call_to_action'] ) {
52
- $ht_ctc_chat['call_to_action'] = esc_attr( $options['woo_call_to_action'] );
53
  $ht_ctc_chat['call_to_action'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_chat['call_to_action'], 'Click to Chat for WhatsApp', 'woo_call_to_action' );
54
  $ht_ctc_chat['call_to_action'] = str_replace( array('{product}', '{price}', '{regular_price}', '{sku}' ), array( $name, $price, $regular_price, $sku ), $ht_ctc_chat['call_to_action'] );
55
  }
20
  function woo_hooks() {
21
 
22
  add_filter( 'ht_ctc_fh_chat', array($this, 'chat') );
23
+
24
+ // add_action( 'woocommerce_after_add_to_cart_button', array( $this, 'add_styles' ) );
25
+ // add_action( 'woocommerce_after_shop_loop_item', array( $this, 'add_styles' ) );
26
+
27
+ }
28
+
29
+ function add_styles() {
30
+
31
+ $woo = get_option('ht_ctc_woo_options');
32
+ $chat = get_option('ht_ctc_chat_options');
33
+
34
+ $type = 'chat';
35
+ $style = 1;
36
+ // $side_2 = 'right';
37
+
38
+ $call_to_action = "WhatsApp us";
39
+ $space_left = '100px';
40
+ $space_right = '10px';
41
+ $space_top = '10px';
42
+ $space_bottom = '10px';
43
+
44
+ $margin_left = "margin-left: $space_left;";
45
+ $margin_right = "margin-right: $space_right;";
46
+ $margin_top = "margin-top: $space_top;";
47
+ $margin_bottom = "margin-bottom: $space_left;";
48
+
49
+ $path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style. '.php';
50
+
51
+ ?>
52
+ <!-- <button style="margin-top: 100px;">buy now from whatsapp</button> -->
53
+ <div><?php include $path; ?></div>
54
+ <?php
55
  }
56
 
57
 
58
  function chat( $ht_ctc_chat ) {
59
 
60
+ $woo_options = get_option('ht_ctc_woo_options');
61
+
62
+ // $chat = get_option('ht_ctc_chat_options');
63
 
64
  // if woocommerce single product page
65
  if ( function_exists( 'is_product' ) && function_exists( 'wc_get_product' )) {
74
  $sku = $product->get_sku();
75
 
76
  // pre-filled
77
+ if ( isset( $woo_options['woo_pre_filled'] ) && '' !== $woo_options['woo_pre_filled'] ) {
78
+ $ht_ctc_chat['pre_filled'] = esc_attr( $woo_options['woo_pre_filled'] );
79
  $ht_ctc_chat['pre_filled'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_chat['pre_filled'], 'Click to Chat for WhatsApp', 'woo_pre_filled' );
80
  }
81
+ // variables works in default pre_filled also for woo pages.
82
  $ht_ctc_chat['pre_filled'] = str_replace( array('{product}', '{price}', '{regular_price}', '{sku}' ), array( $name, $price, $regular_price, $sku ), $ht_ctc_chat['pre_filled'] );
83
 
84
  // call to action
85
+ if ( isset( $woo_options['woo_call_to_action'] ) && '' !== $woo_options['woo_call_to_action'] ) {
86
+ $ht_ctc_chat['call_to_action'] = esc_attr( $woo_options['woo_call_to_action'] );
87
  $ht_ctc_chat['call_to_action'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_chat['call_to_action'], 'Click to Chat for WhatsApp', 'woo_call_to_action' );
88
  $ht_ctc_chat['call_to_action'] = str_replace( array('{product}', '{price}', '{regular_price}', '{sku}' ), array( $name, $price, $regular_price, $sku ), $ht_ctc_chat['call_to_action'] );
89
  }
new/tools/woo/ht-ctc-woo.php CHANGED
@@ -5,13 +5,46 @@
5
  * @included from ht-ctc.php using init hook
6
  */
7
 
 
8
 
9
- if ( class_exists( 'WooCommerce' ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
- if ( is_admin() ) {
12
- include_once HT_CTC_PLUGIN_DIR .'new/tools/woo/class-ht-ctc-admin-woo.php';
13
- } else {
14
- include_once HT_CTC_PLUGIN_DIR .'new/tools/woo/class-ht-ctc-woo.php';
 
 
 
 
 
 
15
  }
16
 
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  * @included from ht-ctc.php using init hook
6
  */
7
 
8
+ if ( ! defined( 'ABSPATH' ) ) exit;
9
 
10
+ if ( ! class_exists( 'HT_CTC_WOO' ) ) :
11
+
12
+ class HT_CTC_WOO {
13
+
14
+ public function __construct() {
15
+ $this->woo_init();
16
+ }
17
+
18
+
19
+ function woo_init() {
20
+
21
+ // if woocommece plugin in active (checking this way works as now)
22
+ if ( class_exists( 'WooCommerce' ) ) {
23
 
24
+ if ( is_admin() ) {
25
+ // woo admin
26
+ // woo admin page
27
+ add_action( 'ht_ctc_ah_admin_includes_after_main_page', array($this, 'admin_page') );
28
+ } else {
29
+ // woo public
30
+ include_once HT_CTC_PLUGIN_DIR .'new/tools/woo/class-ht-ctc-woo.php';
31
+ }
32
+
33
+ }
34
  }
35
 
36
+ function admin_page() {
37
+
38
+ include_once HT_CTC_PLUGIN_DIR .'new/tools/woo/woo-admin/class-ht-ctc-admin-woo-page.php';
39
+
40
+ }
41
+
42
+
43
+
44
+
45
+
46
+ }
47
+
48
+ new HT_CTC_WOO();
49
+
50
+ endif; // END class_exists check
new/tools/woo/woo-admin/class-ht-ctc-admin-woo-page.php ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WooCommerce settings page - admin
4
+ *
5
+ * @package ctc
6
+ * @subpackage admin
7
+ * @since 3.3.3
8
+ */
9
+
10
+ if ( ! defined( 'ABSPATH' ) ) exit;
11
+
12
+ if ( ! class_exists( 'HT_CTC_Admin_Woo_Page' ) ) :
13
+
14
+ class HT_CTC_Admin_Woo_Page {
15
+
16
+ public function __construct() {
17
+ $this->start();
18
+ }
19
+
20
+ function start() {
21
+ add_action('admin_menu', array($this, 'menu') );
22
+ add_action('admin_init', array($this, 'settings') );
23
+ }
24
+
25
+ public function menu() {
26
+
27
+ // dashicons-format-chat / dashicons-whatsapp
28
+ $icon = 'dashicons-whatsapp';
29
+ if( version_compare( get_bloginfo('version'), '5.6', '<') ) {
30
+ $icon = 'dashicons-format-chat';
31
+ }
32
+
33
+ add_submenu_page(
34
+ 'click-to-chat',
35
+ 'WooCommerce page',
36
+ 'WooCommerce',
37
+ 'manage_options',
38
+ 'click-to-chat-woocommerce',
39
+ array( $this, 'settings_page' )
40
+ );
41
+ }
42
+
43
+ public function settings_page() {
44
+
45
+ if ( ! current_user_can('manage_options') ) {
46
+ return;
47
+ }
48
+
49
+ ?>
50
+
51
+ <div class="wrap">
52
+
53
+ <?php settings_errors(); ?>
54
+
55
+ <!-- full row -->
56
+ <div class="row">
57
+
58
+ <div class="col s12 m12 xl7 options">
59
+ <form action="options.php" method="post" class="">
60
+ <?php settings_fields( 'ht_ctc_woo_page_settings_fields' ); ?>
61
+ <?php do_settings_sections( 'ht_ctc_woo_page_settings_sections_do' ) ?>
62
+ <?php submit_button() ?>
63
+ </form>
64
+ </div>
65
+
66
+ <!-- sidebar content -->
67
+ <div class="col s12 m12 l7 xl4 ht-ctc-admin-sidebar ht-ctc-admin-woo-sidebar sticky-sidebar">
68
+ <?php // include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-sidebar-content.php'; ?>
69
+ </div>
70
+
71
+ </div>
72
+
73
+ <!-- new row - After settings page -->
74
+ <div class="row">
75
+ </div>
76
+
77
+ </div>
78
+
79
+ <?php
80
+
81
+ }
82
+
83
+
84
+ public function settings() {
85
+
86
+ // WooCommerce chat feautes
87
+ register_setting( 'ht_ctc_woo_page_settings_fields', 'ht_ctc_woo_options' , array( $this, 'options_sanitize' ) );
88
+
89
+ add_settings_section( 'ht_ctc_woo_page_settings_sections_add', '', array( $this, 'chat_settings_section_cb' ), 'ht_ctc_woo_page_settings_sections_do' );
90
+
91
+ add_settings_field( 'woo_single_product', __( 'Single Product Pages', 'click-to-chat-for-whatsapp'), array( $this, 'woo_single_product_cb' ), 'ht_ctc_woo_page_settings_sections_do', 'ht_ctc_woo_page_settings_sections_add' );
92
+
93
+ }
94
+
95
+
96
+ public function chat_settings_section_cb() {
97
+ ?>
98
+ <h1 id="woo_settings">WooCommerce WhatsApp Chat Settings </h1>
99
+ <br>
100
+ <?php
101
+ do_action('ht_ctc_ah_admin' );
102
+ }
103
+
104
+
105
+
106
+ /**
107
+ * single product pages
108
+ *
109
+ * @var [woo_is_single] - floating style for single product pages
110
+ */
111
+ function woo_single_product_cb() {
112
+ $options = get_option('ht_ctc_woo_options');
113
+ $dbrow = 'ht_ctc_woo_options';
114
+
115
+ $chat = get_option('ht_ctc_chat_options');
116
+
117
+ // pre filled
118
+ $woo_pre_filled = ( isset( $options['woo_pre_filled']) ) ? esc_attr( $options['woo_pre_filled'] ) : '';
119
+
120
+ $pf_placeholder = "Hello {site} \nLike to buy {product}, {url}";
121
+
122
+ // call to action
123
+ $woo_call_to_action = ( isset( $options['woo_call_to_action']) ) ? esc_attr( $options['woo_call_to_action'] ) : '';
124
+
125
+ $ctc_placeholder = 'Buy {product}';
126
+
127
+ // Add styles at woo page position
128
+ $woo_position = ( isset( $options['woo_position']) ) ? esc_attr( $options['woo_position'] ) : '';
129
+ ?>
130
+
131
+ <ul class="collapsible">
132
+ <li class="active">
133
+ <div class="collapsible-header"><?php _e( 'WooCommerce', 'click-to-chat-for-whatsapp' ); ?> - <?php _e( 'Single Product Pages', 'click-to-chat-for-whatsapp' ); ?></div>
134
+ <div class="collapsible-body">
135
+
136
+ <p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/woocommerce-single-product-pages/"><?php _e( 'WooCommerce Single Product pages', 'click-to-chat-for-whatsapp' ); ?></a></p>
137
+ <!-- <p class="description">Leave blank to get values from main settings</p> -->
138
+ <br>
139
+
140
+ <!-- prefilled message -->
141
+ <div class="row">
142
+ <div class="input-field col s12">
143
+ <textarea name="ht_ctc_woo_options[woo_pre_filled]" id="woo_pre_filled" class="materialize-textarea input-margin" style="min-height: 84px;" placeholder="<?= $pf_placeholder ?>"><?= $woo_pre_filled ?></textarea>
144
+ <label for="woo_pre_filled"><?php _e( 'Pre-filled message', 'click-to-chat-for-whatsapp' ); ?></label>
145
+ <!-- <span class="helper-text" data-error="wrong" data-success="right"><?php _e( 'Leave blank to get value from main settings', 'click-to-chat-for-whatsapp' ); ?></span> -->
146
+ <!-- <p class="description">Pre-filled message for WooCommerce Single Product pages</p> -->
147
+ </div>
148
+ </div>
149
+
150
+
151
+ <!-- Call to Action -->
152
+ <div class="row">
153
+ <div class="input-field col s12">
154
+ <input name="ht_ctc_woo_options[woo_call_to_action]" value="<?= $woo_call_to_action ?>" id="woo_call_to_action" type="text" class="input-margin" placeholder="<?= $ctc_placeholder ?>">
155
+ <label for="woo_call_to_action"><?php _e( 'Call to Action', 'click-to-chat-for-whatsapp' ); ?></label>
156
+ <!-- <span class="helper-text" data-error="wrong" data-success="right"><?php _e( 'Leave blank to get value from main settings', 'click-to-chat-for-whatsapp' ); ?></span> -->
157
+ <!-- <p class="description">Call-to-Action for WooCommerce Single Product pages</p> -->
158
+ </div>
159
+ </div>
160
+
161
+ <!-- docs - prefilled, call to action .. -->
162
+ <p class="description">Variables: {product}, {price}, {regular_price}, {sku}, {site}, {url}, {title} </p>
163
+ <!-- <p class="description">Change Values for WooCommerce Single Product pages - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/woocommerce-single-product-pages/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a></p> -->
164
+ <p class="description">Leave blank to get value from main settings</p>
165
+
166
+
167
+ <!-- Add button/icon -->
168
+ <!-- <div class="row">
169
+ <div class="col s6" style="padding-top: 14px;">
170
+ <p><?php _e( 'Add Button/Icon', 'click-to-chat-for-whatsapp' ); ?></p>
171
+ </div>
172
+ <div class="input-field col s6">
173
+ <select name="<?php echo $dbrow ?>[woo_position]" class="woo_position">
174
+ <option value="select" <?php echo $woo_position == "select" ? 'SELECTED' : ''; ?> ><?php _e( 'Select', 'click-to-chat-for-whatsapp' ); ?></option>
175
+ <option value="woocommerce_before_single_product_summary" <?php echo $woo_position == "woocommerce_before_single_product_summary" ? 'SELECTED' : ''; ?> ><?php _e( 'Before Single Product', 'click-to-chat-for-whatsapp' ); ?></option>
176
+ <option value="woocommerce_after_add_to_cart_button" <?php echo $woo_position == "woocommerce_after_add_to_cart_button" ? 'SELECTED' : ''; ?> ><?php _e( 'After Cart', 'click-to-chat-for-whatsapp' ); ?></option>
177
+ <option value="woocommerce_before_main_content" <?php echo $woo_position == "woocommerce_before_main_content" ? 'SELECTED' : ''; ?> ><?php _e( 'Before Main Content', 'click-to-chat-for-whatsapp' ); ?></option>
178
+ <option value="woocommerce_after_single_product" <?php echo $woo_position == "woocommerce_after_single_product" ? 'SELECTED' : ''; ?> ><?php _e( 'After single product', 'click-to-chat-for-whatsapp' ); ?></option>
179
+ </select>
180
+ </div>
181
+ </div> -->
182
+
183
+ </div>
184
+ </div>
185
+ </li>
186
+ <ul>
187
+
188
+
189
+ <?php
190
+ }
191
+
192
+
193
+
194
+
195
+ /**
196
+ * Sanitize each setting field as needed
197
+ *
198
+ * @param array $input Contains all settings fields as array keys
199
+ */
200
+ public function options_sanitize( $input ) {
201
+
202
+ if ( ! current_user_can( 'manage_options' ) ) {
203
+ wp_die( 'not allowed to modify - please contact admin ' );
204
+ }
205
+
206
+ $new_input = array();
207
+
208
+ foreach ($input as $key => $value) {
209
+ if( isset( $input[$key] ) ) {
210
+
211
+ if ( 'woo_pre_filled' == $key ) {
212
+ $new_input[$key] = sanitize_textarea_field( $input[$key] );
213
+ } else {
214
+ $new_input[$key] = sanitize_text_field( $input[$key] );
215
+ }
216
+ }
217
+ }
218
+
219
+ // l10n
220
+ foreach ($input as $key => $value) {
221
+ if ( 'woo_pre_filled' == $key || 'woo_call_to_action' == $key ) {
222
+ do_action( 'wpml_register_single_string', 'Click to Chat for WhatsApp', $key, $input[$key] );
223
+ }
224
+ }
225
+
226
+ do_action('ht_ctc_ah_admin_after_sanitize' );
227
+
228
+ return $new_input;
229
+ }
230
+
231
+
232
+ }
233
+
234
+ new HT_CTC_Admin_Woo_Page();
235
+
236
+ endif; // END class_exists check
prev/admin/admin.php CHANGED
@@ -12,11 +12,11 @@
12
  if ( ! defined( 'ABSPATH' ) ) exit;
13
 
14
  /*************** includes ***********/
15
- include_once('class-ccw-add-styles-scripts-admin.php');
16
 
17
- include_once('commons/class-ht-ccw-admin-lists.php');
18
 
19
- include_once('class-ccw-admin-menu.php');
20
- include_once('class-ccw-admin-page.php');
21
- include_once('class-ccw-admin-page-customize-styles.php');
22
- include_once('class-ccw-admin-others.php');
12
  if ( ! defined( 'ABSPATH' ) ) exit;
13
 
14
  /*************** includes ***********/
15
+ include_once 'class-ccw-add-styles-scripts-admin.php';
16
 
17
+ include_once 'commons/class-ht-ccw-admin-lists.php';
18
 
19
+ include_once 'class-ccw-admin-menu.php';
20
+ include_once 'class-ccw-admin-page.php';
21
+ include_once 'class-ccw-admin-page-customize-styles.php';
22
+ include_once 'class-ccw-admin-others.php';
prev/admin/class-ccw-admin-menu.php CHANGED
@@ -34,7 +34,7 @@ class CCW_Admin_Menu {
34
  return;
35
  }
36
 
37
- include_once('settings_page.php');
38
  }
39
 
40
 
@@ -58,7 +58,7 @@ class CCW_Admin_Menu {
58
  return;
59
  }
60
 
61
- include_once('sp_customize_styles.php');
62
  }
63
 
64
 
34
  return;
35
  }
36
 
37
+ include_once 'settings_page.php';
38
  }
39
 
40
 
58
  return;
59
  }
60
 
61
+ include_once 'sp_customize_styles.php';
62
  }
63
 
64
 
prev/inc/class-ccw-shortcode.php CHANGED
@@ -174,10 +174,10 @@ class CCW_Shortcode {
174
  }
175
 
176
  if ( 'group_chat' == $is_group ) {
177
- $img_click_link = "window.open('https://chat.whatsapp.com/$group_id', '_blank')";
178
  $redirect_a = "https://chat.whatsapp.com/$group_id";
179
  } else {
180
- $img_click_link = "window.open('https://api.whatsapp.com/send?phone=$num&text=$initial_text', '_blank')";
181
  $redirect_a = "https://api.whatsapp.com/send?phone=$num&text=$initial_text";
182
  }
183
  } else {
@@ -190,10 +190,10 @@ class CCW_Shortcode {
190
 
191
  // App First - so mobile based url
192
  if ( 'group_chat' == $is_group ) {
193
- $img_click_link = "window.open('https://chat.whatsapp.com/$group_id', '_blank')";
194
  $redirect_a = "https://chat.whatsapp.com/$group_id";
195
  } else {
196
- $img_click_link = "window.open('https://api.whatsapp.com/send?phone=$num&text=$initial_text', '_blank')";
197
  $redirect_a = "https://api.whatsapp.com/send?phone=$num&text=$initial_text";
198
  }
199
 
@@ -201,10 +201,10 @@ class CCW_Shortcode {
201
 
202
  // General - Desktop url
203
  if ( 'group_chat' == $is_group ) {
204
- $img_click_link = "window.open('https://chat.whatsapp.com/$group_id', '_blank')";
205
  $redirect_a = "https://chat.whatsapp.com/$group_id";
206
  } else {
207
- $img_click_link = "window.open('https://web.whatsapp.com/send?phone=$num&text=$initial_text', '_blank')";
208
  $redirect_a = "https://web.whatsapp.com/send?phone=$num&text=$initial_text";
209
  }
210
  }
174
  }
175
 
176
  if ( 'group_chat' == $is_group ) {
177
+ $img_click_link = "window.open('https://chat.whatsapp.com/$group_id', '_blank', 'noreferrer')";
178
  $redirect_a = "https://chat.whatsapp.com/$group_id";
179
  } else {
180
+ $img_click_link = "window.open('https://api.whatsapp.com/send?phone=$num&text=$initial_text', '_blank', 'noreferrer')";
181
  $redirect_a = "https://api.whatsapp.com/send?phone=$num&text=$initial_text";
182
  }
183
  } else {
190
 
191
  // App First - so mobile based url
192
  if ( 'group_chat' == $is_group ) {
193
+ $img_click_link = "window.open('https://chat.whatsapp.com/$group_id', '_blank', 'noreferrer')";
194
  $redirect_a = "https://chat.whatsapp.com/$group_id";
195
  } else {
196
+ $img_click_link = "window.open('https://api.whatsapp.com/send?phone=$num&text=$initial_text', '_blank', 'noreferrer')";
197
  $redirect_a = "https://api.whatsapp.com/send?phone=$num&text=$initial_text";
198
  }
199
 
201
 
202
  // General - Desktop url
203
  if ( 'group_chat' == $is_group ) {
204
+ $img_click_link = "window.open('https://chat.whatsapp.com/$group_id', '_blank', 'noreferrer')";
205
  $redirect_a = "https://chat.whatsapp.com/$group_id";
206
  } else {
207
+ $img_click_link = "window.open('https://web.whatsapp.com/send?phone=$num&text=$initial_text', '_blank', 'noreferrer')";
208
  $redirect_a = "https://web.whatsapp.com/send?phone=$num&text=$initial_text";
209
  }
210
  }
prev/inc/class-ht-ccw-register.php CHANGED
@@ -25,7 +25,7 @@ class HT_CCW_Register {
25
  }
26
 
27
  // add default values to options db
28
- include_once( HT_CTC_PLUGIN_DIR . '/prev/admin/default-values.php' );
29
  }
30
 
31
  // when plugin deactivate
25
  }
26
 
27
  // add default values to options db
28
+ include_once HT_CTC_PLUGIN_DIR . '/prev/admin/default-values.php';
29
  }
30
 
31
  // when plugin deactivate
prev/inc/commons/styles-list-sc/sc-style-2.php CHANGED
@@ -17,5 +17,5 @@ $input_onhover = "this.style.color= '$s2_text_color_onhover', this.style.textDec
17
  $input_onhover_out = "this.style.color= '$s2_text_color', this.style.textDecoration= '$s2_decoration'; ";
18
 
19
  $o .= '<div class="ccw_plugin inline style2-sc sc_item '.$inline_issue.' " style=" '.$css.' " >';
20
- $o .= '<a class="nofocus ccw-analytics" data-ccw="style-2-sc" href="'.$redirect_a.'" target="_blank" style=" color:'.$s2_text_color.'; text-decoration: '.$s2_decoration.'; " onmouseover= " '.$input_onhover.' " onmouseout= " '.$input_onhover_out.' " >'.$a["val"].'</a>';
21
  $o .= '</div>';
17
  $input_onhover_out = "this.style.color= '$s2_text_color', this.style.textDecoration= '$s2_decoration'; ";
18
 
19
  $o .= '<div class="ccw_plugin inline style2-sc sc_item '.$inline_issue.' " style=" '.$css.' " >';
20
+ $o .= '<a class="nofocus ccw-analytics" rel="noreferrer" data-ccw="style-2-sc" href="'.$redirect_a.'" target="_blank" style=" color:'.$s2_text_color.'; text-decoration: '.$s2_decoration.'; " onmouseover= " '.$input_onhover.' " onmouseout= " '.$input_onhover_out.' " >'.$a["val"].'</a>';
21
  $o .= '</div>';
prev/inc/commons/styles-list-sc/sc-style-5.php CHANGED
@@ -15,6 +15,6 @@ $input_onhover_out = "this.style.color= '$s5_color'; ";
15
 
16
  $o .= '<div class="ccw_plugin sc_item pointer '.$inline_issue.' " style=" '.$css.' color: '.$s5_color.'; " onclick="'.$img_click_link.'" onmouseover= " '.$input_onhover.' " onmouseout= " '.$input_onhover_out.' " >';
17
  $o .= '<span class="icon icon-whatsapp2 icon-2 ccw-analytics" data-ccw="style-5-sc" style=" font-size: '.$s5_icon_size.'; "></span>';
18
- // $o .= '<a target="_blank" class="nofocus icon icon-whatsapp2 icon-2 no_a_underline ccw-analytics" href="'.$redirect_a.'" >';
19
  // $o .= '</a>';
20
  $o .= '</div>';
15
 
16
  $o .= '<div class="ccw_plugin sc_item pointer '.$inline_issue.' " style=" '.$css.' color: '.$s5_color.'; " onclick="'.$img_click_link.'" onmouseover= " '.$input_onhover.' " onmouseout= " '.$input_onhover_out.' " >';
17
  $o .= '<span class="icon icon-whatsapp2 icon-2 ccw-analytics" data-ccw="style-5-sc" style=" font-size: '.$s5_icon_size.'; "></span>';
18
+ // $o .= '<a target="_blank" class="nofocus icon icon-whatsapp2 icon-2 no_a_underline ccw-analytics" rel="noreferrer" href="'.$redirect_a.'" >';
19
  // $o .= '</a>';
20
  $o .= '</div>';
prev/inc/commons/styles-list-sc/sc-style-8.1.php CHANGED
@@ -24,7 +24,7 @@ $input_onhover = "this.style.backgroundColor= '$s8_background_color_onhover', th
24
  $input_onhover_out = "this.style.backgroundColor= '$s8_background_color', this.childNodes[1].style.color= '$s8_text_color' ; ";
25
 
26
  $o .= '<div class="ccw_plugin sc_item '.$inline_issue.' " style=" '.$css.' " >';
27
- $o .= '<a style="background-color: '.$s8_background_color.'; width: '.$s8_1_width.' " target="_blank" href="'.$redirect_a.'" class="btn ccw-analytics" onmouseover= " '.$input_onhover.' " onmouseout= " '.$input_onhover_out.' " > ';
28
  $o .= '<span style="color: '.$s8_text_color.';" class="ccw-s8-span-sc ccw-analytics" data-ccw="style-8-1-sc" id="ccw-s8-icon-sc" >'.$a["val"].'</span>';
29
  $o .= '</a>';
30
  $o .= '</div>';
24
  $input_onhover_out = "this.style.backgroundColor= '$s8_background_color', this.childNodes[1].style.color= '$s8_text_color' ; ";
25
 
26
  $o .= '<div class="ccw_plugin sc_item '.$inline_issue.' " style=" '.$css.' " >';
27
+ $o .= '<a style="background-color: '.$s8_background_color.'; width: '.$s8_1_width.' " target="_blank" rel="noreferrer" href="'.$redirect_a.'" class="btn ccw-analytics" onmouseover= " '.$input_onhover.' " onmouseout= " '.$input_onhover_out.' " > ';
28
  $o .= '<span style="color: '.$s8_text_color.';" class="ccw-s8-span-sc ccw-analytics" data-ccw="style-8-1-sc" id="ccw-s8-icon-sc" >'.$a["val"].'</span>';
29
  $o .= '</a>';
30
  $o .= '</div>';
prev/inc/commons/styles-list-sc/sc-style-8.php CHANGED
@@ -26,7 +26,7 @@ $input_onhover = "this.style.backgroundColor= '$s8_background_color_onhover', th
26
  $input_onhover_out = "this.style.backgroundColor= '$s8_background_color', this.childNodes[1].style.color= '$s8_icon_color', this.childNodes[2].style.color= '$s8_text_color' ; ";
27
 
28
  $o .= '<div class="ccw_plugin mdstyle8 sc_item '.$inline_issue.' " style=" '.$css.' " >';
29
- $o .= '<a style="background-color: '.$s8_background_color.';" target="_blank" href="'.$redirect_a.'" class="btn ccw-analytics" data-ccw="style-8-sc" onmouseover= " '.$input_onhover.' " onmouseout= " '.$input_onhover_out.' " > ';
30
  $o .= '<i class="material-icons '.$s8_icon_float.' icon icon-whatsapp2 ccw-s8-icon-sc ccw-analytics" data-ccw="style-8" style="color: '.$s8_icon_color.';" ></i>';
31
  $o .= '<span style="color: '.$s8_text_color.';" class="ccw-s8-span-sc ccw-analytics" data-ccw="style-8-sc" id="ccw-s8-icon-sc" >'.$a["val"].'</span>';
32
  $o .= '</a>';
26
  $input_onhover_out = "this.style.backgroundColor= '$s8_background_color', this.childNodes[1].style.color= '$s8_icon_color', this.childNodes[2].style.color= '$s8_text_color' ; ";
27
 
28
  $o .= '<div class="ccw_plugin mdstyle8 sc_item '.$inline_issue.' " style=" '.$css.' " >';
29
+ $o .= '<a style="background-color: '.$s8_background_color.';" target="_blank" rel="noreferrer" href="'.$redirect_a.'" class="btn ccw-analytics" data-ccw="style-8-sc" onmouseover= " '.$input_onhover.' " onmouseout= " '.$input_onhover_out.' " > ';
30
  $o .= '<i class="material-icons '.$s8_icon_float.' icon icon-whatsapp2 ccw-s8-icon-sc ccw-analytics" data-ccw="style-8" style="color: '.$s8_icon_color.';" ></i>';
31
  $o .= '<span style="color: '.$s8_text_color.';" class="ccw-s8-span-sc ccw-analytics" data-ccw="style-8-sc" id="ccw-s8-icon-sc" >'.$a["val"].'</span>';
32
  $o .= '</a>';
prev/inc/commons/styles-list/style-2.php CHANGED
@@ -13,7 +13,7 @@ $s2_decoration_onhover = esc_attr( $ccw_options_cs['s2_decoration_onhover'] );
13
  ?>
14
  <div class="ccw_plugin chatbot" style="<?= $p1 ?>; <?= $p2 ?>;">
15
  <div class="style2 animated <?= $an_on_load .' '. $an_on_hover ?> ">
16
- <a href="<?= $redirect_a ?>"
17
  style="color: <?= $s2_text_color ?>; text-decoration: <?= $s2_decoration ?>;"
18
  onmouseover = "this.style.color = '<?= $s2_text_color_onhover ?>', this.style.textDecoration = '<?= $s2_decoration_onhover ?>' "
19
  onmouseout = "this.style.color = '<?= $s2_text_color ?>', this.style.textDecoration = '<?= $s2_decoration ?>' "
13
  ?>
14
  <div class="ccw_plugin chatbot" style="<?= $p1 ?>; <?= $p2 ?>;">
15
  <div class="style2 animated <?= $an_on_load .' '. $an_on_hover ?> ">
16
+ <a href="<?= $redirect_a ?>" rel="noreferrer"
17
  style="color: <?= $s2_text_color ?>; text-decoration: <?= $s2_decoration ?>;"
18
  onmouseover = "this.style.color = '<?= $s2_text_color_onhover ?>', this.style.textDecoration = '<?= $s2_decoration_onhover ?>' "
19
  onmouseout = "this.style.color = '<?= $s2_text_color ?>', this.style.textDecoration = '<?= $s2_decoration ?>' "
prev/inc/commons/styles-list/style-3.php CHANGED
@@ -11,7 +11,7 @@ $s3_icon_size = esc_attr( $ccw_options_cs['s3_icon_size'] );
11
  ?>
12
  <div class="ccw_plugin chatbot" style="<?= $p1 ?>; <?= $p2 ?>;" >
13
  <div class="ccw_style3 animated <?= $an_on_load .' '. $an_on_hover ?> ">
14
- <a target="_blank" href="<?= $redirect_a ?>" class="img-icon-a nofocus">
15
  <img class="img-icon ccw-analytics" id="style-3" data-ccw="style-3" style="height: <?= $s3_icon_size ?>;" src="<?= plugins_url( "./new/inc/assets/img/whatsapp-logo.svg", HT_CTC_PLUGIN_FILE ) ?>" alt="WhatsApp chat">
16
  </a>
17
  </div>
11
  ?>
12
  <div class="ccw_plugin chatbot" style="<?= $p1 ?>; <?= $p2 ?>;" >
13
  <div class="ccw_style3 animated <?= $an_on_load .' '. $an_on_hover ?> ">
14
+ <a target="_blank" href="<?= $redirect_a ?>" rel="noreferrer" class="img-icon-a nofocus">
15
  <img class="img-icon ccw-analytics" id="style-3" data-ccw="style-3" style="height: <?= $s3_icon_size ?>;" src="<?= plugins_url( "./new/inc/assets/img/whatsapp-logo.svg", HT_CTC_PLUGIN_FILE ) ?>" alt="WhatsApp chat">
16
  </a>
17
  </div>
prev/inc/commons/styles-list/style-4.php CHANGED
@@ -12,7 +12,7 @@ $s4_background_color = esc_attr( $ccw_options_cs['s4_background_color'] );
12
  ?>
13
  <div class="ccw_plugin chatbot" style="<?= $p1 ?>; <?= $p2 ?>;">
14
  <div class="style4 animated <?= $an_on_load .' '. $an_on_hover ?>">
15
- <a target="_blank" href="<?= $redirect_a ?>" class="nofocus">
16
  <div class="chip style-4 ccw-analytics" id="style-4" data-ccw="style-4" style="background-color: <?= $s4_background_color ?>; color: <?= $s4_text_color ?>">
17
  <img src="<?= plugins_url( './new/inc/assets/img/whatsapp-logo-32x32.png', HT_CTC_PLUGIN_FILE ) ?>" class="ccw-analytics" id="s4-icon" data-ccw="style-4" alt="WhatsApp">
18
  <?= $val ?>
12
  ?>
13
  <div class="ccw_plugin chatbot" style="<?= $p1 ?>; <?= $p2 ?>;">
14
  <div class="style4 animated <?= $an_on_load .' '. $an_on_hover ?>">
15
+ <a target="_blank" href="<?= $redirect_a ?>" rel="noreferrer" class="nofocus">
16
  <div class="chip style-4 ccw-analytics" id="style-4" data-ccw="style-4" style="background-color: <?= $s4_background_color ?>; color: <?= $s4_text_color ?>">
17
  <img src="<?= plugins_url( './new/inc/assets/img/whatsapp-logo-32x32.png', HT_CTC_PLUGIN_FILE ) ?>" class="ccw-analytics" id="s4-icon" data-ccw="style-4" alt="WhatsApp">
18
  <?= $val ?>
prev/inc/commons/styles-list/style-5.php CHANGED
@@ -12,7 +12,7 @@ $s5_icon_size = esc_attr( $ccw_options_cs['s5_icon_size'] );
12
  <div class="ccw_plugin">
13
  <div class="style-5 chatbot nofocus animated <?= $an_on_load .' '. $an_on_hover ?>" style="<?= $p1 ?>; <?= $p2 ?>;">
14
  <a target="_blank" class="nofocus icon icon-whatsapp2 icon-2 ccw-analytics" id="stye-5" data-ccw="style-5"
15
- href="<?= $redirect_a ?>"
16
  style = "color: <?= $s5_color ?>; font-size: <?= $s5_icon_size ?>;"
17
  onmouseover = "this.style.color = '<?= $s5_hover_color ?>' "
18
  onmouseout = "this.style.color = '<?= $s5_color ?>' " >
12
  <div class="ccw_plugin">
13
  <div class="style-5 chatbot nofocus animated <?= $an_on_load .' '. $an_on_hover ?>" style="<?= $p1 ?>; <?= $p2 ?>;">
14
  <a target="_blank" class="nofocus icon icon-whatsapp2 icon-2 ccw-analytics" id="stye-5" data-ccw="style-5"
15
+ href="<?= $redirect_a ?>" rel="noreferrer"
16
  style = "color: <?= $s5_color ?>; font-size: <?= $s5_icon_size ?>;"
17
  onmouseover = "this.style.color = '<?= $s5_hover_color ?>' "
18
  onmouseout = "this.style.color = '<?= $s5_color ?>' " >
prev/inc/commons/styles-list/style-8.php CHANGED
@@ -22,7 +22,7 @@ $s8_icon_float = esc_attr( $ccw_options_cs['s8_icon_float'] );
22
  ?>
23
  <div class="ccw_plugin mdstyle8 chatbot" style="<?= $p1 ?>; <?= $p2 ?>;">
24
  <div class="style8 animated <?= $an_on_load .' '. $an_on_hover ?>">
25
- <a target="_blank" class="btn ccw-analytics" id="style-8" data-ccw="style-8"
26
  style="background-color: <?= $s8_background_color ?>; "
27
  onmouseover = "this.style.backgroundColor = '<?= $s8_background_color_onhover ?>', document.getElementsByClassName('ccw-s8-icon')[0].style.color = '<?= $s8_icon_color_onhover ?>', document.getElementsByClassName('ccw-s8-span')[0].style.color = '<?= $s8_text_color_onhover ?>' "
28
  onmouseout = "this.style.backgroundColor = '<?= $s8_background_color ?>', document.getElementsByClassName('ccw-s8-icon')[0].style.color = '<?= $s8_icon_color ?>', document.getElementsByClassName('ccw-s8-span')[0].style.color = '<?= $s8_text_color ?>' "
22
  ?>
23
  <div class="ccw_plugin mdstyle8 chatbot" style="<?= $p1 ?>; <?= $p2 ?>;">
24
  <div class="style8 animated <?= $an_on_load .' '. $an_on_hover ?>">
25
+ <a target="_blank" class="btn ccw-analytics" id="style-8" data-ccw="style-8" rel="noreferrer"
26
  style="background-color: <?= $s8_background_color ?>; "
27
  onmouseover = "this.style.backgroundColor = '<?= $s8_background_color_onhover ?>', document.getElementsByClassName('ccw-s8-icon')[0].style.color = '<?= $s8_icon_color_onhover ?>', document.getElementsByClassName('ccw-s8-span')[0].style.color = '<?= $s8_text_color_onhover ?>' "
28
  onmouseout = "this.style.backgroundColor = '<?= $s8_background_color ?>', document.getElementsByClassName('ccw-s8-icon')[0].style.color = '<?= $s8_icon_color ?>', document.getElementsByClassName('ccw-s8-span')[0].style.color = '<?= $s8_text_color ?>' "
prev/inc/commons/styles-list/style-9.php CHANGED
@@ -10,7 +10,7 @@ $s9_icon_size = esc_attr( $ccw_options_cs['s9_icon_size'] );
10
 
11
  <div class="ccw_plugin chatbot" style="<?= $p1 ?>; <?= $p2 ?>;">
12
  <div class="ccw_style9 animated <?= $an_on_load .' '. $an_on_hover ?>">
13
- <a target="_blank" href="<?= $redirect_a ?>" class="img-icon-a nofocus">
14
  <img class="img-icon ccw-analytics" id="style-9" data-ccw="style-9" style="height: <?= $s9_icon_size ?>;" src="<?= plugins_url( './new/inc/assets/img/whatsapp-icon-square.svg', HT_CTC_PLUGIN_FILE ) ?>" alt="WhatsApp chat">
15
  </a>
16
  </div>
10
 
11
  <div class="ccw_plugin chatbot" style="<?= $p1 ?>; <?= $p2 ?>;">
12
  <div class="ccw_style9 animated <?= $an_on_load .' '. $an_on_hover ?>">
13
+ <a target="_blank" href="<?= $redirect_a ?>" rel="noreferrer" class="img-icon-a nofocus">
14
  <img class="img-icon ccw-analytics" id="style-9" data-ccw="style-9" style="height: <?= $s9_icon_size ?>;" src="<?= plugins_url( './new/inc/assets/img/whatsapp-icon-square.svg', HT_CTC_PLUGIN_FILE ) ?>" alt="WhatsApp chat">
15
  </a>
16
  </div>
prev/inc/commons/styles-list/style-99.php CHANGED
@@ -50,7 +50,7 @@ if ( '' == $own_image ) {
50
 
51
  <div class="ccw_plugin chatbot" style="<?= $p1 ?>; <?= $p2 ?>;">
52
  <div class="ccw_style_99 animated <?= $an_on_load .' '. $an_on_hover ?>">
53
- <a target="_blank" href="<?= $redirect_a ?>" class="img-icon-a nofocus">
54
  <img class="own-img ccw-analytics" id="style-9" data-ccw="style-99-own-image" style="<?= $img_css ?>" src="<?= $own_image ?>" alt="WhatsApp chat">
55
  </a>
56
  </div>
50
 
51
  <div class="ccw_plugin chatbot" style="<?= $p1 ?>; <?= $p2 ?>;">
52
  <div class="ccw_style_99 animated <?= $an_on_load .' '. $an_on_hover ?>">
53
+ <a target="_blank" href="<?= $redirect_a ?>" rel="noreferrer" class="img-icon-a nofocus">
54
  <img class="own-img ccw-analytics" id="style-9" data-ccw="style-99-own-image" style="<?= $img_css ?>" src="<?= $own_image ?>" alt="WhatsApp chat">
55
  </a>
56
  </div>
prev/inc/commons/styles.php CHANGED
@@ -49,10 +49,10 @@ if( 1 == $is_mobile ) {
49
 
50
 
51
  if ( 'group_chat' == $return_type ) {
52
- $redirect = "window.open('https://chat.whatsapp.com/$group_id', '_blank')";
53
  $redirect_a = "https://chat.whatsapp.com/$group_id";
54
  } else {
55
- $redirect = "window.open('https://api.whatsapp.com/send?phone=$num&text=$initial_text', '_blank')";
56
  $redirect_a = "https://api.whatsapp.com/send?phone=$num&text=$initial_text";
57
  }
58
  } else {
@@ -65,10 +65,10 @@ if( 1 == $is_mobile ) {
65
 
66
  // App First - so mobile based url
67
  if ( 'group_chat' == $return_type ) {
68
- $redirect = "window.open('https://chat.whatsapp.com/$group_id', '_blank')";
69
  $redirect_a = "https://chat.whatsapp.com/$group_id";
70
  } else {
71
- $redirect = "window.open('https://api.whatsapp.com/send?phone=$num&text=$initial_text', '_blank')";
72
  $redirect_a = "https://api.whatsapp.com/send?phone=$num&text=$initial_text";
73
  }
74
 
@@ -77,10 +77,10 @@ if( 1 == $is_mobile ) {
77
 
78
  // General - Desktop url
79
  if ( 'group_chat' == $return_type ) {
80
- $redirect = "window.open('https://chat.whatsapp.com/$group_id', '_blank')";
81
  $redirect_a = "https://chat.whatsapp.com/$group_id";
82
  } else {
83
- $redirect = "window.open('https://web.whatsapp.com/send?phone=$num&text=$initial_text', '_blank')";
84
  $redirect_a = "https://web.whatsapp.com/send?phone=$num&text=$initial_text";
85
  }
86
 
49
 
50
 
51
  if ( 'group_chat' == $return_type ) {
52
+ $redirect = "window.open('https://chat.whatsapp.com/$group_id', '_blank', 'noopener')";
53
  $redirect_a = "https://chat.whatsapp.com/$group_id";
54
  } else {
55
+ $redirect = "window.open('https://api.whatsapp.com/send?phone=$num&text=$initial_text', '_blank', 'noopener')";
56
  $redirect_a = "https://api.whatsapp.com/send?phone=$num&text=$initial_text";
57
  }
58
  } else {
65
 
66
  // App First - so mobile based url
67
  if ( 'group_chat' == $return_type ) {
68
+ $redirect = "window.open('https://chat.whatsapp.com/$group_id', '_blank', 'noreferrer')";
69
  $redirect_a = "https://chat.whatsapp.com/$group_id";
70
  } else {
71
+ $redirect = "window.open('https://api.whatsapp.com/send?phone=$num&text=$initial_text', '_blank', 'noreferrer')";
72
  $redirect_a = "https://api.whatsapp.com/send?phone=$num&text=$initial_text";
73
  }
74
 
77
 
78
  // General - Desktop url
79
  if ( 'group_chat' == $return_type ) {
80
+ $redirect = "window.open('https://chat.whatsapp.com/$group_id', '_blank', 'noreferrer')";
81
  $redirect_a = "https://chat.whatsapp.com/$group_id";
82
  } else {
83
+ $redirect = "window.open('https://web.whatsapp.com/send?phone=$num&text=$initial_text', '_blank', 'noreferrer')";
84
  $redirect_a = "https://web.whatsapp.com/send?phone=$num&text=$initial_text";
85
  }
86
 
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Click to Chat ===
2
  Requires at least: 4.6
3
- Tested up to: 5.7.1
4
  Requires PHP: 5.6
5
  Contributors: holithemes
6
- Stable tag: 3.3.2
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
@@ -115,11 +115,9 @@ Creates an Event when the user clicks on the WhatsApp Icon/button.
115
 
116
  [Google Ads Conversations](https://holithemes.com/plugins/click-to-chat/google-ads-conversion/?utm_source=wp&utm_medium=readme&utm_campaign=ht)
117
 
118
- = Webhooks =
119
 
120
- Connect other applications using Integarate, Automation tools like Zapier, IFTTT
121
-
122
- [Webhooks](https://holithemes.com/plugins/click-to-chat/webhooks)
123
 
124
  = 🔆 Localization =
125
 
@@ -398,7 +396,7 @@ For any issues with the plugin / suggestions:
398
 
399
  * WordPress [new topic](https://wordpress.org/support/plugin/click-to-chat-for-whatsapp/)
400
 
401
- * GitHub [Discussions](https://github.com/holithemes/ctc/discussions)
402
 
403
  = ⭐️ Give Support =
404
 
@@ -425,6 +423,12 @@ After Activate the plugin, add WhatsApp Number at plugin settings.
425
 
426
  == Changelog ==
427
 
 
 
 
 
 
 
428
  = 3.3.2 =
429
  * Enchantment: Google Analytics
430
  * Enchantment: Web WhatsApp
1
  === Click to Chat ===
2
  Requires at least: 4.6
3
+ Tested up to: 5.7.2
4
  Requires PHP: 5.6
5
  Contributors: holithemes
6
+ Stable tag: 3.3.3
7
  Tags: whatsapp, whatsapp business, click to chat, whatsapp chat, whatsapp support, whatsapp group, whatsapp message, social chat, whatsapp wordpress, whatsapp floating button, whatsapp icon, holithemes
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
115
 
116
  [Google Ads Conversations](https://holithemes.com/plugins/click-to-chat/google-ads-conversion/?utm_source=wp&utm_medium=readme&utm_campaign=ht)
117
 
118
+ = [Webhooks](https://holithemes.com/plugins/click-to-chat/webhooks) =
119
 
120
+ Connect other applications using Integarate, Automation tools like Zapier, IFTTT, Pipedream
 
 
121
 
122
  = 🔆 Localization =
123
 
396
 
397
  * WordPress [new topic](https://wordpress.org/support/plugin/click-to-chat-for-whatsapp/)
398
 
399
+ * GitHub [Discussions](https://github.com/holithemes/click-to-chat/discussions)
400
 
401
  = ⭐️ Give Support =
402
 
423
 
424
  == Changelog ==
425
 
426
+ = 3.3.3 =
427
+ * User Interface: Display settings
428
+ * New: Display settings for custom post types
429
+ * User Interface: same_settings for mobile, desktop
430
+ * User Interface: WooCommerce related settings now in seperate page
431
+
432
  = 3.3.2 =
433
  * Enchantment: Google Analytics
434
  * Enchantment: Web WhatsApp