LiveChat – WP live chat plugin for WordPress - Version 3.6.0

Version Description

  • Translation ready plugin
Download this release

Release Info

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

Code changes from version 3.5.4 to 3.6.0

languages/wp-live-chat-software-for-wordpress.pot ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #, fuzzy
2
+ msgid ""
3
+ msgstr ""
4
+ "Project-Id-Version: wp-live-chat-software-for-wordpress\n"
5
+ "POT-Creation-Date: 2018-10-17 07:47+0200\n"
6
+ "PO-Revision-Date: 2018-10-17 01:07+0200\n"
7
+ "Last-Translator: \n"
8
+ "Language-Team: LiveChat, Inc <apps@livechatinc.com>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 2.2\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
+ "Language: en\n"
16
+ "X-Poedit-SourceCharset: UTF-8\n"
17
+ "X-Poedit-KeywordsList: __;_e\n"
18
+ "X-Poedit-SearchPath-0: ..\n"
19
+
20
+ #: ../plugin_files/LiveChatAdmin.class.php:195
21
+ #: ../plugin_files/LiveChatAdmin.class.php:196
22
+ #: ../plugin_files/LiveChatAdmin.class.php:232
23
+ msgid "Settings"
24
+ msgstr ""
25
+
26
+ #: ../plugin_files/helpers/ReviewNoticeHelper.class.php:11
27
+ msgid "Do you like LiveChat? Leave us a review and join our LiveChat Knowledge Journey!"
28
+ msgstr ""
29
+
30
+ #: ../plugin_files/helpers/ReviewNoticeHelper.class.php:12
31
+ msgid "We do our best to create the best live chat software available out there. Leave us a review, help us grow LiveChat and join our exclusive Knowledge Journey community. Learn how to:"
32
+ msgstr ""
33
+
34
+ #: ../plugin_files/helpers/ReviewNoticeHelper.class.php:14
35
+ msgid "Bring people to your website"
36
+ msgstr ""
37
+
38
+ #: ../plugin_files/helpers/ReviewNoticeHelper.class.php:15
39
+ msgid "Be the hero of your customers' needs"
40
+ msgstr ""
41
+
42
+ #: ../plugin_files/helpers/ReviewNoticeHelper.class.php:16
43
+ msgid "Sell like a boss with LiveChat"
44
+ msgstr ""
45
+
46
+ #: ../plugin_files/helpers/ReviewNoticeHelper.class.php:17
47
+ msgid "Succeed in customer success"
48
+ msgstr ""
49
+
50
+ #: ../plugin_files/helpers/ReviewNoticeHelper.class.php:20
51
+ msgid "Leave a review and join LiveChat Knowledge Journey!"
52
+ msgstr ""
53
+
54
+ #: ../plugin_files/helpers/ReviewNoticeHelper.class.php:21
55
+ msgid "Maybe later"
56
+ msgstr ""
57
+
58
+ #: ../plugin_files/helpers/ReviewNoticeHelper.class.php:22
59
+ msgid "I don’t use this app anymore"
60
+ msgstr ""
61
+
62
+ #: ../plugin_files/helpers/SettingsHelper.class.php:17
63
+ msgid "LiveChat is now installed on your website!"
64
+ msgstr ""
65
+
66
+ #: ../plugin_files/helpers/SettingsHelper.class.php:34
67
+ msgid "or"
68
+ msgstr ""
69
+
70
+ #: ../plugin_files/helpers/SettingsHelper.class.php:36
71
+ msgid "create an account"
72
+ msgstr ""
73
+
74
+ #: ../plugin_files/helpers/SettingsHelper.class.php:50
75
+ msgid "Currently you are using your"
76
+ msgstr ""
77
+
78
+ #: ../plugin_files/helpers/SettingsHelper.class.php:52
79
+ msgid "LiveChat account."
80
+ msgstr ""
81
+
82
+ #: ../plugin_files/helpers/SettingsHelper.class.php:56
83
+ msgid "Open web application"
84
+ msgstr ""
85
+
86
+ #: ../plugin_files/helpers/SettingsHelper.class.php:65
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 ""
97
+
98
+ #: ../plugin_files/helpers/SettingsHelper.class.php:101
99
+ msgid "Something went wrong?"
100
+ msgstr ""
101
+
102
+ #: ../plugin_files/helpers/SettingsHelper.class.php:102
103
+ msgid "Disconect your account."
104
+ msgstr ""
105
+
106
+ #: ../plugin_files/helpers/SettingsHelper.class.php:110
107
+ msgid "Check out our apps for"
108
+ msgstr ""
109
+
110
+ #: ../plugin_files/helpers/SettingsHelper.class.php:111
111
+ msgid "desktop or mobile!"
112
+ msgstr ""
livechat.php CHANGED
@@ -5,7 +5,9 @@ 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.5.4
 
 
9
  */
