Click to Chat for WhatsApp Chat - Version 3.7

Version Description

  • Enchantment: Admin settings
  • Enchantment: Add your own image style.
  • update z-index now for chat, group, share features
Download this release

Release Info

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

Code changes from version 3.6 to 3.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.6
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.6' );
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.7
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.7' );
21
  }
22
 
23
  // define HT_CTC_PLUGIN_FILE
new/admin/admin_commons/admin-device-settings.php CHANGED
@@ -65,7 +65,7 @@ $position_type_values = apply_filters( 'ht_ctc_fh_position_type_values', $positi
65
  <option value="7" <?= $style_desktop == 7 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7', 'click-to-chat-for-whatsapp' ); ?></option>
66
  <option value="7_1" <?= $style_desktop == '7_1' ? 'SELECTED' : ''; ?> >&emsp;<?php _e( 'Style-7 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
67
  <option value="8" <?= $style_desktop == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
68
- <option value="99" <?= $style_desktop == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-99 (Add your own image / GIF)', 'click-to-chat-for-whatsapp' ); ?></option>
69
  </select>
70
  <p class="description"><a style="background-color: #26a69a; color: #fff; padding: 5px;" 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>
71
  </div>
@@ -175,7 +175,7 @@ if ( isset( $options['same_settings'] ) ) {
175
  <option value="7" <?= $style_mobile == 7 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7', 'click-to-chat-for-whatsapp' ); ?></option>
176
  <option value="7_1" <?= $style_mobile == '7_1' ? 'SELECTED' : ''; ?> >&emsp;<?php _e( 'Style-7 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
177
  <option value="8" <?= $style_mobile == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
178
- <option value="99" <?= $style_mobile == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-99 (Add your own image / GIF)', 'click-to-chat-for-whatsapp' ); ?></option>
179
  </select>
180
  <p class="description"><a style="background-color: #26a69a; color: #fff; padding: 5px;" 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>
181
  </div>
65
  <option value="7" <?= $style_desktop == 7 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7', 'click-to-chat-for-whatsapp' ); ?></option>
66
  <option value="7_1" <?= $style_desktop == '7_1' ? 'SELECTED' : ''; ?> >&emsp;<?php _e( 'Style-7 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
67
  <option value="8" <?= $style_desktop == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
68
+ <option value="99" <?= $style_desktop == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Add your own image / GIF (Style-99)', 'click-to-chat-for-whatsapp' ); ?></option>
69
  </select>
70
  <p class="description"><a style="background-color: #26a69a; color: #fff; padding: 5px;" 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>
71
  </div>
175
  <option value="7" <?= $style_mobile == 7 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7', 'click-to-chat-for-whatsapp' ); ?></option>
176
  <option value="7_1" <?= $style_mobile == '7_1' ? 'SELECTED' : ''; ?> >&emsp;<?php _e( 'Style-7 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
177
  <option value="8" <?= $style_mobile == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
178
+ <option value="99" <?= $style_mobile == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Add your own image / GIF (Style-99)', 'click-to-chat-for-whatsapp' ); ?></option>
179
  </select>
180
  <p class="description"><a style="background-color: #26a69a; color: #fff; padding: 5px;" 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>
181
  </div>
new/admin/admin_commons/admin-sidebar-content.php CHANGED
@@ -39,20 +39,27 @@ $othersettings = get_option('ht_ctc_othersettings');
39
  <div class="collapsible-header"><?php _e( 'PRO', 'click-to-chat-for-whatsapp' ); ?></div>
40
  <div class="collapsible-body">
41
  <p class="description">Random Numbers</p>
42
- <p class="description">Hide based on selected days in a week</p>
43
- <p class="description">Hide based on selected time range in a day</p>
44
- <p class="description">Change WhatsApp number when offline</p>
45
- <p class="description">Change Call to Action when offline</p>
46
  <p class="description">Fixed/Absolute Position types</p>
47
- <p class="description">Display after Time delay</p>
48
- <p class="description">Display after User page Scroll percentage</p>
49
- <p class="description">Display only to logged-in users</p>
50
  <p class="description">Webhooks - dynamic variables</p>
51
  <p class="description">Google Ads Conversion</p>
 
 
 
 
 
 
 
 
 
 
52
  <p class="description">Add WhatsApp in WooCommerce Product pages</p>
53
- <p class="description">More features coming soon ..</p>
 
 
 
 
54
 
55
- <p class="description" style="text-align: center; margin-top: 20px;"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/pricing/" class="waves-effect waves-light btn" style="width: 100%;">PRO Version</a></p>
56
 
57
  </div>
58
  </li>
39
  <div class="collapsible-header"><?php _e( 'PRO', 'click-to-chat-for-whatsapp' ); ?></div>
40
  <div class="collapsible-body">
41
  <p class="description">Random Numbers</p>
 
 
 
 
42
  <p class="description">Fixed/Absolute Position types</p>
 
 
 
43
  <p class="description">Webhooks - dynamic variables</p>
44
  <p class="description">Google Ads Conversion</p>
45
+ <p class="description">Business Hours</p>
46
+ <p class="description">&emsp;Hide when offline</p>
47
+ <p class="description">&emsp;Change WhatsApp number when offline</p>
48
+ <p class="description">&emsp;Change Call to Action when offline</p>
49
+ <p class="description">Display after Time delay, scroll delay</p>
50
+ <p class="description">Display based on</p>
51
+ <p class="description">&emsp;selected days in a week</p>
52
+ <p class="description">&emsp;selected time range in a day</p>
53
+ <p class="description">&emsp;website visitor login status</p>
54
+ <p class="description">Page level settings: style, time, scroll dealy</p>
55
  <p class="description">Add WhatsApp in WooCommerce Product pages</p>
56
+ <p class="description">More features</p>
57
+ <br>
58
+ <p class="description">Next: (coming soon)</p>
59
+ <p class="description">Greetings Dialog</p>
60
+ <p class="description">Form Filling</p>
61
 
62
+ <p class="description" style="text-align: center; position:sticky; bottom:2px; margin-top:20px;"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/pricing/" class="waves-effect waves-light btn" style="width: 100%;">PRO Version</a></p>
63
 
64
  </div>
65
  </li>
new/admin/admin_commons/class-ht-ctc-admin-hooks.php CHANGED
@@ -19,6 +19,11 @@ class HT_CTC_Admin_Others {
19
 
20
  public function __construct() {
21
  $this->admin_hooks();
 
 
 
 
 
22
  }
23
 
24
  function admin_hooks() {
@@ -100,6 +105,8 @@ class HT_CTC_Admin_Others {
100
  // Admin notices
101
  // if number blank
102
  $ht_ctc_chat_options = get_option('ht_ctc_chat_options');
 
 
103
 
104
  if ( isset( $ht_ctc_chat_options['number'] ) ) {
105
  if ( '' == $ht_ctc_chat_options['number'] ) {
@@ -132,6 +139,33 @@ class HT_CTC_Admin_Others {
132
  }
133
 
134
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  }
136
 
137
  function ifnumberblank() {
@@ -162,6 +196,102 @@ class HT_CTC_Admin_Others {
162
  <?php
163
  }
164
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
 
166
  /**
167
  *
19
 
20
  public function __construct() {
21
  $this->admin_hooks();
22
+ $this->ajax();
23
+ }
24
+
25
+ function ajax() {
26
+ // add_action( 'wp_ajax_ht_ctc_admin_dismiss_notices', [$this, 'dismiss_notices'] );
27
  }
28
 
29
  function admin_hooks() {
105
  // Admin notices
106
  // if number blank
107
  $ht_ctc_chat_options = get_option('ht_ctc_chat_options');
108
+ $ht_ctc_notices = get_option('ht_ctc_notices');
109
+ $ht_ctc_pro_plugin_details = get_option('ht_ctc_pro_plugin_details');
110
 
111
  if ( isset( $ht_ctc_chat_options['number'] ) ) {
112
  if ( '' == $ht_ctc_chat_options['number'] ) {
139
  }
140
 
141
 
142
+ // // pro notice
143
+ // if ( !isset($ht_ctc_notices['pro_banner']) ) {
144
+
145
+ // // display pro banner only if pro plugin is not yet installed once
146
+ // if ( !isset($ht_ctc_pro_plugin_details['version']) ) {
147
+
148
+ // $time = time();
149
+ // // 1 week
150
+ // $wait_time = (7*24*60*60);
151
+ // $ht_ctc_plugin_details = get_option('ht_ctc_plugin_details');
152
+ // $first_install_time = (isset($ht_ctc_plugin_details['first_install_time'])) ? esc_attr($ht_ctc_plugin_details['first_install_time']) : 1;
153
+
154
+ // $diff_time = $time - $first_install_time;
155
+
156
+ // if ( $diff_time > $wait_time ) {
157
+ // add_action('admin_notices', array( $this, 'pro_notice') );
158
+ // add_action('admin_footer', array( $this, 'admin_pro_notice_scripts') );
159
+ // }
160
+
161
+ // }
162
+
163
+ // }
164
+
165
+ // // todo -remove this.. - added here for testing..
166
+ // add_action('admin_notices', array( $this, 'pro_notice') );
167
+ // add_action('admin_footer', array( $this, 'admin_pro_notice_scripts') );
168
+
169
  }
170
 
171
  function ifnumberblank() {
196
  <?php
197
  }
198
 
199
+ function pro_notice() {
200
+ ?>
201
+ <div class="notice notice-info is-dismissible ht-ctc-notice-pro-banner" data-db="pro_banner" style="display:flex; flex-direction: column; padding:25px;">
202
+ <p style="margin:0; font-size: 1.4em;color:#1d2327; font-weight:600;">Click to Chat - PRO</p>
203
+ <p style="margin:0 0 2px;">
204
+ Upgrade to Click to Chat PRO. Includes feature like Random Number, Form filling, Webhooks, Business hours, Display based on time range, days in a week, time dealy, scroll delay, login status
205
+ </p>
206
+ <p style="margin:0;">
207
+ <a class="button button-primary" href="https://holithemes.com/plugins/click-to-chat/pricing/" target="_blank">Buy Now</a>
208
+ <a class="button button-dismiss" href="#">Dismiss</a>
209
+ </p>
210
+ </div>
211
+ <?php
212
+ }
213
+
214
+ function admin_pro_notice_scripts() {
215
+ ?>
216
+ <script>
217
+ (function () {
218
+
219
+ if (document.readyState === "complete" || document.readyState === "interactive") {
220
+ ready();
221
+ } else {
222
+ document.addEventListener("DOMContentLoaded", ready);
223
+ }
224
+
225
+ function serialize(obj) {
226
+ return Object.keys(obj).reduce(function (a, k) {
227
+ a.push(k + '=' + encodeURIComponent(obj[k]));
228
+ return a;
229
+ }, []).join('&');
230
+ }
231
+
232
+ function ready() {
233
+ setTimeout(function () {
234
+ const buttons = document.querySelectorAll(".ht-ctc-notice-pro-banner .notice-dismiss, .ht-ctc-notice-pro-banner .button-dismiss");
235
+ for (let i = 0; i < buttons.length; i++) {
236
+ buttons[i].addEventListener('click', function (e) {
237
+ e.preventDefault();
238
+
239
+ var element = e.target.closest('.is-dismissible');
240
+ var db = (element.hasAttribute('data-db')) ? element.getAttribute('data-db') : '';
241
+
242
+ const http = new XMLHttpRequest();
243
+ http.open('POST', ajaxurl, true);
244
+ http.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
245
+ http.send(serialize({
246
+ 'action': 'ht_ctc_admin_dismiss_notices',
247
+ 'db': db,
248
+ 'nonce': <?php echo json_encode(wp_create_nonce('ht-ctc-notices')); ?>
249
+ }));
250
+
251
+ element.remove();
252
+ });
253
+ }
254
+ }, 1000);
255
+ }
256
+
257
+
258
+ })();
259
+ </script>
260
+ <?php
261
+ }
262
+
263
+ /**
264
+ *
265
+ * dismise notice - $key - post data 'db' - value is time..
266
+ */
267
+ // function dismiss_notices() {
268
+
269
+ // check_ajax_referer('ht-ctc-notices', 'nonce');
270
+
271
+ // $time = time();
272
+
273
+ // $post_data = ($_POST) ? map_deep( $_POST, 'sanitize_text_field' ) : '';
274
+ // $db_key = (isset($post_data['db'])) ? esc_attr( $post_data['db'] ) : '';
275
+
276
+ // // update/add at db..
277
+ // $values = array(
278
+ // 'version' => HT_CTC_VERSION,
279
+ // );
280
+ // $db_values = get_option( 'ht_ctc_notices', array() );
281
+ // $update_values = array_merge($values, $db_values);
282
+ // // update to latest values
283
+ // $update_values['version'] = HT_CTC_VERSION;
284
+ // // add data ..
285
+ // if ('' !== $db_key) {
286
+ // $update_values[$db_key] = $time;
287
+ // }
288
+ // update_option( 'ht_ctc_notices', $update_values );
289
+
290
+ // // todo - wp_send_json_success or wp_die
291
+ // // wp_send_json_success();
292
+ // wp_die();
293
+ // }
294
+
295
 
296
  /**
297
  *
new/admin/class-ht-ctc-admin-customize-styles.php CHANGED
@@ -1526,7 +1526,7 @@ class HT_CTC_Admin_Customize_Styles {
1526
  ?>
1527
  <ul class="collapsible ht_ctc_s99" data-collapsible="accordion">
1528
  <li>
1529
- <div class="collapsible-header"><?php _e( 'Style 99 - Own Image / GIF', 'click-to-chat-for-whatsapp' ); ?></div>
1530
  <div class="collapsible-body">
1531
 
1532
  <!-- Image URL - Desktop -->
@@ -1595,6 +1595,7 @@ class HT_CTC_Admin_Customize_Styles {
1595
  </div>
1596
  </div>
1597
 
 
1598
 
1599
  </div>
1600
  </div>
1526
  ?>
1527
  <ul class="collapsible ht_ctc_s99" data-collapsible="accordion">
1528
  <li>
1529
+ <div class="collapsible-header"><?php _e( 'Add your own image / GIF (Style 99)', 'click-to-chat-for-whatsapp' ); ?></div>
1530
  <div class="collapsible-body">
1531
 
1532
  <!-- Image URL - Desktop -->
1595
  </div>
1596
  </div>
1597
 
1598
+ <p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/style-99/">Add your own image / GIF (Style-99)</a></p>
1599
 
1600
  </div>
1601
  </div>
new/admin/class-ht-ctc-admin-main-page.php CHANGED
@@ -164,7 +164,7 @@ class HT_CTC_Admin_Main_Page {
164
 
165
  </div>
166
  <p class="description"><?php _e( "WhatsApp or WhatsApp business number with ", 'click-to-chat-for-whatsapp' ); ?> <a target="_blank" href="https://holithemes.com/blog/country-codes/"><?php _e( 'country code', 'click-to-chat-for-whatsapp' ); ?></a> </p>
167
- <p class="description"><?php _e( '( E.g. 916123456789 - herein e.g. 91 is country code, 6123456789 is the mobile number )', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/whatsapp-number/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> ) </p>
168
 
169
  <?php do_action('ht_ctc_ah_admin_chat_number'); ?>
170
 
164
 
165
  </div>
166
  <p class="description"><?php _e( "WhatsApp or WhatsApp business number with ", 'click-to-chat-for-whatsapp' ); ?> <a target="_blank" href="https://holithemes.com/blog/country-codes/"><?php _e( 'country code', 'click-to-chat-for-whatsapp' ); ?></a> </p>
167
+ <p class="description"><?php _e( '( E.g. 916123456789 - herein e.g. 91 is country code, 6123456789 is the mobile number )', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/whatsapp-number/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
168
 
169
  <?php do_action('ht_ctc_ah_admin_chat_number'); ?>
170
 
new/admin/class-ht-ctc-admin-other-settings.php CHANGED
@@ -27,6 +27,17 @@ class HT_CTC_Admin_Other_Settings {
27
  'click-to-chat-other-settings',
28
  array( $this, 'settings_page' )
29
  );
 
 
 
 
 
 
 
 
 
 
 
30
  }
31
 
32
  public function settings_page() {
@@ -204,10 +215,9 @@ class HT_CTC_Admin_Other_Settings {
204
  if ( ! defined( 'HT_CTC_PRO_VERSION' ) ) {
205
  ?>
206
  <br>
207
- <p class="description">PRO - In pro version we can add Conversion ID, Conversion label direclty (no need to add gtag_report_conversion)</p>
208
  <?php
209
  }
210
-
211
  ?>
212
 
213
  </div>
@@ -585,21 +595,14 @@ class HT_CTC_Admin_Other_Settings {
585
  <?php
586
  }
587
 
 
 
588
  // debug mode
589
- if ( isset( $options['debug_mode'] ) ) {
590
- ?>
591
- <p>
592
- <label>
593
- <input name="ht_ctc_othersettings[debug_mode]" type="checkbox" value="1" <?php checked( $options['debug_mode'], 1 ); ?> id="debug_mode" />
594
- <span><?php _e( 'Debug mode', 'click-to-chat-for-whatsapp' ); ?></span>
595
- </label>
596
- </p>
597
- <?php
598
- } else {
599
  ?>
600
  <p>
601
  <label>
602
- <input name="ht_ctc_othersettings[debug_mode]" type="checkbox" value="1" id="debug_mode" />
603
  <span><?php _e( 'Debug mode', 'click-to-chat-for-whatsapp' ); ?></span>
604
  </label>
605
  </p>
27
  'click-to-chat-other-settings',
28
  array( $this, 'settings_page' )
29
  );
30
+
31
+ if ( ! defined( 'HT_CTC_PRO_VERSION' ) ) {
32
+ add_submenu_page(
33
+ 'click-to-chat',
34
+ __('Go Premium', 'click-to-chat-for-whatsapp'),
35
+ '<span class="dashicons dashicons-star-filled" style="color: #ff8c00"></span><span id="ht-ctc-go-pro-link" style="color: #ff8c00;font-weight: 500;display: inline-block;margin-left: 5px;margin-top: 2px;">' . __('Go Premium', 'click-to-chat-for-whatsapp') . '</span>',
36
+ 'manage_options',
37
+ 'https://holithemes.com/plugins/click-to-chat/pricing/'
38
+ );
39
+ }
40
+
41
  }
42
 
43
  public function settings_page() {
215
  if ( ! defined( 'HT_CTC_PRO_VERSION' ) ) {
216
  ?>
217
  <br>
218
+ <p class="description"><a href="https://holithemes.com/plugins/click-to-chat/google-ads-conversion/#pro_block">PRO</a>: Add Conversion ID, Conversion label direclty (no need to setup gtag_report_conversion)</p>
219
  <?php
220
  }
 
221
  ?>
222
 
223
  </div>
595
  <?php
596
  }
597
 
598
+ $debug_mode = ( isset( $options['debug_mode']) ) ? esc_attr( $options['debug_mode'] ) : '';
599
+
600
  // debug mode
601
+ if ( isset( $options['debug_mode'] ) || (isset($_GET) && isset($_GET['debug'])) ) {
 
 
 
 
 
 
 
 
 
602
  ?>
603
  <p>
604
  <label>
605
+ <input name="ht_ctc_othersettings[debug_mode]" type="checkbox" value="1" <?php checked( $debug_mode, 1 ); ?> id="debug_mode" />
606
  <span><?php _e( 'Debug mode', 'click-to-chat-for-whatsapp' ); ?></span>
607
  </label>
608
  </p>
new/admin/db/class-ht-ctc-db.php CHANGED
@@ -199,33 +199,43 @@ class HT_CTC_DB {
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
- 'v3_3_5' => 'v3_3_5',
 
 
225
  );
226
 
227
- // Always use update_option - override new values .. don't preseve already existing values
228
- update_option( 'ht_ctc_plugin_details', $values );
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  }
230
 
231
 
199
  /**
200
  * name: ht_ctc_plugin_details
201
  *
 
 
 
202
  * Add plugin Details to db
203
+ * Add plugin version to db - useful for upgrading db - class-ht-ctc-update-db.php
204
+ * update version value for each update.
 
 
 
 
 
 
205
  *
206
+ * first_install_time @since v3.7 ( if installed before v3.7 first_install_time will be the first plugin version upgrade time of v3.7 or + )
207
+ * v3, v3_2_5, v3_3_3, v3_3_5 - values changed to time @since v3.7
208
  */
209
  public function ht_ctc_plugin_details() {
210
 
211
+ $time = time();
212
+
213
  // plugin details
214
  $values = array(
215
  'version' => HT_CTC_VERSION,
216
+ 'first_install_time' => $time,
217
+ 'v3' => $time,
218
+ 'v3_2_5' => $time,
219
+ 'v3_3_3' => $time,
220
+ 'v3_3_5' => $time,
221
+ 'v3_7' => $time,
222
  );
223
 
224
+ $db_values = get_option( 'ht_ctc_plugin_details', array() );
225
+
226
+ // extra safe instead of directly merge.
227
+ $update_values = $values;
228
+ if (is_array($db_values)) {
229
+ $update_values = array_merge($values, $db_values);
230
+ }
231
+
232
+ /**
233
+ * IMP: have to update version number..
234
+ * (always use the latest value)
235
+ */
236
+ $update_values['version'] = HT_CTC_VERSION;
237
+
238
+ update_option( 'ht_ctc_plugin_details', $update_values );
239
  }
240
 
241
 
new/admin/db/class-ht-ctc-db2.php CHANGED
@@ -585,12 +585,18 @@ class HT_CTC_DB2 {
585
  *
586
  * Add plugin Details to db
587
  * Add plugin version to db - useful while updating plugin
 
 
 
588
  */
589
  public function ht_ctc_one_time() {
590
 
 
 
591
  // plugin details
592
  $values = array(
593
  'first_version' => HT_CTC_VERSION,
 
594
  );
595
 
596
  // dont update values. .. one time values ..
585
  *
586
  * Add plugin Details to db
587
  * Add plugin version to db - useful while updating plugin
588
+ *
589
+ * @since 3.7
590
+ * first_install_time - as add_option, first_install_time avaible only since 3.7
591
  */
592
  public function ht_ctc_one_time() {
593
 
594
+ $time = time();
595
+
596
  // plugin details
597
  $values = array(
598
  'first_version' => HT_CTC_VERSION,
599
+ 'first_install_time' => $time
600
  );
601
 
602
  // dont update values. .. one time values ..
new/inc/class-ht-ctc-register.php CHANGED
@@ -94,6 +94,10 @@ class HT_CTC_Register {
94
  'settings' => '<a href="' . admin_url( 'admin.php?page=click-to-chat' ) . '">' . __( 'Settings' , 'click-to-chat-for-whatsapp' ) . '</a>',
95
  );
96
 
 
 
 
 
97
  return array_merge( $new_links, $links );
98
  }
99
 
94
  'settings' => '<a href="' . admin_url( 'admin.php?page=click-to-chat' ) . '">' . __( 'Settings' , 'click-to-chat-for-whatsapp' ) . '</a>',
95
  );
96
 
97
+ if ( ! defined( 'HT_CTC_PRO_VERSION' ) ) {
98
+ $links['pro'] = '<a target="_blank" rel="noreferrer noopener" href="https://holithemes.com/plugins/click-to-chat/pricing/"><strong style="display: inline; color:#11a485;">' . __( 'PRO Version' , 'click-to-chat-for-whatsapp' ) . '</strong></a>';
99
+ }
100
+
101
  return array_merge( $new_links, $links );
102
  }
103
 
new/inc/group/class-ht-ctc-group.php CHANGED
@@ -73,9 +73,10 @@ class HT_CTC_Group {
73
  $ht_ctc_group['display_mobile'] = (isset($options['display_mobile'])) ? esc_attr($options['display_mobile']) : 'show';
74
  $ht_ctc_group['display_desktop'] = (isset($options['display_desktop'])) ? esc_attr($options['display_desktop']) : 'show';
75
 
 
 
76
 
77
-
78
- $ht_ctc_group['css'] = "display: none; cursor: pointer; z-index: 99999999;";
79
 
80
  // analytics
81
  $ht_ctc_os['is_ga_enable'] = 'yes';
73
  $ht_ctc_group['display_mobile'] = (isset($options['display_mobile'])) ? esc_attr($options['display_mobile']) : 'show';
74
  $ht_ctc_group['display_desktop'] = (isset($options['display_desktop'])) ? esc_attr($options['display_desktop']) : 'show';
75
 
76
+ $zindex = (isset($othersettings['zindex'])) ? esc_attr($othersettings['zindex']) : '';
77
+ $zindex = ('' == $zindex) ? '99999999' : $zindex;
78
 
79
+ $ht_ctc_group['css'] = "display: none; cursor: pointer; z-index: $zindex;";
 
80
 
81
  // analytics
82
  $ht_ctc_os['is_ga_enable'] = 'yes';
new/inc/share/class-ht-ctc-share.php CHANGED
@@ -90,7 +90,10 @@ class HT_CTC_Share {
90
  $ht_ctc_share['display_mobile'] = (isset($options['display_mobile'])) ? esc_attr($options['display_mobile']) : 'show';
91
  $ht_ctc_share['display_desktop'] = (isset($options['display_desktop'])) ? esc_attr($options['display_desktop']) : 'show';
92
 
93
- $ht_ctc_share['css'] = "display: none; cursor: pointer; z-index: 99999999;";
 
 
 
94
 
95
  // analytics
96
  $ht_ctc_os['is_ga_enable'] = 'yes';
90
  $ht_ctc_share['display_mobile'] = (isset($options['display_mobile'])) ? esc_attr($options['display_mobile']) : 'show';
91
  $ht_ctc_share['display_desktop'] = (isset($options['display_desktop'])) ? esc_attr($options['display_desktop']) : 'show';
92
 
93
+ $zindex = (isset($othersettings['zindex'])) ? esc_attr($othersettings['zindex']) : '';
94
+ $zindex = ('' == $zindex) ? '99999999' : $zindex;
95
+
96
+ $ht_ctc_share['css'] = "display: none; cursor: pointer; z-index: $zindex;";
97
 
98
  // analytics
99
  $ht_ctc_os['is_ga_enable'] = 'yes';
new/tools/woo/woo-admin/class-ht-ctc-admin-woo-page.php CHANGED
@@ -238,7 +238,7 @@ class HT_CTC_Admin_Woo_Page {
238
  <option value="7" <?= $woo_style == 7 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7', 'click-to-chat-for-whatsapp' ); ?></option>
239
  <option value="7_1" <?= $woo_style == '7_1' ? 'SELECTED' : ''; ?> >&emsp;<?php _e( 'Style-7 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
240
  <option value="8" <?= $woo_style == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
241
- <option value="99" <?= $woo_style == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-99 (Add your own image / GIF)', 'click-to-chat-for-whatsapp' ); ?></option>
242
  </select>
243
  <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=woo"><?php _e( 'List of Styles', 'click-to-chat-for-whatsapp' ); ?></a> &emsp; | &emsp; <span><a target="_blank" href="<?= admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">Customize the styles</a></span> </p>
244
  <p class="description"><strong>Recommended Styles: 1, 8</strong></p>
@@ -352,7 +352,7 @@ class HT_CTC_Admin_Woo_Page {
352
  <option value="7" <?= $woo_shop_style == 7 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7', 'click-to-chat-for-whatsapp' ); ?></option>
353
  <option value="7_1" <?= $woo_shop_style == '7_1' ? 'SELECTED' : ''; ?> >&emsp;<?php _e( 'Style-7 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
354
  <option value="8" <?= $woo_shop_style == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
355
- <option value="99" <?= $woo_shop_style == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-99 (Add your own image / GIF)', 'click-to-chat-for-whatsapp' ); ?></option>
356
  </select>
357
  <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=woo"><?php _e( 'List of Styles', 'click-to-chat-for-whatsapp' ); ?></a> &emsp; | &emsp; <span><a target="_blank" href="<?= admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">Customize the styles</a></span> </p>
358
  <p class="description"><b>Recommended Styles: 1, 8</b></p>
@@ -420,9 +420,9 @@ class HT_CTC_Admin_Woo_Page {
420
  <p class="description"><a target="_blank" href="<?= $cart_admin_url ?>">Edit Cart Page</a> </p>
421
  <p class="description"><a target="_blank" href="<?= $checkout_admin_url ?>">Edit Checkout Page</a> </p>
422
  <p class="description"><a target="_blank" href="<?= $myaccount_admin_url ?>">Edit My Account Page</a> </p>
423
-
424
  <br>
425
- <p class="description">(Edit -> Settings Icon - At the right Sidebar 'Click to Chat' metabox) <br> Number, Call to Action, Prefilled Message, <br> PRO: Time Delay, Scroll Delay, Style <br> <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/change-values-at-page-level/">Page Level Settings</a></p>
426
  <?php
427
  }
428
 
238
  <option value="7" <?= $woo_style == 7 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7', 'click-to-chat-for-whatsapp' ); ?></option>
239
  <option value="7_1" <?= $woo_style == '7_1' ? 'SELECTED' : ''; ?> >&emsp;<?php _e( 'Style-7 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
240
  <option value="8" <?= $woo_style == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
241
+ <option value="99" <?= $woo_style == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Add your own image / GIF (Style-99)', 'click-to-chat-for-whatsapp' ); ?></option>
242
  </select>
243
  <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=woo"><?php _e( 'List of Styles', 'click-to-chat-for-whatsapp' ); ?></a> &emsp; | &emsp; <span><a target="_blank" href="<?= admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">Customize the styles</a></span> </p>
244
  <p class="description"><strong>Recommended Styles: 1, 8</strong></p>
352
  <option value="7" <?= $woo_shop_style == 7 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7', 'click-to-chat-for-whatsapp' ); ?></option>
353
  <option value="7_1" <?= $woo_shop_style == '7_1' ? 'SELECTED' : ''; ?> >&emsp;<?php _e( 'Style-7 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
354
  <option value="8" <?= $woo_shop_style == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
355
+ <option value="99" <?= $woo_shop_style == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Add your own image / GIF (Style-99)', 'click-to-chat-for-whatsapp' ); ?></option>
356
  </select>
357
  <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=woo"><?php _e( 'List of Styles', 'click-to-chat-for-whatsapp' ); ?></a> &emsp; | &emsp; <span><a target="_blank" href="<?= admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">Customize the styles</a></span> </p>
358
  <p class="description"><b>Recommended Styles: 1, 8</b></p>
420
  <p class="description"><a target="_blank" href="<?= $cart_admin_url ?>">Edit Cart Page</a> </p>
421
  <p class="description"><a target="_blank" href="<?= $checkout_admin_url ?>">Edit Checkout Page</a> </p>
422
  <p class="description"><a target="_blank" href="<?= $myaccount_admin_url ?>">Edit My Account Page</a> </p>
423
+
424
  <br>
425
+ <p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/change-values-at-page-level/">Page Level Settings</a> <br> Number, Call to Action, Prefilled Message, <br> <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/pricing/">PRO</a>: Style, Time Delay, Scroll Delay</p>
426
  <?php
427
  }
428
 
prev/admin/class-ccw-admin-page.php CHANGED
@@ -172,7 +172,7 @@ class CCW_Admin_Page {
172
  <option value="7" <?= $style_value == 7 ? 'SELECTED' : ''; ?> >Style-7</option>
173
  <option value="8" <?= $style_value == 8 ? 'SELECTED' : ''; ?> >Style-8</option>
174
  <option value="9" <?= $style_value == 9 ? 'SELECTED' : ''; ?> >Style-9</option>
175
- <option value="99" <?= $style_value == 99 ? 'SELECTED' : ''; ?> >Style-99 ( Add your own Image / GIF )</option>
176
  <option value="0" <?= $style_value == 0 ? 'SELECTED' : ''; ?> >Hide on Desktop Devices</option>
177
  </select>
178
  <label>Select Style for Desktop</label>
@@ -201,7 +201,7 @@ class CCW_Admin_Page {
201
  <option value="7" <?= $style_mobile_value == 7 ? 'SELECTED' : ''; ?> >Style-7</option>
202
  <option value="8" <?= $style_mobile_value == 8 ? 'SELECTED' : ''; ?> >Style-8</option>
203
  <option value="9" <?= $style_mobile_value == 9 ? 'SELECTED' : ''; ?> >Style-9</option>
204
- <option value="99" <?= $style_mobile_value == 99 ? 'SELECTED' : ''; ?> >Style-99 ( Add your own Image / GIF )</option>
205
  <option value="0" <?= $style_mobile_value == 0 ? 'SELECTED' : ''; ?> >Hide on Mobile Devices</option>
206
  </select>
207
  <label>Select Style for Mobile Devices</label>
172
  <option value="7" <?= $style_value == 7 ? 'SELECTED' : ''; ?> >Style-7</option>
173
  <option value="8" <?= $style_value == 8 ? 'SELECTED' : ''; ?> >Style-8</option>
174
  <option value="9" <?= $style_value == 9 ? 'SELECTED' : ''; ?> >Style-9</option>
175
+ <option value="99" <?= $style_value == 99 ? 'SELECTED' : ''; ?> >Add your own image / GIF (Style-99)</option>
176
  <option value="0" <?= $style_value == 0 ? 'SELECTED' : ''; ?> >Hide on Desktop Devices</option>
177
  </select>
178
  <label>Select Style for Desktop</label>
201
  <option value="7" <?= $style_mobile_value == 7 ? 'SELECTED' : ''; ?> >Style-7</option>
202
  <option value="8" <?= $style_mobile_value == 8 ? 'SELECTED' : ''; ?> >Style-8</option>
203
  <option value="9" <?= $style_mobile_value == 9 ? 'SELECTED' : ''; ?> >Style-9</option>
204
+ <option value="99" <?= $style_mobile_value == 99 ? 'SELECTED' : ''; ?> >Add your own image / GIF (Style-99)</option>
205
  <option value="0" <?= $style_mobile_value == 0 ? 'SELECTED' : ''; ?> >Hide on Mobile Devices</option>
206
  </select>
207
  <label>Select Style for Mobile Devices</label>
readme.txt CHANGED
@@ -3,7 +3,7 @@ Requires at least: 4.6
3
  Tested up to: 5.8.2
4
  Requires PHP: 5.6
5
  Contributors: holithemes
6
- Stable tag: 3.6
7
  Tags: whatsapp, whatsapp business, click to chat, whatsapp chat, whatsapp support, whatsapp group, whatsapp message, WhatsApp WooCommerce, whatsapp wordpress, whatsapp floating button, whatsapp icon, holithemes
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -128,6 +128,7 @@ At page level we can overwrite the settings. Each post we can add different What
128
  * Display Settings
129
 
130
  PRO:
 
131
  * Styles
132
  * Time Dealy
133
  * Scroll Dealy
@@ -199,6 +200,7 @@ We highly concentrate on speed, performance.
199
  == 👓 Display Settings ==
200
 
201
  Show/Hide styles based on
 
202
  * Post type
203
  * Post Id
204
  * Category name
@@ -206,6 +208,7 @@ Show/Hide styles based on
206
  * WooCommerce single product pages
207
 
208
  PRO:
 
209
  * Time delay
210
  * Scroll delay
211
  * Selected Days in a week
@@ -478,6 +481,11 @@ After Activate the plugin, add WhatsApp Number at plugin settings.
478
 
479
  == Changelog ==
480
 
 
 
 
 
 
481
  = 3.6 =
482
  * Enchantment: settings pages
483
 
3
  Tested up to: 5.8.2
4
  Requires PHP: 5.6
5
  Contributors: holithemes
6
+ Stable tag: 3.7
7
  Tags: whatsapp, whatsapp business, click to chat, whatsapp chat, whatsapp support, whatsapp group, whatsapp message, WhatsApp WooCommerce, whatsapp wordpress, whatsapp floating button, whatsapp icon, holithemes
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
128
  * Display Settings
129
 
130
  PRO:
131
+
132
  * Styles
133
  * Time Dealy
134
  * Scroll Dealy
200
  == 👓 Display Settings ==
201
 
202
  Show/Hide styles based on
203
+
204
  * Post type
205
  * Post Id
206
  * Category name
208
  * WooCommerce single product pages
209
 
210
  PRO:
211
+
212
  * Time delay
213
  * Scroll delay
214
  * Selected Days in a week
481
 
482
  == Changelog ==
483
 
484
+ = 3.7 =
485
+ * Enchantment: Admin settings
486
+ * Enchantment: Add your own image style.
487
+ * update z-index now for chat, group, share features
488
+
489
  = 3.6 =
490
  * Enchantment: settings pages
491