LiveChat – WP live chat plugin for WordPress - Version 3.6.2

Version Description

  • Tested up to Wordpress 5.0.
  • Removed Disable sounds option.
Download this release

Release Info

Developer livechat
Plugin Icon 128x128 LiveChat – WP live chat plugin for WordPress
Version 3.6.2
Comparing to
See all releases

Code changes from version 3.6.1 to 3.6.2

languages/wp-live-chat-software-for-wordpress.pot CHANGED
@@ -87,10 +87,6 @@ msgstr ""
87
  msgid "Hide chat on mobile"
88
  msgstr ""
89
 
90
- #: ../plugin_files/helpers/SettingsHelper.class.php:77
91
- msgid "Disable chat window sounds"
92
- msgstr ""
93
-
94
  #: ../plugin_files/helpers/SettingsHelper.class.php:89
95
  msgid "Hide chat for Guest visitors"
96
  msgstr ""
87
  msgid "Hide chat on mobile"
88
  msgstr ""
89
 
 
 
 
 
90
  #: ../plugin_files/helpers/SettingsHelper.class.php:89
91
  msgid "Hide chat for Guest visitors"
92
  msgstr ""
livechat.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.livechatinc.com/addons/wordpress/
5
  Description: Live chat software for live help, online sales and customer support. This plugin allows to quickly install LiveChat on any WordPress website.
6
  Author: LiveChat
7
  Author URI: http://www.livechatinc.com
8
- Version: 3.6.1
9
  Text Domain: wp-live-chat-software-for-wordpress
10
  Domain Path: /languages
11
  */
5
  Description: Live chat software for live help, online sales and customer support. This plugin allows to quickly install LiveChat on any WordPress website.
6
  Author: LiveChat
7
  Author URI: http://www.livechatinc.com
8
+ Version: 3.6.2
9
  Text Domain: wp-live-chat-software-for-wordpress
10
  Domain Path: /languages
11
  */
plugin_files/LiveChat.class.php CHANGED
@@ -76,10 +76,7 @@ class LiveChat
76
  */
77
  public function get_license_number()
78
  {
79
- if (is_null($this->license_number))
80
- {
81
- $this->license_number = get_option('livechat_license_number');
82
- }
83
 
84
  // license_number must be >= 0
85
  // also, this prevents from NaN values
@@ -108,7 +105,6 @@ class LiveChat
108
  */
109
  public function get_settings()
110
  {
111
- $settings['disableSounds'] = get_option('livechat_disable_sounds');
112
  $settings['disableMobile'] = get_option('livechat_disable_mobile');
113
  $settings['disableGuests'] = get_option('livechat_disable_guests');
114
 
76
  */
77
  public function get_license_number()
78
  {
79
+ $this->license_number = get_option('livechat_license_number');
 
 
 
80
 
81
  // license_number must be >= 0
82
  // also, this prevents from NaN values
105
  */
106
  public function get_settings()
107
  {
 
108
  $settings['disableMobile'] = get_option('livechat_disable_mobile');
109
  $settings['disableGuests'] = get_option('livechat_disable_guests');
110
 
plugin_files/LiveChatAdmin.class.php CHANGED
@@ -42,17 +42,17 @@ final class LiveChatAdmin extends LiveChat
42
  parent::__construct();
43
 
44
  add_action('init', array($this, 'load_translations'));
 
45
 
46
  // notice action
47
- if( $this->check_review_notice_conditions() ) {
48
- add_action( 'init', array($this, 'load_review_scripts') );
49
- add_action( 'wp_ajax_lc_review_dismiss', array($this, 'ajax_review_dismiss') );
50
- add_action( 'wp_ajax_lc_review_postpone', array($this, 'ajax_review_postpone') );
51
- add_action( 'admin_notices', array( $this, 'show_review_notice' ) );
52
  }
53
 
54
- if (isset($_GET['page']) && $_GET['page'] === 'livechat_settings')
55
- add_action('init', array($this, 'load_scripts'));
56
 
57
  add_action('admin_menu', array($this, 'admin_menu'));
58
 
@@ -62,12 +62,20 @@ final class LiveChatAdmin extends LiveChat
62
  add_action('init', array($this, 'error_reporting'));
63
  }
64
 
65
- if (isset($_GET['reset']) && $_GET['reset'] == '1' && $_GET['page'] === 'livechat_settings')
66
  {
67
  $this->reset_options();
68
  }
69
- elseif ($_SERVER['REQUEST_METHOD'] == 'POST' && strpos($_SERVER['HTTP_REFERER'], 'livechat_settings') !== false)
70
- {
 
 
 
 
 
 
 
 
71
  echo $this->update_options($_POST);
72
  }
73
  }
@@ -95,6 +103,14 @@ final class LiveChatAdmin extends LiveChat
95
  );
96
  }