10
 
11
  if (is_admin())
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.0
9
+ Text Domain: wp-live-chat-software-for-wordpress
10
+ Domain Path: /languages
11
  */
12
 
13
  if (is_admin())
plugin_files/LiveChatAdmin.class.php CHANGED
@@ -41,12 +41,14 @@ final class LiveChatAdmin extends LiveChat
41
  {
42
  parent::__construct();
43
 
 
 
44
  // notice action
45
  if( $this->check_review_notice_conditions() ) {
46
  add_action( 'init', array($this, 'load_review_scripts') );
47
  add_action( 'wp_ajax_lc_review_dismiss', array($this, 'ajax_review_dismiss') );
48
  add_action( 'wp_ajax_lc_review_postpone', array($this, 'ajax_review_postpone') );
49
- add_action( 'admin_notices', array( $this, 'show_discount_notice' ) );
50
  }
51
 
52
  if (isset($_GET['page']) && $_GET['page'] === 'livechat_settings')
@@ -81,6 +83,18 @@ final class LiveChatAdmin extends LiveChat
81
  return self::$instance;
82
  }
83
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  /**
85
  * Set error reporting for debugging purposes
86
  */
@@ -104,6 +118,8 @@ final class LiveChatAdmin extends LiveChat
104
  }
105
 
106
  $plugin_folder = get_plugins('/'.plugin_basename(dirname(__FILE__).'/..'));
 
 
107
  $this->plugin_version = $plugin_folder['livechat.php']['Version'];
108
  }
109
 
@@ -178,8 +194,8 @@ final class LiveChatAdmin extends LiveChat
178
 
