Version Description
- Updated to correct tag
Download this release
Release Info
Developer | livechat |
Plugin | LiveChat – WP live chat plugin for WordPress |
Version | 3.2.5 |
Comparing to | |
See all releases |
Code changes from version 3.2.4 to 3.2.5
- livechat.php +1 -1
- plugin_files/LiveChat.class.php +0 -40
- plugin_files/LiveChat.widget.php +0 -70
- plugin_files/LiveChatAdmin.class.php +7 -16
- plugin_files/css/livechat.css +4 -9
- plugin_files/helpers/ChatButtonHelper.class.php +0 -43
- plugin_files/helpers/ChatButtonInfoHelper.class.php +0 -31
- plugin_files/helpers/SettingsHelper.class.php +14 -26
- plugin_files/helpers/TrackingCodeHelper.class.php +8 -18
- plugin_files/helpers/TrackingCodeInfoHelper.class.php +1 -1
- readme.txt +4 -1
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.2.
|
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.2.5
|
9 |
*/
|
10 |
|
11 |
if (is_admin())
|
plugin_files/LiveChat.class.php
CHANGED
@@ -1,7 +1,5 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
require_once('LiveChat.widget.php');
|
4 |
-
|
5 |
class LiveChat
|
6 |
{
|
7 |
// singleton pattern
|
@@ -17,7 +15,6 @@ class LiveChat
|
|
17 |
*/
|
18 |
protected $login = null;
|
19 |
protected $license_number = null;
|
20 |
-
protected $lang = null;
|
21 |
protected $skill = null;
|
22 |
|
23 |
/**
|
@@ -31,7 +28,6 @@ class LiveChat
|
|
31 |
protected function __construct()
|
32 |
{
|
33 |
add_action ('wp_head', array($this, 'tracking_code'));
|
34 |
-
add_action('widgets_init', create_function('', 'return register_widget("LiveChatWidget");'));
|
35 |
}
|
36 |
|
37 |
public static function get_instance()
|
@@ -60,27 +56,6 @@ class LiveChat
|
|
60 |
return $this->plugin_url;
|
61 |
}
|
62 |
|
63 |
-
/**
|
64 |
-
* Returns true if current Wordpress theme supports widgets,
|
65 |
-
* false otherwise
|
66 |
-
*
|
67 |
-
* @return bool
|
68 |
-
*/
|
69 |
-
public function widgets_enabled()
|
70 |
-
{
|
71 |
-
global $wp_registered_sidebars;
|
72 |
-
|
73 |
-
return (bool)(sizeof($wp_registered_sidebars) > 0);
|
74 |
-
}
|
75 |
-
|
76 |
-
public function livechat_sanitize_lang ($lang)
|
77 |
-
{
|
78 |
-
$lang = trim($lang);
|
79 |
-
if (preg_match('/^[a-z]{2}$/', $lang)) return $lang;
|
80 |
-
|
81 |
-
return 'en';
|
82 |
-
}
|
83 |
-
|
84 |
/**
|
85 |
* Returns true if LiveChat license is set properly,
|
86 |
* false otherwise
|
@@ -124,21 +99,6 @@ class LiveChat
|
|
124 |
return $this->login;
|
125 |
}
|
126 |
|
127 |
-
/**
|
128 |
-
* Returns LiveChat language code
|
129 |
-
*
|
130 |
-
* @return string
|
131 |
-
*/
|
132 |
-
public function get_lang()
|
133 |
-
{
|
134 |
-
if (is_null($this->lang))
|
135 |
-
{
|
136 |
-
$this->lang = get_option('livechat_lang');
|
137 |
-
}
|
138 |
-
|
139 |
-
return $this->lang;
|
140 |
-
}
|
141 |
-
|
142 |
/**
|
143 |
* Returns LiveChat skill number
|
144 |
*
|
1 |
<?php
|
2 |
|
|
|
|
|
3 |
class LiveChat
|
4 |
{
|
5 |
// singleton pattern
|
15 |
*/
|
16 |
protected $login = null;
|
17 |
protected $license_number = null;
|
|
|
18 |
protected $skill = null;
|
19 |
|
20 |
/**
|
28 |
protected function __construct()
|
29 |
{
|
30 |
add_action ('wp_head', array($this, 'tracking_code'));
|
|
|
31 |
}
|
32 |
|
33 |
public static function get_instance()
|
56 |
return $this->plugin_url;
|
57 |
}
|
58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
/**
|
60 |
* Returns true if LiveChat license is set properly,
|
61 |
* false otherwise
|
99 |
return $this->login;
|
100 |
}
|
101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
/**
|
103 |
* Returns LiveChat skill number
|
104 |
*
|
plugin_files/LiveChat.widget.php
DELETED
@@ -1,70 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* LiveChat "click-to-chat" button widget
|
5 |
-
*/
|
6 |
-
|
7 |
-
class LiveChatWidget extends WP_Widget
|
8 |
-
{
|
9 |
-
private static $my_id_base = 'livechat_widget';
|
10 |
-
|
11 |
-
static public function get_id_base()
|
12 |
-
{
|
13 |
-
return self::$my_id_base;
|
14 |
-
}
|
15 |
-
|
16 |
-
function LiveChatWidget()
|
17 |
-
{
|
18 |
-
$this->WP_Widget('livechat_widget', 'LiveChat', array(
|
19 |
-
'classname' => 'LiveChatWidget',
|
20 |
-
'description' => 'Install "click-to-chat" button to let your visitors start a chat with you.'
|
21 |
-
), array(
|
22 |
-
'id_base' => self::$my_id_base
|
23 |
-
));
|
24 |
-
}
|
25 |
-
|
26 |
-
function form($instance)
|
27 |
-
{
|
28 |
-
if (LiveChat::get_instance()->is_installed())
|
29 |
-
{
|
30 |
-
echo <<<HTML
|
31 |
-
<p><strong>Everything is all right!</strong></p>
|
32 |
-
<p>To configure LiveChat, go to <a href="admin.php?page=livechat_settings">Settings</a>.</p>
|
33 |
-
HTML;
|
34 |
-
}
|
35 |
-
else
|
36 |
-
{
|
37 |
-
echo <<<HTML
|
38 |
-
<p>Your live chat button <strong>is not working yet</strong>.</p>
|
39 |
-
<p>You need to <a href="admin.php?page=livechat_settings">set up your LiveChat account</a> first.</p>
|
40 |
-
HTML;
|
41 |
-
}
|
42 |
-
}
|
43 |
-
|
44 |
-
function widget($args, $instance)
|
45 |
-
{
|
46 |
-
// Do not try to display click-to-chat button
|
47 |
-
// if LiveChat plugin is not configured properly
|
48 |
-
if (LiveChat::get_instance()->is_installed() == false) return;
|
49 |
-
|
50 |
-
$url = LiveChat::get_instance()->get_plugin_url();
|
51 |
-
|
52 |
-
$time = time();
|
53 |
-
$license = LiveChat::get_instance()->get_license_number();
|
54 |
-
$lang = LiveChat::get_instance()->get_lang();
|
55 |
-
$skill = LiveChat::get_instance()->get_skill();
|
56 |
-
|
57 |
-
echo <<<CODE
|
58 |
-
<div id="LiveChat_{$time}"><a href="http://www.livechatinc.com/?partner=lc_{$license}">live chat software</a></div>
|
59 |
-
|
60 |
-
<script type="text/javascript">
|
61 |
-
var __lc_buttons = __lc_buttons || [];
|
62 |
-
__lc_buttons.push({
|
63 |
-
elementId: 'LiveChat_{$time}',
|
64 |
-
language: '{$lang}',
|
65 |
-
skill: '{$skill}'
|
66 |
-
});
|
67 |
-
</script>
|
68 |
-
CODE;
|
69 |
-
}
|
70 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plugin_files/LiveChatAdmin.class.php
CHANGED
@@ -121,7 +121,7 @@ final class LiveChatAdmin extends LiveChat
|
|
121 |
}
|
122 |
|
123 |
// Settings link
|
124 |
-
add_filter('plugin_action_links', array($this, 'livechat_settings_link'));
|
125 |
}
|
126 |
|
127 |
/**
|
@@ -140,19 +140,18 @@ final class LiveChatAdmin extends LiveChat
|
|
140 |
$this->get_helper('ControlPanel');
|
141 |
}
|
142 |
|
143 |
-
public function chat_button_page()
|
144 |
-
{
|
145 |
-
$this->get_helper('ChatButton');
|
146 |
-
}
|
147 |
-
|
148 |
-
|
149 |
public function changes_saved()
|
150 |
{
|
151 |
return $this->changes_saved;
|
152 |
}
|
153 |
|
154 |
-
public function livechat_settings_link($links)
|
155 |
{
|
|
|
|
|
|
|
|
|
|
|
156 |
$settings_link = sprintf('<a href="admin.php?page=livechat_settings">%s</a>', __('Settings'));
|
157 |
array_unshift ($links, $settings_link);
|
158 |
return $links;
|
@@ -161,7 +160,6 @@ final class LiveChatAdmin extends LiveChat
|
|
161 |
protected function reset_options()
|
162 |
{
|
163 |
delete_option('livechat_license_number');
|
164 |
-
delete_option('livechat_lang');
|
165 |
delete_option('livechat_groups');
|
166 |
}
|
167 |
|
@@ -180,14 +178,7 @@ final class LiveChatAdmin extends LiveChat
|
|
180 |
$skill = max(0, $skill);
|
181 |
|
182 |
|
183 |
-
$lang = 'en';
|
184 |
-
if (isset($data['lang']) && preg_match('/^[a-z]{2}$/', $data['lang']))
|
185 |
-
{
|
186 |
-
$lang = $data['lang'];
|
187 |
-
}
|
188 |
-
|
189 |
update_option('livechat_license_number', $license_number);
|
190 |
-
update_option('livechat_lang', $lang);
|
191 |
update_option('livechat_groups', $skill);
|
192 |
|
193 |
if (isset($data['changes_saved']) && $data['changes_saved'] == '1')
|
121 |
}
|
122 |
|
123 |
// Settings link
|
124 |
+
add_filter('plugin_action_links', array($this, 'livechat_settings_link'), 10, 2);
|
125 |
}
|
126 |
|
127 |
/**
|
140 |
$this->get_helper('ControlPanel');
|
141 |
}
|
142 |
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
public function changes_saved()
|
144 |
{
|
145 |
return $this->changes_saved;
|
146 |
}
|
147 |
|
148 |
+
public function livechat_settings_link($links, $file)
|
149 |
{
|
150 |
+
if (basename($file) !== 'livechat.php')
|
151 |
+
{
|
152 |
+
return $links;
|
153 |
+
}
|
154 |
+
|
155 |
$settings_link = sprintf('<a href="admin.php?page=livechat_settings">%s</a>', __('Settings'));
|
156 |
array_unshift ($links, $settings_link);
|
157 |
return $links;
|
160 |
protected function reset_options()
|
161 |
{
|
162 |
delete_option('livechat_license_number');
|
|
|
163 |
delete_option('livechat_groups');
|
164 |
}
|
165 |
|
178 |
$skill = max(0, $skill);
|
179 |
|
180 |
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
update_option('livechat_license_number', $license_number);
|
|
|
182 |
update_option('livechat_groups', $skill);
|
183 |
|
184 |
if (isset($data['changes_saved']) && $data['changes_saved'] == '1')
|
plugin_files/css/livechat.css
CHANGED
@@ -58,7 +58,6 @@ hr.livechat { margin-bottom: 1em; height: 1px; border: 0; color: #999; backgroun
|
|
58 |
.ajax_message.message { background-image: none; text-indent: 0px; }
|
59 |
|
60 |
#control_panel { width: 99%; border: 0; }
|
61 |
-
#chat_button_code { font-family: "Courier New", Courier, monospace; width: 650px; height: 200px; font-size: 85%; }
|
62 |
|
63 |
#reset_settings {
|
64 |
font-size: 85%;
|
@@ -72,14 +71,6 @@ hr.livechat { margin-bottom: 1em; height: 1px; border: 0; color: #999; backgroun
|
|
72 |
margin-top: 20px;
|
73 |
}
|
74 |
|
75 |
-
a.toggle {
|
76 |
-
padding: 2px 0 3px 20px;
|
77 |
-
background: url(../images/plusminus.png) no-repeat 0 2px;
|
78 |
-
}
|
79 |
-
a.toggle.unfolded {
|
80 |
-
background-position: 0 -32px;
|
81 |
-
}
|
82 |
-
|
83 |
p.img {
|
84 |
}
|
85 |
p.img img {
|
@@ -135,4 +126,8 @@ p.img {
|
|
135 |
/* margin-top: 1px did not work as intended under Chrome */
|
136 |
position: relative;
|
137 |
top: 1px;
|
|
|
|
|
|
|
|
|
138 |
}
|
58 |
.ajax_message.message { background-image: none; text-indent: 0px; }
|
59 |
|
60 |
#control_panel { width: 99%; border: 0; }
|
|
|
61 |
|
62 |
#reset_settings {
|
63 |
font-size: 85%;
|
71 |
margin-top: 20px;
|
72 |
}
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
p.img {
|
75 |
}
|
76 |
p.img img {
|
126 |
/* margin-top: 1px did not work as intended under Chrome */
|
127 |
position: relative;
|
128 |
top: 1px;
|
129 |
+
}
|
130 |
+
|
131 |
+
#advanced {
|
132 |
+
margin-bottom: 0;
|
133 |
}
|
plugin_files/helpers/ChatButtonHelper.class.php
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
require_once('LiveChatHelper.class.php');
|
4 |
-
|
5 |
-
class ChatButtonHelper extends LiveChatHelper
|
6 |
-
{
|
7 |
-
public function render()
|
8 |
-
{
|
9 |
-
$url = LiveChat::get_instance()->get_plugin_url();
|
10 |
-
|
11 |
-
$time = time();
|
12 |
-
$license = LiveChat::get_instance()->get_license_number();
|
13 |
-
$lang = LiveChat::get_instance()->get_lang();
|
14 |
-
$skill = LiveChat::get_instance()->get_skill();
|
15 |
-
|
16 |
-
$code = <<<CODE
|
17 |
-
<div id="LiveChat_{$time}"><a href="http://www.livechatinc.com/?partner=lc_{$license}">live chat software</a></div>
|
18 |
-
|
19 |
-
<script type="text/javascript">
|
20 |
-
var __lc_buttons = __lc_buttons || [];
|
21 |
-
__lc_buttons.push({
|
22 |
-
elementId: 'LiveChat_{$time}',
|
23 |
-
language: '{$lang}',
|
24 |
-
skill: '{$skill}'
|
25 |
-
});
|
26 |
-
</script>
|
27 |
-
CODE;
|
28 |
-
|
29 |
-
return <<<HTML
|
30 |
-
<p>Your theme <strong>does not</strong> support Widgets <a class="help" href="http://codex.wordpress.org/Widgetizing_Themes">(read more)</a>. Thus, you can't easily drag & drop the Widget in your Wordpress admin page.</p>
|
31 |
-
<hr class="livechat">
|
32 |
-
<p>To install "click-to-chat" button you need to put the following code <strong>in a visible place of your website</strong>:</p>
|
33 |
-
<textarea id="chat_button_code" cols="80" rows="12" readonly="readonly" onclick="this.select()">{$code}</textarea>
|
34 |
-
|
35 |
-
<p><a href="#button_placement" class="toggle">What is the best place for my button?</a></p>
|
36 |
-
<div id="button_placement" style="display:none">
|
37 |
-
<p class="img"><img src="{$url}/images/button_placement.png" alt="" /></p>
|
38 |
-
</div>
|
39 |
-
|
40 |
-
<p class="back"><a href="?page=livechat_settings">« go back to Settings</a></p>
|
41 |
-
HTML;
|
42 |
-
}
|
43 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plugin_files/helpers/ChatButtonInfoHelper.class.php
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
require_once('LiveChatHelper.class.php');
|
4 |
-
|
5 |
-
class ChatButtonInfoHelper extends LiveChatHelper
|
6 |
-
{
|
7 |
-
public function render()
|
8 |
-
{
|
9 |
-
if (LiveChat::get_instance()->is_installed())
|
10 |
-
{
|
11 |
-
if (is_active_widget (false, false, LiveChatWidget::get_id_base()))
|
12 |
-
{
|
13 |
-
return '<div class="updated info installed_ok"><p>"Click-to-chat" button installed properly. <span class="help">(<a href="widgets.php">manage widgets</a>)</span></p></div>';
|
14 |
-
}
|
15 |
-
else
|
16 |
-
{
|
17 |
-
// Check if theme supports Widgets
|
18 |
-
if (LiveChat::get_instance()->widgets_enabled())
|
19 |
-
{
|
20 |
-
return '<div class="updated info"><p>To install your "click-to-chat" button, go to <a href="widgets.php">Widgets</a> page.</p></div>';
|
21 |
-
}
|
22 |
-
else
|
23 |
-
{
|
24 |
-
return '<div class="updated info"><p>To install your "click-to-chat" button, <a href="?page=livechat_settings&chat_button=1">click here</a>.</p></div>';
|
25 |
-
}
|
26 |
-
}
|
27 |
-
}
|
28 |
-
|
29 |
-
return '';
|
30 |
-
}
|
31 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plugin_files/helpers/SettingsHelper.class.php
CHANGED
@@ -16,16 +16,9 @@ class SettingsHelper extends LiveChatHelper
|
|
16 |
</div>
|
17 |
<div class="clear"></div>
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
LiveChat::get_instance()->get_helper('ChatButton');
|
23 |
-
}
|
24 |
-
else
|
25 |
-
{
|
26 |
-
LiveChat::get_instance()->get_helper('ChangesSaved');
|
27 |
-
LiveChat::get_instance()->get_helper('TrackingCodeInfo');
|
28 |
-
LiveChat::get_instance()->get_helper('ChatButtonInfo');
|
29 |
?>
|
30 |
|
31 |
<?php if (LiveChat::get_instance()->is_installed() == false) { ?>
|
@@ -50,15 +43,14 @@ class SettingsHelper extends LiveChatHelper
|
|
50 |
<h3><?php echo _e('Download application'); ?></h3>
|
51 |
<div class="postbox_content">
|
52 |
<p><?php echo _e('Download LiveChat for your desktop/mobile and start chatting with your customers!'); ?></p>
|
53 |
-
<p class="btn"><a href="http://www.livechatinc.com/
|
54 |
</div>
|
55 |
</div>
|
56 |
<?php endif; ?>
|
57 |
|
|
|
58 |
<div class="postbox">
|
59 |
<form method="post" action="?page=livechat_settings">
|
60 |
-
|
61 |
-
<?php if (LiveChat::get_instance()->is_installed() == false) { ?>
|
62 |
<h3>LiveChat account</h3>
|
63 |
<div class="postbox_content">
|
64 |
<table class="form-table">
|
@@ -74,19 +66,18 @@ class SettingsHelper extends LiveChatHelper
|
|
74 |
<input type="hidden" name="settings_form" value="1">
|
75 |
<input type="submit" class="button-primary" value="<?php _e('Save changes') ?>" />
|
76 |
</p>
|
77 |
-
|
78 |
</form>
|
|
|
79 |
|
80 |
<?php } else { ?>
|
81 |
|
|
|
|
|
82 |
<h3>Advanced settings</h3>
|
83 |
<div class="postbox_content">
|
84 |
<table class="form-table">
|
85 |
<tr>
|
86 |
-
<th scope="row"><label for="lang">Language:</label></th>
|
87 |
-
<td><input type="text" name="lang" id="lang" value="<?php echo LiveChat::get_instance()->get_lang(); ?>" /> <span class="explanation">Chat window translation. <strong>en</strong> for English (default). <a href="http://support.livechatinc.com/entries/20161073-what-languages-are-supported-in-livechat" class="help">More info…</a></span></td>
|
88 |
-
</tr>
|
89 |
-
<tr>
|
90 |
<th scope="row"><label for="skill">Skill:</label></th>
|
91 |
<td><input type="text" name="skill" id="skill" value="<?php echo LiveChat::get_instance()->get_skill(); ?>" /> <span class="explanation">Used for skill-based routing. <strong>0</strong> for default skill (recommended).</span></td>
|
92 |
</tr>
|
@@ -97,10 +88,11 @@ class SettingsHelper extends LiveChatHelper
|
|
97 |
<input type="hidden" name="settings_form" value="1">
|
98 |
<input type="submit" class="button-primary" value="<?php _e('Save changes') ?>" />
|
99 |
</p>
|
100 |
-
|
101 |
</form>
|
102 |
-
<?php } ?>
|
103 |
</div>
|
|
|
|
|
104 |
|
105 |
<?php if (LiveChat::get_instance()->is_installed()) { ?>
|
106 |
<p id="reset_settings">Something went wrong? <a href="?page=livechat_settings&reset=1">Reset your settings</a>.</p>
|
@@ -151,18 +143,14 @@ class SettingsHelper extends LiveChatHelper
|
|
151 |
<form method="post" action="?page=livechat_settings" id="save_new_license">
|
152 |
<p>
|
153 |
<input type="hidden" name="new_license_form" value="1">
|
154 |
-
<input type="hidden" name="lang" value="en">
|
155 |
<input type="hidden" name="skill" value="0">
|
156 |
<input type="hidden" name="license_number" value="0" id="new_license_number">
|
157 |
</p>
|
158 |
</form>
|
159 |
</div>
|
160 |
</div>
|
161 |
-
|
162 |
-
|
163 |
-
?>
|
164 |
-
</div>
|
165 |
-
</div>
|
166 |
<?php
|
167 |
}
|
168 |
}
|
16 |
</div>
|
17 |
<div class="clear"></div>
|
18 |
|
19 |
+
<?php
|
20 |
+
LiveChat::get_instance()->get_helper('ChangesSaved');
|
21 |
+
LiveChat::get_instance()->get_helper('TrackingCodeInfo');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
?>
|
23 |
|
24 |
<?php if (LiveChat::get_instance()->is_installed() == false) { ?>
|
43 |
<h3><?php echo _e('Download application'); ?></h3>
|
44 |
<div class="postbox_content">
|
45 |
<p><?php echo _e('Download LiveChat for your desktop/mobile and start chatting with your customers!'); ?></p>
|
46 |
+
<p class="btn"><a href="http://www.livechatinc.com/product/" target="_blank"><?php _e('Download application'); ?></a></p>
|
47 |
</div>
|
48 |
</div>
|
49 |
<?php endif; ?>
|
50 |
|
51 |
+
<?php if (LiveChat::get_instance()->is_installed() == false) { ?>
|
52 |
<div class="postbox">
|
53 |
<form method="post" action="?page=livechat_settings">
|
|
|
|
|
54 |
<h3>LiveChat account</h3>
|
55 |
<div class="postbox_content">
|
56 |
<table class="form-table">
|
66 |
<input type="hidden" name="settings_form" value="1">
|
67 |
<input type="submit" class="button-primary" value="<?php _e('Save changes') ?>" />
|
68 |
</p>
|
69 |
+
</div>
|
70 |
</form>
|
71 |
+
</div>
|
72 |
|
73 |
<?php } else { ?>
|
74 |
|
75 |
+
<div id="advanced" class="postbox" style="display:none">
|
76 |
+
<form method="post" action="?page=livechat_settings">
|
77 |
<h3>Advanced settings</h3>
|
78 |
<div class="postbox_content">
|
79 |
<table class="form-table">
|
80 |
<tr>
|
|
|
|
|
|
|
|
|
81 |
<th scope="row"><label for="skill">Skill:</label></th>
|
82 |
<td><input type="text" name="skill" id="skill" value="<?php echo LiveChat::get_instance()->get_skill(); ?>" /> <span class="explanation">Used for skill-based routing. <strong>0</strong> for default skill (recommended).</span></td>
|
83 |
</tr>
|
88 |
<input type="hidden" name="settings_form" value="1">
|
89 |
<input type="submit" class="button-primary" value="<?php _e('Save changes') ?>" />
|
90 |
</p>
|
91 |
+
</div>
|
92 |
</form>
|
|
|
93 |
</div>
|
94 |
+
<p id="advanced-link"><a href="">Show advanced settings…</a></p>
|
95 |
+
<?php } ?>
|
96 |
|
97 |
<?php if (LiveChat::get_instance()->is_installed()) { ?>
|
98 |
<p id="reset_settings">Something went wrong? <a href="?page=livechat_settings&reset=1">Reset your settings</a>.</p>
|
143 |
<form method="post" action="?page=livechat_settings" id="save_new_license">
|
144 |
<p>
|
145 |
<input type="hidden" name="new_license_form" value="1">
|
|
|
146 |
<input type="hidden" name="skill" value="0">
|
147 |
<input type="hidden" name="license_number" value="0" id="new_license_number">
|
148 |
</p>
|
149 |
</form>
|
150 |
</div>
|
151 |
</div>
|
152 |
+
</div>
|
153 |
+
</div>
|
|
|
|
|
|
|
154 |
<?php
|
155 |
}
|
156 |
}
|
plugin_files/helpers/TrackingCodeHelper.class.php
CHANGED
@@ -8,30 +8,20 @@ class TrackingCodeHelper extends LiveChatHelper
|
|
8 |
{
|
9 |
if (LiveChat::get_instance()->is_installed())
|
10 |
{
|
11 |
-
$lang = LiveChat::get_instance()->get_lang();
|
12 |
$skill = LiveChat::get_instance()->get_skill();
|
13 |
$license_number = LiveChat::get_instance()->get_license_number();
|
14 |
|
15 |
return <<<HTML
|
16 |
<script type="text/javascript">
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
lang = '{$lang}',
|
21 |
-
skill = '{$skill}';
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
if (typeof p['server'] == 'string' && typeof __lc_serv != 'string') {
|
29 |
-
l.src = h + (__lc_serv = p['server']) + '/licence/'+license+'/script.cgi?lang='+lang+a+'groups='+skill;
|
30 |
-
l.src += (params == '') ? '' : a+'params='+encodeURIComponent(encodeURIComponent(params)); s.parentNode.insertBefore(l, s);
|
31 |
-
} else setTimeout(__lc_load, 1000); typeof __lc_serv != 'string' && s.parentNode.insertBefore(l, s);
|
32 |
-
} else __lc_load(Math.ceil(Math.random()*5)); }
|
33 |
-
__lc_load();
|
34 |
-
})();
|
35 |
</script>
|
36 |
HTML;
|
37 |
}
|
8 |
{
|
9 |
if (LiveChat::get_instance()->is_installed())
|
10 |
{
|
|
|
11 |
$skill = LiveChat::get_instance()->get_skill();
|
12 |
$license_number = LiveChat::get_instance()->get_license_number();
|
13 |
|
14 |
return <<<HTML
|
15 |
<script type="text/javascript">
|
16 |
+
var __lc = {};
|
17 |
+
__lc.license = {$license_number};
|
18 |
+
__lc.skill = {$skill};
|
|
|
|
|
19 |
|
20 |
+
(function() {
|
21 |
+
var lc = document.createElement('script'); lc.type = 'text/javascript'; lc.async = true;
|
22 |
+
lc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.livechatinc.com/tracking.js';
|
23 |
+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(lc, s);
|
24 |
+
})();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
</script>
|
26 |
HTML;
|
27 |
}
|
plugin_files/helpers/TrackingCodeInfoHelper.class.php
CHANGED
@@ -8,7 +8,7 @@ class TrackingCodeInfoHelper extends LiveChatHelper
|
|
8 |
{
|
9 |
if (LiveChat::get_instance()->is_installed())
|
10 |
{
|
11 |
-
return '<div class="updated installed_ok"><p>
|
12 |
}
|
13 |
|
14 |
return '';
|
8 |
{
|
9 |
if (LiveChat::get_instance()->is_installed())
|
10 |
{
|
11 |
+
return '<div class="updated installed_ok"><p>LiveChat is installed properly. Woohoo!</p></div>';
|
12 |
}
|
13 |
|
14 |
return '';
|
readme.txt
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
=== LiveChat ===
|
2 |
Contributors: LiveChat
|
3 |
Tags: live support, live chat, live chat software, online support, ecommerce, increase sales, customer help, customer support, livechat, live support, customer service, plugin, chat
|
4 |
-
Stable tag: 3.2.
|
5 |
Requires at least: 2.8
|
6 |
Tested up to: 3.1.3
|
7 |
|
@@ -28,6 +28,9 @@ Take a tour to see why you need LiveChat on your website: http://www.livechatinc
|
|
28 |
|
29 |
== Changelog ==
|
30 |
|
|
|
|
|
|
|
31 |
= 3.2.4 =
|
32 |
* Updated url for licence number
|
33 |
|
1 |
=== LiveChat ===
|
2 |
Contributors: LiveChat
|
3 |
Tags: live support, live chat, live chat software, online support, ecommerce, increase sales, customer help, customer support, livechat, live support, customer service, plugin, chat
|
4 |
+
Stable tag: 3.2.5
|
5 |
Requires at least: 2.8
|
6 |
Tested up to: 3.1.3
|
7 |
|
28 |
|
29 |
== Changelog ==
|
30 |
|
31 |
+
= 3.2.5 =
|
32 |
+
* Updated to correct tag
|
33 |
+
|
34 |
= 3.2.4 =
|
35 |
* Updated url for licence number
|
36 |
|