97
 
 
 
 
 
 
 
 
 
98
  /**
99
  * Set error reporting for debugging purposes
100
  */
@@ -242,19 +258,18 @@ final class LiveChatAdmin extends LiveChat
242
  delete_option('livechat_email');
243
  delete_option('livechat_review_notice_start_timestamp');
244
  delete_option('livechat_review_notice_start_timestamp_offset');
245
- delete_option('livechat_disable_sounds');
246
  delete_option('livechat_disable_mobile');
247
  delete_option('livechat_disable_guests');
248
  }
249
 
250
  protected function check_review_notice_conditions()
251
  {
252
- if( !$this->check_if_review_notice_was_dismissed() ) {
253
- if ( $this->is_installed() && $this->check_if_license_is_active( $this->get_license_number() ) ) {
254
  $secondsInDay = 60 * 60 * 24;
255
  $noticeTimeout = time() - $this->get_review_notice_start_timestamp();
256
  $timestampOffset = $this->get_review_notice_start_timestamp_offset();
257
- if ( $noticeTimeout >= $secondsInDay * $timestampOffset ) {
258
  return true;
259
  }
260
  }
@@ -269,15 +284,15 @@ final class LiveChatAdmin extends LiveChat
269
  try {
270
  if(function_exists('curl_init')) {
271
  $curl = curl_init($url);
272
- curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
273
- $response = curl_exec( $curl );
274
- $code = curl_getinfo( $curl, CURLINFO_HTTP_CODE );
275
- curl_close( $curl );
276
 
277
- if ( $code === 200 ) {
278
- return json_decode( $response )->license_active;
279
  } else {
280
- throw new Exception( $code );
281
  }
282
  } else if(ini_get('allow_url_fopen') === '1' || strtolower(ini_get('allow_url_fopen')) === 'on') {
283
  $options = array(
@@ -287,7 +302,7 @@ final class LiveChatAdmin extends LiveChat
287
  );
288
  $context = stream_context_create($options);
289
  $result = file_get_contents($url, false, $context);
290
- return json_decode( $result )->license_active;
291
  }
292
  } catch(Exception $exception) {
293
  error_log(
@@ -314,8 +329,8 @@ final class LiveChatAdmin extends LiveChat
314
 
315
  public function ajax_review_postpone()
316
  {
317
- update_option( 'livechat_review_notice_start_timestamp', time() );
318
- update_option( 'livechat_review_notice_start_timestamp_offset', 7 );
319
  echo "OK";
320
  wp_die();
321
  }
@@ -324,14 +339,12 @@ final class LiveChatAdmin extends LiveChat
324
  {
325
  if (!isset($data['licenseEmail']) || !isset($data['licenseNumber']))
326
  {
327
- if(isset($data['disableSounds']) || isset($data['disableMobile']) || isset($data['disableGuests'])) {
328
- $disableSounds = isset( $data['disableSounds'] ) ? (int) $data['disableSounds'] : 0;
329
- $disableMobile = isset( $data['disableMobile'] ) ? (int) $data['disableMobile'] : 0;
330
- $disableGuests = isset( $data['disableGuests'] ) ? (int) $data['disableGuests'] : 0;
331
 
332
- update_option( 'livechat_disable_sounds', $disableSounds );
333
- update_option( 'livechat_disable_mobile', $disableMobile );
334
- update_option( 'livechat_disable_guests', $disableGuests );
335
 
336
  $array = array(
337
  'message' => 'success'
@@ -345,20 +358,19 @@ final class LiveChatAdmin extends LiveChat
345
 
346
  } else {
347
 
348
- $license_number = isset( $data['licenseNumber'] ) ? (int) $data['licenseNumber'] : 0;
349
- $email = isset( $data['licenseEmail'] ) ? (string) $data['licenseEmail'] : '';
350
 
351
- update_option( 'livechat_license_number', $license_number );
352
- update_option( 'livechat_email', $email );
353
 
354
- update_option( 'livechat_review_notice_start_timestamp', time() );
355
- update_option( 'livechat_review_notice_start_timestamp_offset', 45 );
356
 
357
- update_option( 'livechat_disable_sounds', 0 );
358
- update_option( 'livechat_disable_mobile', 0 );
359
- update_option( 'livechat_disable_guests', 0 );
360
 
361
- if ( isset( $data['changes_saved'] ) && $data['changes_saved'] == '1' ) {
362
  $this->changes_saved = true;
363
  }
364
  }
42
  parent::__construct();
43
 
44
  add_action('init', array($this, 'load_translations'));
45
+ add_action('init', array($this, 'load_menu_icon_styles'));
46
 
47
  // notice action
48
+ if($this->check_review_notice_conditions()) {
49
+ add_action('init', array($this, 'load_review_scripts'));
50
+ add_action('wp_ajax_lc_review_dismiss', array($this, 'ajax_review_dismiss'));
51
+ add_action('wp_ajax_lc_review_postpone', array($this, 'ajax_review_postpone'));
52
+ add_action('admin_notices', array($this, 'show_review_notice'));
53
  }
54
 
55
+ add_action('init', array($this, 'load_scripts'));
 
56
 
57
  add_action('admin_menu', array($this, 'admin_menu'));
58
 
62
  add_action('init', array($this, 'error_reporting'));
63
  }
64
 
65
+ if (array_key_exists('reset', $_GET) && $_GET['reset'] == '1' && $_GET['page'] === 'livechat_settings')
66
  {
67
  $this->reset_options();
68
  }
69
+ else if ((
70
+ array_key_exists('REQUEST_METHOD', $_SERVER) &&
71
+ $_SERVER['REQUEST_METHOD'] === 'POST' &&
72
+ array_key_exists('HTTP_REFERER', $_SERVER) &&
73
+ strpos($_SERVER['HTTP_REFERER'], 'livechat_settings') !== false
74
+ ) || (
75
+ !array_key_exists('HTTP_REFERER', $_SERVER) &&
76
+ array_key_exists('REQUEST_METHOD', $_SERVER) &&
77
+ $_SERVER['REQUEST_METHOD'] === 'POST'
78
+ )) {
79
  echo $this->update_options($_POST);
80
  }
81
  }
103
  );
104
  }
105
 
106
+ /**
107
+ * Fix CSS for icon in menu
108
+ */
109
+ public function load_menu_icon_styles()
110
+ {
111
+ wp_enqueue_style('livechat-menu', $this->get_plugin_url().'css/livechat-menu.css', false, $this->get_plugin_version());
112
+ }
113
+
114
  /**
115
  * Set error reporting for debugging purposes
116
  */
258
  delete_option('livechat_email');
259
  delete_option('livechat_review_notice_start_timestamp');
260
  delete_option('livechat_review_notice_start_timestamp_offset');
 
261
  delete_option('livechat_disable_mobile');
262
  delete_option('livechat_disable_guests');
263
  }
264
 
265
  protected function check_review_notice_conditions()
266
  {
267
+ if(!$this->check_if_review_notice_was_dismissed()) {
268
+ if ($this->is_installed() && $this->check_if_license_is_active($this->get_license_number())) {
269
  $secondsInDay = 60 * 60 * 24;
270
  $noticeTimeout = time() - $this->get_review_notice_start_timestamp();
271
  $timestampOffset = $this->get_review_notice_start_timestamp_offset();
272
+ if ($noticeTimeout >= $secondsInDay * $timestampOffset) {
273
  return true;
274
  }
275
  }
284
  try {
285
  if(function_exists('curl_init')) {
286
  $curl = curl_init($url);
287
+ curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
288
+ $response = curl_exec($curl);
289
+ $code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
290
+ curl_close($curl);
291
 
292
+ if ($code === 200) {
293
+ return json_decode($response)->license_active;
294
  } else {
295
+ throw new Exception($code);
296
  }
297
  } else if(ini_get('allow_url_fopen') === '1' || strtolower(ini_get('allow_url_fopen')) === 'on') {
298
  $options = array(
302
  );
303
  $context = stream_context_create($options);
304
  $result = file_get_contents($url, false, $context);
305
+ return json_decode($result)->license_active;
306
  }
307
  } catch(Exception $exception) {
308
  error_log(
329
 
330
  public function ajax_review_postpone()
331
  {
332
+ update_option('livechat_review_notice_start_timestamp', time());
333
+ update_option('livechat_review_notice_start_timestamp_offset', 7);
334
  echo "OK";
335
  wp_die();
336
  }
339
  {
340
  if (!isset($data['licenseEmail']) || !isset($data['licenseNumber']))
341
  {
342
+ if(array_key_exists('disableMobile', $data) || array_key_exists('disableGuests', $data)) {
343
+ $disableMobile = array_key_exists('disableMobile', $data) ? (int) $data['disableMobile'] : 0;
344
+ $disableGuests = array_key_exists('disableGuests', $data) ? (int) $data['disableGuests'] : 0;
 
345
 
346
+ update_option('livechat_disable_mobile', $disableMobile);
347
+ update_option('livechat_disable_guests', $disableGuests);
 
348
 
349
  $array = array(
350
  'message' => 'success'
358
 
359
  } else {
360
 
361
+ $license_number = isset($data['licenseNumber']) ? (int) $data['licenseNumber'] : 0;
362
+ $email = isset($data['licenseEmail']) ? (string) $data['licenseEmail'] : '';
363
 
364
+ update_option('livechat_license_number', $license_number);
365
+ update_option('livechat_email', $email);
366
 
367
+ update_option('livechat_review_notice_start_timestamp', time());
368
+ update_option('livechat_review_notice_start_timestamp_offset', 45);
369
 
370
+ update_option('livechat_disable_mobile', 0);
371
+ update_option('livechat_disable_guests', 0);
 
372
 
373
+ if (isset($data['changes_saved']) && $data['changes_saved'] == '1') {
374
  $this->changes_saved = true;
375
  }
376
  }
plugin_files/css/livechat-menu.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ a.toplevel_page_livechat div.wp-menu-image.dashicons-before img {
2
+ padding: 6px 0 0 2px !important;
3
+ }
plugin_files/css/livechat.css CHANGED
@@ -1,7 +1,3 @@
1
- a.toplevel_page_livechat div.wp-menu-image.dashicons-before img {
2
- padding: 6px 0 0 2px !important;
3
- }
4
-
5
  div#wordpress-livechat-container {
6
  padding-top: 80px;
7
  font-family: Lato, sans-serif;
 
 
 
 
1
  div#wordpress-livechat-container {
2
  padding-top: 80px;
3
  font-family: Lato, sans-serif;
plugin_files/helpers/SettingsHelper.class.php CHANGED
@@ -70,18 +70,6 @@ class SettingsHelper extends LiveChatHelper
70
  </label>
71
  </div>
72
  </div>
73
- <div>
74
- <div class="title">
75
- <span><?php _e('Disable chat window sounds', 'wp-live-chat-software-for-wordpress'); ?></span>
76
- </div>
77
- <div class="onoffswitch">
78
- <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="disableSounds" <?php echo ($settings['disableSounds']) ? 'checked': '' ?>>
79
- <label class="onoffswitch-label" for="disableSounds">
80
- <span class="onoffswitch-inner"></span>
81
- <span class="onoffswitch-switch"></span>
82
- </label>
83
- </div>
84
- </div>
85
  <div>
86
  <div class="title">
87
  <span><?php _e('Hide chat for Guest visitors', 'wp-live-chat-software-for-wordpress'); ?></span>
70
  </label>
71
  </div>
72
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
73
  <div>
74
  <div class="title">
75
  <span><?php _e('Hide chat for Guest visitors', 'wp-live-chat-software-for-wordpress'); ?></span>
plugin_files/helpers/TrackingCodeHelper.class.php CHANGED
@@ -33,30 +33,16 @@ TRACKING_CODE_START;
33
 
34
  VISITOR_DATA;
35
 
36
- $tracking .= <<<TRACKING_CODE_LOAD
37
  (function() {
38
  var lc = document.createElement('script'); lc.type = 'text/javascript'; lc.async = true;
39
  lc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.livechatinc.com/tracking.js';
40
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(lc, s);
41
  })();
42
-
43
- TRACKING_CODE_LOAD;
44
- if ($settings['disableSounds']) {
45
- $tracking .= <<<DISABLE_SOUNDS
46
-
47
- var LC_API = LC_API || {};
48
-
49
- LC_API.on_after_load = function () {
50
- LC_API.disable_sounds();
51
- }
52
-
53
- DISABLE_SOUNDS;
54
- }
55
-
56
- $tracking .= <<<TRACKING_CODE_END
57
  </script>
58
 
59
  TRACKING_CODE_END;
 
60
  $tracking .= <<<NOSCRIPT
61
  <noscript>
62
  <a href="https://www.livechatinc.com/chat-with/{$license_number}/">Chat with us</a>,
33
 
34
  VISITOR_DATA;
35
 
36
+ $tracking .= <<<TRACKING_CODE_END
37
  (function() {
38
  var lc = document.createElement('script'); lc.type = 'text/javascript'; lc.async = true;
39
  lc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.livechatinc.com/tracking.js';
40
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(lc, s);
41
  })();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  </script>
43
 
44
  TRACKING_CODE_END;
45
+
46
  $tracking .= <<<NOSCRIPT
47
  <noscript>
48
  <a href="https://www.livechatinc.com/chat-with/{$license_number}/">Chat with us</a>,
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === LiveChat - WP live chat plugin for WordPress ===
2
  Contributors: LiveChat
3
  Tags: chat plugin, live chat, live chat plugin, wordpress live chat, wordpress chat, wordpress live chat plugin, wordpress chat plugin, live chat software, live support, help desk, help desk software, online ticketing system, ticketing system, online support, ecommerce chat, chat online, chat software, sales, customer help, customer support, livechat, customer service software, chat, customer service chat, live chat button, live chat support, live chat tool, live chat widget, live support button, live chat solution, online live chat, online chat, wp chat, wp live chat, livechat inc, livechatinc, live chat inc, wp livechat support, smartsupp, smart supp, tidio, jivochat, formilla, tawk, tawkto, tawk.to, facebook, facebook messenger, messenger, facebook live chat, facebook chat, crisp, pure chat, purechat, zendesk, zendesk chat, liveagent, olark, happyfox, reve chat, chatra, provide support, comm100, kayako, zoho, zoho salesiq, userlike, userengage, drift, livehelpnow, live help now, intercom, freshdesk, zendesk, clickdesk, liveperson, live person, bold360, websitealive, website alive, velaro, hubspot, salesforce, zapier, zopim, mailchimp, analytics, google analytics, im chat, slack, casengo, tagove, wisechat, wise chat, mylivechat, my live chat, livezilla, chatrify
4
- Stable tag: 3.6.1
5
  Requires PHP: 5.6
6
- Tested up to: 4.9.8
7
  Requires at least: 3.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -160,7 +160,7 @@ LiveChat is a provider of cloud-based customers service platform with live suppo
160
 
161
  LiveChat’s ecosystem of products includes:
162
  - **[LiveChat](https://www.livechatinc.com/?utm_source=wordpress.org&utm_medium=integration&utm_campaign=WordpressIntegration)** - a communication tool that allows you to chat live with your customers.
163
- - **[BotEngine](https://www.botengine.ai/?utm_source=wordpress.org&utm_medium=integration&utm_campaign=WordpressIntegration)** - a bot framework for AI chat bots.
164
  - **[Knowledge Base](https://www.knowledgebase.ai/?utm_source=wordpress.org&utm_medium=integration&utm_campaign=WordpressIntegration)** - software that helps your LiveChat agents and website visitors at the same time. It consists of the Internal Widget and the public Help Center.
165
 
166
  == Frequently Asked Questions ==
@@ -307,6 +307,10 @@ For more detailed instructions, go to the [live chat plugin page](https://www.li
307
 
308
  == Changelog ==
309
 
 
 
 
 
310
  = 3.6.1 =
311
  * Fixed compatibility for servers without allow_url_fopen enabled.
312
 
1
  === LiveChat - WP live chat plugin for WordPress ===
2
  Contributors: LiveChat
3
  Tags: chat plugin, live chat, live chat plugin, wordpress live chat, wordpress chat, wordpress live chat plugin, wordpress chat plugin, live chat software, live support, help desk, help desk software, online ticketing system, ticketing system, online support, ecommerce chat, chat online, chat software, sales, customer help, customer support, livechat, customer service software, chat, customer service chat, live chat button, live chat support, live chat tool, live chat widget, live support button, live chat solution, online live chat, online chat, wp chat, wp live chat, livechat inc, livechatinc, live chat inc, wp livechat support, smartsupp, smart supp, tidio, jivochat, formilla, tawk, tawkto, tawk.to, facebook, facebook messenger, messenger, facebook live chat, facebook chat, crisp, pure chat, purechat, zendesk, zendesk chat, liveagent, olark, happyfox, reve chat, chatra, provide support, comm100, kayako, zoho, zoho salesiq, userlike, userengage, drift, livehelpnow, live help now, intercom, freshdesk, zendesk, clickdesk, liveperson, live person, bold360, websitealive, website alive, velaro, hubspot, salesforce, zapier, zopim, mailchimp, analytics, google analytics, im chat, slack, casengo, tagove, wisechat, wise chat, mylivechat, my live chat, livezilla, chatrify
4
+ Stable tag: 3.6.2
5
  Requires PHP: 5.6
6
+ Tested up to: 5.0
7
  Requires at least: 3.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
160
 
161
  LiveChat’s ecosystem of products includes:
162
  - **[LiveChat](https://www.livechatinc.com/?utm_source=wordpress.org&utm_medium=integration&utm_campaign=WordpressIntegration)** - a communication tool that allows you to chat live with your customers.
163
+ - **[ChatBot](https://www.chatbot.com/?utm_source=wordpress.org&utm_medium=integration&utm_campaign=WordpressIntegration)** - a bot framework for AI chat bots.
164
  - **[Knowledge Base](https://www.knowledgebase.ai/?utm_source=wordpress.org&utm_medium=integration&utm_campaign=WordpressIntegration)** - software that helps your LiveChat agents and website visitors at the same time. It consists of the Internal Widget and the public Help Center.
165
 
166
  == Frequently Asked Questions ==
307
 
308
  == Changelog ==
309
 
310
+ = 3.6.2 =
311
+ * Tested up to Wordpress 5.0.
312
+ * Removed Disable sounds option.
313
+
314
  = 3.6.1 =
315
  * Fixed compatibility for servers without allow_url_fopen enabled.
316