179
  add_submenu_page(
180
  'livechat',
181
- 'Settings',
182
- 'Settings',
183
  'administrator',
184
  'livechat_settings',
185
  array($this, 'livechat_settings_page')
@@ -233,12 +249,12 @@ final class LiveChatAdmin extends LiveChat
233
 
234
  protected function check_review_notice_conditions()
235
  {
236
- if( !$this->check_if_review_notice_was_dismissed()) {
237
  if ( $this->is_installed() && $this->check_if_license_is_active( $this->get_license_number() ) ) {
238
  $secondsInDay = 60 * 60 * 24;
239
  $noticeTimeout = time() - $this->get_review_notice_start_timestamp();
240
  $timestampOffset = $this->get_review_notice_start_timestamp_offset();
241
- if ($noticeTimeout >= $secondsInDay * $timestampOffset) {
242
  return true;
243
  }
244
  }
@@ -251,34 +267,20 @@ final class LiveChatAdmin extends LiveChat
251
  {
252
  $url = 'https://api.livechatinc.com/v2/license/' . $license_number;
253
  try {
254
- if(function_exists('curl_init')) {
255
- $curl = curl_init($url);
256
- curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
257
- $response = curl_exec( $curl );
258
- $code = curl_getinfo( $curl, CURLINFO_HTTP_CODE );
259
- curl_close( $curl );
260
-
261
- if ( $code === 200 ) {
262
- return json_decode( $response )->license_active;
263
- } else {
264
- throw new Exception( $code );
265
- }
266
- } else {
267
- $options = array(
268
- 'http' => array(
269
- 'method' => 'GET'
270
- ),
271
- );
272
- $context = stream_context_create($options);
273
- $result = file_get_contents($url, false, $context);
274
- return json_decode( $result )->license_active;
275
- }
276
  } catch(Exception $exception) {
277
  return false;
278
  }
279
  }
280
 
281
- public function show_discount_notice()
282
  {
283
  $this->get_helper('ReviewNotice');
284
  }
41
  {
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')
83
  return self::$instance;
84
  }
85
 
86
+ /**
87
+ * Make translation ready
88
+ */
89
+ public function load_translations()
90
+ {
91
+ load_plugin_textdomain(
92
+ 'wp-live-chat-software-for-wordpress',
93
+ false,
94
+ 'wp-live-chat-software-for-wordpress/languages'
95
+ );
96
+ }
97
+
98
  /**
99
  * Set error reporting for debugging purposes
100
  */
118
  }
119
 
120
  $plugin_folder = get_plugins('/'.plugin_basename(dirname(__FILE__).'/..'));
121
+ if(count($plugin_folder) === 0)
122
+ $plugin_folder['livechat.php'] = get_plugin_data(dirname(__FILE__).'/../livechat.php');
123
  $this->plugin_version = $plugin_folder['livechat.php']['Version'];
124
  }
125
 
194
 
195
  add_submenu_page(
196
  'livechat',
197
+ __('Settings', 'wp-live-chat-software-for-wordpress'),
198
+ __('Settings', 'wp-live-chat-software-for-wordpress'),
199
  'administrator',
200
  'livechat_settings',
201
  array($this, 'livechat_settings_page')
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
  }
267
  {
268
  $url = 'https://api.livechatinc.com/v2/license/' . $license_number;
269
  try {
270
+ $options = array(
271
+ 'http' => array(
272
+ 'method' => 'GET'
273
+ ),
274
+ );
275
+ $context = stream_context_create($options);
276
+ $result = file_get_contents($url, false, $context);
277
+ return json_decode( $result )->license_active;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
278
  } catch(Exception $exception) {
279
  return false;
280
  }
281
  }
282
 
283
+ public function show_review_notice()
284
  {
285
  $this->get_helper('ReviewNotice');
286
  }
plugin_files/helpers/ReviewNoticeHelper.class.php CHANGED
@@ -6,22 +6,28 @@ class ReviewNoticeHelper extends LiveChatHelper
6
  {
7
  public function render()
8
  {
9
- echo <<<NOTICE
10
- <div class="notice notice-info is-dismissible" id="lc-review-notice">
11
- <p>Do you like LiveChat? Leave us a review and join our LiveChat Knowledge Journey!</p>
12
- <p>We do our best to create the best live chat software available out there. Leave us a review, help us grow LiveChat and join our exclusive Knowledge Journey community. Learn how to:</p>
13
- <ul style="list-style-type:disc;list-style-position:inside;margin:0;padding:3px;">
14
- <li>Bring people to your website</li>
15
- <li>Be the hero of your customers' needs</li>
16
- <li>Sell like a boss with LiveChat</li>
17
- <li>Succeed in customer success</li>
18
- </ul>
19
- <p>
20
- <a href="https://wordpress.org/support/plugin/wp-live-chat-software-for-wordpress/reviews/#new-post" target="_blank" style="text-decoration: none" id="lc-review-now"><span class="dashicons dashicons-thumbs-up"></span> Leave a review and join LiveChat Knowledge Journey!</a> |
21
- <a href="#" style="text-decoration: none" id="lc-review-postpone"><span class="dashicons dashicons-clock"></span> Maybe later</a> |
22
- <a href="#" style="text-decoration: none" id="lc-review-dismiss"><span class="dashicons dashicons-no-alt"></span>I don’t use this app anymore</a>
23
- </p>
24
- </div>
25
- NOTICE;
 
 
 
 
 
 
26
  }
27
  }
6
  {
7
  public function render()
8
  {
9
+ ?>
10
+ <div class="notice notice-info is-dismissible" id="lc-review-notice">
11
+ <p><?php _e('Do you like LiveChat? Leave us a review and join our LiveChat Knowledge Journey!', 'wp-live-chat-software-for-wordpress'); ?></p>
12
+ <p><?php _e('We do our best to create the best live chat software available out there. Leave us a review, help us grow LiveChat and join our exclusive Knowledge Journey community. Learn how to:', 'wp-live-chat-software-for-wordpress'); ?></p>
13
+ <ul style="list-style-type:disc;list-style-position:inside;margin:0;padding:3px;">
14
+ <li><?php _e('Bring people to your website', 'wp-live-chat-software-for-wordpress'); ?></li>
15
+ <li><?php _e('Be the hero of your customers\' needs', 'wp-live-chat-software-for-wordpress'); ?></li>
16
+ <li><?php _e('Sell like a boss with LiveChat', 'wp-live-chat-software-for-wordpress'); ?></li>
17
+ <li><?php _e('Succeed in customer success', 'wp-live-chat-software-for-wordpress'); ?></li>
18
+ </ul>
19
+ <p>
20
+ <a href="https://wordpress.org/support/plugin/wp-live-chat-software-for-wordpress/reviews/#new-post" target="_blank" style="text-decoration: none" id="lc-review-now">
21
+ <span class="dashicons dashicons-thumbs-up"></span> <?php _e('Leave a review and join LiveChat Knowledge Journey!', 'wp-live-chat-software-for-wordpress'); ?>
22
+ </a> |
23
+ <a href="#" style="text-decoration: none" id="lc-review-postpone">
24
+ <span class="dashicons dashicons-clock"></span> <?php _e('Maybe later', 'wp-live-chat-software-for-wordpress'); ?>
25
+ </a> |
26
+ <a href="#" style="text-decoration: none" id="lc-review-dismiss">
27
+ <span class="dashicons dashicons-no-alt"></span><?php _e('I don’t use this app anymore', 'wp-live-chat-software-for-wordpress'); ?>
28
+ </a>
29
+ </p>
30
+ </div>
31
+ <?php
32
  }
33
  }
plugin_files/helpers/SettingsHelper.class.php CHANGED
@@ -4,27 +4,23 @@ require_once('LiveChatHelper.class.php');
4
 
5
  class SettingsHelper extends LiveChatHelper
6
  {
7
- public function render()
8
- {
9
 
10
- $license_email = LiveChat::get_instance()->get_login();
11
- $settings = LiveChat::get_instance()->get_settings();
 
12
 
13
- $notification = '';
14
-
15
- if (isset($_GET['actionType']) && $_GET['actionType'] === 'install') {
16
- $notification = '<div class="updated installed">
17
- <p>
18
- LiveChat is now installed on your website!
19
- </p>
20
- <span id="installed-close">x</span>
21
- </div>';
22
- }
23
-
24
- echo $notification;
25
- ?>
26
- <div id="wordpress-livechat-container">
27
- <?php if (LiveChat::get_instance()->is_installed() == false) { ?>
28
  <div class="wordpress-livechat-column-left">
29
  <div class="login-box-header">
30
  <img src="<?php echo plugins_url('wp-live-chat-software-for-wordpress').'/plugin_files/images/livechat-wordpress@2x.png'; ?>" alt="LiveChat + Wordpress" class="logo">
@@ -33,33 +29,29 @@ class SettingsHelper extends LiveChatHelper
33
  <p class="login-with-livechat"><br>
34
  <iframe id="login-with-livechat" src="https://addons.livechatinc.com/sign-in-with-livechat" > </iframe>
35
  </p>
36
- <p class="lc-or">or<br>
37
  <a href="https://my.livechatinc.com/signup?a=wordpress&utm_source=wordpress.org&utm_medium=integration&utm_campaign=wordpress_plugin" target="_blank" class="livechat-signup a-important">
38
- create an account
39
  </a>
40
  </p>
41
- <form id="licenseForm" action="?page=livechat_settings&actionType=install" method="post">actionType=install
42
  <input type="hidden" name="licenseEmail" id="licenseEmail">
43
  <input type="hidden" name="licenseNumber" id="licenseNumber">
44
  </form>
45
  </div>
46
  </div>
47
- <div class="wordpress-livechat-column-right">
48
- <p><img src="<?php echo plugins_url('wp-live-chat-software-for-wordpress').'/plugin_files/images/livechat-app.png'; ?>" alt="LiveChat apps" class="livechat-app"></p>
49
- <p class="apps-link">Check out our apps for <a href="https://www.livechatinc.com/applications/?utm_source=wordpress.org&utm_medium=integration&utm_campaign=wordpress_plugin" target="_blank" class="a-important">desktop or mobile!</a></p>
50
- </div>
51
- <?php } ?>
52
 
53
- <?php if (LiveChat::get_instance()->is_installed()): ?>
54
  <div class="wordpress-livechat-column-left">
55
  <div class="account">
56
- Currently you are using your<br>
57
  <strong><?php echo $license_email ?></strong><br>
58
- LiveChat account.
59
  </div>
60
  <p class="webapp">
61
  <a href="https://my.livechatinc.com/?utm_source=wordpress.org&utm_medium=integration&utm_campaign=wordpress_plugin" target="_blank">
62
- Open web application
63
  </a>
64
  </p>
65
  <div class="settings">
@@ -68,7 +60,7 @@ class SettingsHelper extends LiveChatHelper
68
  </p>
69
  <div>
70
  <div class="title">
71
- <span>Hide chat on mobile</span>
72
  </div>
73
  <div class="onoffswitch">
74
  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="disableMobile" <?php echo ($settings['disableMobile']) ? 'checked': '' ?>>
@@ -80,7 +72,7 @@ class SettingsHelper extends LiveChatHelper
80
  </div>
81
  <div>
82
  <div class="title">
83
- <span>Disable chat window sounds</span>
84
  </div>
85
  <div class="onoffswitch">
86
  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="disableSounds" <?php echo ($settings['disableSounds']) ? 'checked': '' ?>>
@@ -92,7 +84,7 @@ class SettingsHelper extends LiveChatHelper
92
  </div>
93
  <div>
94
  <div class="title">
95
- <span>Hide chat for Guest visitors</span>
96
  </div>
97
  <div class="onoffswitch">
98
  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="disableGuests" <?php echo ($settings['disableGuests']) ? 'checked': '' ?>>
@@ -104,17 +96,27 @@ class SettingsHelper extends LiveChatHelper
104
  </div>
105
  </div>
106
  <p class="disconenct">
107
- Something went wrong? <a id="resetAccount" href="?page=livechat_settings&reset=1" style="display: inline-block">
108
- Disconect your account.
109
  </a>
110
  </p>
 
 
 
 
 
 
111
  </div>
 
112
  <div class="wordpress-livechat-column-right">
113
- <p><img src="<?php echo plugins_url('wp-live-chat-software-for-wordpress').'/plugin_files/images/livechat-app.png'; ?>" alt="LiveChat apps" class="livechat-app"></p>
114
- <p class="apps-link">Check out our apps for <a href="https://www.livechatinc.com/applications/?utm_source=wordpress.org&utm_medium=integration&utm_campaign=wordpress_plugin" target="_blank" class="a-important">desktop or mobile!</a></p>
 
 
 
 
115
  </div>
116
- <?php endif; ?>
117
  </div>
118
- <?php
119
- }
120
  }
4
 
5
  class SettingsHelper extends LiveChatHelper
6
  {
7
+ public function render()
8
+ {
9
 
10
+ $license_email = LiveChat::get_instance()->get_login();
11
+ $license_id = LiveChat::get_instance()->get_license_number();
12
+ $settings = LiveChat::get_instance()->get_settings();
13
 
14
+ if (isset($_GET['actionType']) && $_GET['actionType'] === 'install') { ?>
15
+ <div class="updated installed">
16
+ <p>
17
+ <?php _e('LiveChat is now installed on your website!', 'wp-live-chat-software-for-wordpress'); ?>
18
+ </p>
19
+ <span id="installed-close">x</span>
20
+ </div>
21
+ <?php } ?>
22
+ <div id="wordpress-livechat-container">
23
+ <?php if (!LiveChat::get_instance()->is_installed()) : ?>
 
 
 
 
 
24
  <div class="wordpress-livechat-column-left">
25
  <div class="login-box-header">
26
  <img src="<?php echo plugins_url('wp-live-chat-software-for-wordpress').'/plugin_files/images/livechat-wordpress@2x.png'; ?>" alt="LiveChat + Wordpress" class="logo">
29
  <p class="login-with-livechat"><br>
30
  <iframe id="login-with-livechat" src="https://addons.livechatinc.com/sign-in-with-livechat" > </iframe>
31
  </p>
32
+ <p class="lc-or"><?php _e('or', 'wp-live-chat-software-for-wordpress'); ?><br>
33
  <a href="https://my.livechatinc.com/signup?a=wordpress&utm_source=wordpress.org&utm_medium=integration&utm_campaign=wordpress_plugin" target="_blank" class="livechat-signup a-important">
34
+ <?php _e('create an account', 'wp-live-chat-software-for-wordpress'); ?>
35
  </a>
36
  </p>
37
+ <form id="licenseForm" action="?page=livechat_settings&actionType=install" method="post">
38
  <input type="hidden" name="licenseEmail" id="licenseEmail">
39
  <input type="hidden" name="licenseNumber" id="licenseNumber">
40
  </form>
41
  </div>
42
  </div>
43
+ <?php endif; ?>
 
 
 
 
44
 
45
+ <?php if (LiveChat::get_instance()->is_installed()): ?>
46
  <div class="wordpress-livechat-column-left">
47
  <div class="account">
48
+ <?php _e('Currently you are using your', 'wp-live-chat-software-for-wordpress'); ?><br>
49
  <strong><?php echo $license_email ?></strong><br>
50
+ <?php _e('LiveChat account.', 'wp-live-chat-software-for-wordpress'); ?>
51
  </div>
52
  <p class="webapp">
53
  <a href="https://my.livechatinc.com/?utm_source=wordpress.org&utm_medium=integration&utm_campaign=wordpress_plugin" target="_blank">
54
+ <?php _e('Open web application', 'wp-live-chat-software-for-wordpress'); ?>
55
  </a>
56
  </p>
57
  <div class="settings">
60
  </p>
61
  <div>
62
  <div class="title">
63
+ <span><?php _e('Hide chat on mobile', 'wp-live-chat-software-for-wordpress'); ?></span>
64
  </div>
65
  <div class="onoffswitch">
66
  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="disableMobile" <?php echo ($settings['disableMobile']) ? 'checked': '' ?>>
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': '' ?>>
84
  </div>
85
  <div>
86
  <div class="title">
87
+ <span><?php _e('Hide chat for Guest visitors', 'wp-live-chat-software-for-wordpress'); ?></span>
88
  </div>
89
  <div class="onoffswitch">
90
  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="disableGuests" <?php echo ($settings['disableGuests']) ? 'checked': '' ?>>
96
  </div>
97
  </div>
98
  <p class="disconenct">
99
+ <?php _e('Something went wrong?', 'wp-live-chat-software-for-wordpress'); ?> <a id="resetAccount" href="?page=livechat_settings&reset=1" style="display: inline-block">
100
+ <?php _e('Disconect your account.', 'wp-live-chat-software-for-wordpress'); ?>
101
  </a>
102
  </p>
103
+ <script>
104
+ var lcDetails = {
105
+ license: <?php echo $license_id ?>,
106
+ email: '<?php echo $license_email ?>'
107
+ }
108
+ </script>
109
  </div>
110
+ <?php endif; ?>
111
  <div class="wordpress-livechat-column-right">
112
+ <p><img src="<?php echo plugins_url('wp-live-chat-software-for-wordpress').'/plugin_files/images/livechat-app.png'; ?>" alt="LiveChat apps" class="livechat-app"></p>
113
+ <p class="apps-link">
114
+ <?php _e('Check out our apps for', 'wp-live-chat-software-for-wordpress'); ?> <a href="https://www.livechatinc.com/applications/?utm_source=wordpress.org&utm_medium=integration&utm_campaign=wordpress_plugin" target="_blank" class="a-important">
115
+ <?php _e('desktop or mobile!', 'wp-live-chat-software-for-wordpress'); ?>
116
+ </a>
117
+ </p>
118
  </div>
 
119
  </div>
120
+ <?php
121
+ }
122
  }
plugin_files/helpers/TrackingCodeHelper.class.php CHANGED
@@ -53,7 +53,17 @@ TRACKING_CODE_LOAD;
53
  DISABLE_SOUNDS;
54
  }
55
 
56
- $tracking .= '</script>';
 
 
 
 
 
 
 
 
 
 
57
  }
58
  }
59
  }
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>,
63
+ powered by <a href="https://www.livechatinc.com/?welcome" rel="noopener" target="_blank">LiveChat</a>
64
+ </noscript>
65
+ NOSCRIPT;
66
+
67
  }
68
  }
69
  }
plugin_files/js/livechat.js CHANGED
@@ -2,10 +2,10 @@
2
  {
3
  var LiveChat =
4
  {
5
- init: function()
6
  {
7
  this.signInWithLiveChat();
8
- this.resetLink();
9
  this.hideInstalledNotification();
10
  this.settingsForm();
11
  },
@@ -28,9 +28,18 @@ var LiveChat =
28
  switch (lcDetails.type) {
29
  case 'logged-in':
30
  var licenseForm = $('div#wordpress-livechat-container div#useExistingAccount form#licenseForm');
31
- licenseForm.find('input#licenseEmail').val(lcDetails.email);
32
- licenseForm.find('input#licenseNumber').val(lcDetails.license);
33
- licenseForm.submit();
 
 
 
 
 
 
 
 
 
34
  break;
35
  case 'signed-out':
36
  $('#login-with-livechat').css('display', 'block');
@@ -51,13 +60,46 @@ var LiveChat =
51
  };
52
  },
53
 
54
- resetLink: function()
55
- {
56
- $('#reset_settings a').click(function()
57
- {
58
- return confirm('This will reset your LiveChat plugin settings. Continue?');
59
- })
60
- },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
  hideInstalledNotification: function () {
63
  var notificationElement = $('.updated.installed');
2
  {
3
  var LiveChat =
4
  {
5
+ init: function()
6
  {
7
  this.signInWithLiveChat();
8
+ this.bindDisconnect();
9
  this.hideInstalledNotification();
10
  this.settingsForm();
11
  },
28
  switch (lcDetails.type) {
29
  case 'logged-in':
30
  var licenseForm = $('div#wordpress-livechat-container div#useExistingAccount form#licenseForm');
31
+ if(licenseForm.length) {
32
+ licenseForm.find('input#licenseEmail').val(lcDetails.email);
33
+ licenseForm.find('input#licenseNumber').val(lcDetails.license);
34
+ LiveChat.sendEvent(
35
+ 'Integrations: User authorized the app',
36
+ lcDetails.license,
37
+ lcDetails.email,
38
+ function () {
39
+ licenseForm.submit();
40
+ }
41
+ );
42
+ }
43
  break;
44
  case 'signed-out':
45
  $('#login-with-livechat').css('display', 'block');
60
  };
61
  },
62
 
63
+ bindDisconnect: function() {
64
+ $('#resetAccount').click(function (e) {
65
+ e.preventDefault();
66
+ LiveChat.sendEvent(
67
+ 'Integrations: User unauthorized the app',
68
+ lcDetails.license,
69
+ lcDetails.email,
70
+ function () {
71
+ location.href = $('#resetAccount').attr('href');
72
+ }
73
+ );
74
+ });
75
+ },
76
+
77
+ sendEvent: function(eventName, license, email, callback) {
78
+ var amplitudeURL = 'https://queue.livechatinc.com/app_event/';
79
+ var data = {
80
+ "e" : JSON.stringify(
81
+ [{
82
+ "event_type": eventName,
83
+ "user_id": email,
84
+ "user_properties": {
85
+ "license": license
86
+ },
87
+ "product_name": "livechat",
88
+ "event_properties": {
89
+ "integration name": "wp-live-chat-software-for-wordpress"
90
+ }
91
+ }]
92
+ )
93
+ };
94
+ $.ajax({
95
+ url: amplitudeURL,
96
+ type: 'GET',
97
+ crossOrigin: true,
98
+ data: data
99
+ }).always(function () {
100
+ if(callback) callback();
101
+ });
102
+ },
103
 
104
  hideInstalledNotification: function () {
105
  var notificationElement = $('.updated.installed');
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.5.4
5
  Requires PHP: 5.6
6
- Tested up to: 4.9.5
7
  Requires at least: 3.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -307,6 +307,9 @@ For more detailed instructions, go to the [live chat plugin page](https://www.li
307
 
308
  == Changelog ==
309
 
 
 
 
310
  = 3.5.4 =
311
  * Fixed compatibility with servers without cURL support
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.0
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
307
 
308
  == Changelog ==
309
 
310
+ = 3.6.0 =
311
+ * Translation ready plugin
312
+
313
  = 3.5.4 =
314
  * Fixed compatibility with servers without cURL support
315