WP Live Chat Support - Version 2.7

Version Description

  • Fixed the chat initiation bug
  • Fixed the style bug
  • Added support to email for proper smtp (pro)
  • Fixed cookie bugs
  • Add delete live chat history option (pro)
  • Added UTF8 character support for the live chat
  • Added error reporting (pro)
Download this release

Release Info

Developer WP-LiveChat
Plugin Icon 128x128 WP Live Chat Support
Version 2.7
Comparing to
See all releases

Code changes from version 2.6 to 2.7

Files changed (5) hide show
  1. css/wplcstyle.css +1 -1
  2. includes/settings_page.php +234 -0
  3. js/wplc_u.js +98 -68
  4. readme.txt +32 -32
  5. wp-live-chat-support.php +31 -203
css/wplcstyle.css CHANGED
@@ -1,4 +1,4 @@
1
- #wp-live-chat input[type="button"] { width:100px !important; }
2
  #wp-live-chat input[type="text"] { width:150px; border:1px solid #CCC; }
3
  #wp-live-chat textarea { width:145px; height:40px; border:1px solid #CCC; }
4
  #wplc_chatbox {
1
+ #wp-live-chat input[type="button"] { width: auto }
2
  #wp-live-chat input[type="text"] { width:150px; border:1px solid #CCC; }
3
  #wp-live-chat textarea { width:145px; height:40px; border:1px solid #CCC; }
4
  #wplc_chatbox {
includes/settings_page.php ADDED
@@ -0,0 +1,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="wrap">
3
+ <div id="icon-edit" class="icon32 icon32-posts-post">
4
+ <br>
5
+ </div>
6
+ <h2><?php _e("WP Live Chat Support Settings","wplivechat")?></h2>
7
+ <?php
8
+ $wplc_settings = get_option("WPLC_SETTINGS");
9
+ if ($wplc_settings["wplc_settings_align"]) { $wplc_settings_align[intval($wplc_settings["wplc_settings_align"])] = "SELECTED"; }
10
+ if ($wplc_settings["wplc_settings_enabled"]) { $wplc_settings_enabled[intval($wplc_settings["wplc_settings_enabled"])] = "SELECTED"; }
11
+ if ($wplc_settings["wplc_settings_fill"]) { $wplc_settings_fill = $wplc_settings["wplc_settings_fill"]; } else { $wplc_settings_fill = "73BE28"; }
12
+ if ($wplc_settings["wplc_settings_font"]) { $wplc_settings_font = $wplc_settings["wplc_settings_font"]; } else { $wplc_settings_font = "FFFFFF"; }
13
+ if(get_option("WPLC_HIDE_CHAT") == true) { $wplc_hide_chat = "checked"; } else { $wplc_hide_chat = ""; };
14
+ ?>
15
+ <form action='' name='wplc_settings' method='POST' id='wplc_settings'>
16
+
17
+ <div id="wplc_tabs">
18
+ <ul>
19
+ <li><a href="#tabs-1"><?php _e("General Settings","wplivechat")?></a></li>
20
+ <li><a href="#tabs-2"><?php _e("Chat Box","wplivechat")?></a></li>
21
+ <li><a href="#tabs-3"><?php _e("Offline Messages","wplivechat")?></a></li>
22
+ <li><a href="#tabs-4"><?php _e("Styling","wplivechat")?></a></li>
23
+ </ul>
24
+ <div id="tabs-1">
25
+ <h3><?php _e("Main Settings",'wplivechat')?></h3>
26
+ <table class='form-table' width='700'>
27
+ <tr>
28
+ <td width='200' valign='top'><?php _e("Chat enabled","wplivechat")?>:</td>
29
+ <td>
30
+ <select id='wplc_settings_enabled' name='wplc_settings_enabled'>
31
+ <option value="1" <?php $wplc_settings_enabled[1]?>><?php _e("Yes","wplivechat")?></option>
32
+ <option value="2" <?php $wplc_settings_enabled[2]?>><?php _e("No","wplivechat")?></option>
33
+ </select>
34
+ </td>
35
+ </tr>
36
+ <tr>
37
+ <td width='200' valign='top'>
38
+ <?php _e("Hide Chat","wplivechat")?>:
39
+ <p class="description">Hides chat for 24hrs when user clicks X</p>
40
+ </td>
41
+ <td valign='top'>
42
+ <input type="checkbox" name="wplc_hide_chat" value="true" disabled /> <small><i>Only available in the <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=hide" title="Buy the Pro version for only $14.95 once off. Free updates and support forever">Pro version</a></i></small>
43
+ </td>
44
+ </tr>
45
+ </table>
46
+
47
+ </div>
48
+ <div id="tabs-2">
49
+ <h3><?php _e("Chat Window Settings",'wplivechat')?></h3>
50
+ <table class='form-table' width='700'>
51
+ <tr>
52
+ <td width='200' valign='top'><?php _e("Chat box alignment","wplivechat")?>:</td>
53
+ <td>
54
+ <select id='wplc_settings_align' name='wplc_settings_align'>
55
+ <option value="1" <?php $wplc_settings_align[1]?>><?php _e("Bottom left","wplivechat")?></option>
56
+ <option value="2" <?php $wplc_settings_align[2]?>><?php _e("Bottom right","wplivechat")?></option>
57
+ </select>
58
+ </td>
59
+ </tr>
60
+ <tr>
61
+ <!-- Chat Name-->
62
+ <td width='200' valign='top'>
63
+ <?php _e("Name","wplivechat")?>:
64
+ </td>
65
+ <td>
66
+ <input type='text' size='50' maxlength='50' disabled readonly value='admin' />
67
+ <small>
68
+ <i>
69
+ <?php _e("available in the","wplivechat")?>
70
+ <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=name" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
71
+ <?php _e("only","wplivechat")?>
72
+ </i>
73
+ </small>
74
+ </td>
75
+ </tr>
76
+ <!-- Chat Pic-->
77
+ <tr>
78
+ <td width='200' valign='top'>
79
+ <?php _e("Picture","wplivechat")?>:
80
+ </td>
81
+ <td>
82
+ <input id="wplc_pro_pic_button" type="button" value="<?php _e("Upload Image","wplivechat")?>" readonly disabled />
83
+ <small>
84
+ <i>
85
+ <?php _e("available in the","wplivechat")?>
86
+ <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=pic" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
87
+ <?php _e("only","wplivechat")?>
88
+ </i>
89
+ </small>
90
+ </td>
91
+ </tr>
92
+ <!-- Chat Logo-->
93
+ <tr>
94
+ <td width='200' valign='top'>
95
+ <?php _e("Logo","wplivechat")?>:
96
+ </td>
97
+ <td>
98
+ <input id="wplc_pro_logo_button" type="button" value="<?php _e("Upload Image","wplivechat")?>" readonly disabled />
99
+ <small>
100
+ <i>
101
+ <?php _e("available in the","wplivechat")?>
102
+ <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=pic" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
103
+ <?php _e("only","wplivechat")?>
104
+ </i>
105
+ </small>
106
+ </td>
107
+ </tr>
108
+ <!-- Chat Delay-->
109
+ <tr>
110
+ <td width='200' valign='top'>
111
+ <?php _e("Chat delay (seconds)","wplivechat")?>:
112
+ </td>
113
+ <td>
114
+ <input type='text' size='50' maxlength='50' disabled readonly value='10' />
115
+ <small>
116
+ <i>
117
+ <?php _e("available in the","wplivechat")?>
118
+ <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=delay" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
119
+ <?php _e("only","wplivechat")?>
120
+ </i>
121
+ </small>
122
+ </td>
123
+ </tr>
124
+ <!-- Chat Notification if want to chat-->
125
+ <tr>
126
+ <td width='200' valign='top'>
127
+ <?php _e("Chat notifications","wplivechat")?>:
128
+ </td>
129
+ <td>
130
+ <input id='wplc_pro_chat_notification' name='wplc_pro_chat_notification' type='checkbox' value='yes' disabled="disabled" readonly/>
131
+ <?php _e("Alert me via email as soon as someone wants to chat","wplivechat")?>
132
+ <small>
133
+ <i>
134
+ <?php _e("available in the","wplivechat")?>
135
+ <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=alert" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
136
+ <?php _e("only","wplivechat")?>
137
+ </i>
138
+ </small>
139
+ </td>
140
+ </tr>
141
+ </table>
142
+
143
+ </div>
144
+ <div id="tabs-3">
145
+ <h3><?php _e("Offline Messages",'wplivechat')?></h3>
146
+ <table class='form-table' width='700'>
147
+ <tr>
148
+ <td width='200' valign='top'>
149
+ <?php _e("Email Address","wplivechat")?>:
150
+ </td>
151
+ <td>
152
+ <input type='text' size='50' maxlength='150' class='regular-text' readonly value='' />
153
+ <small>
154
+ <i>
155
+ <?php _e("Get offline messages with the ","wplivechat")?>
156
+ <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=offlinemessages" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>.
157
+ </i>
158
+ </small>
159
+ <br />
160
+ </td>
161
+ </tr>
162
+ <tr>
163
+ <td width='200' valign='top'>
164
+ <?php _e("Offline text","wplivechat")?>:
165
+ </td>
166
+ <td>
167
+ <input type='text' size='50' maxlength='50' class='regular-text' readonly value='Chat offline. Leave a message' />
168
+ <small>
169
+ <i> <?php _e("Edit these text fields using the ","wplivechat")?>
170
+ <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=textfields4" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
171
+ </i>
172
+ </small>
173
+ <br />
174
+ </td>
175
+ </tr>
176
+
177
+ </table>
178
+ </div>
179
+
180
+
181
+ <div id="tabs-4">
182
+ <h3><?php _e("Styling",'wplivechat')?></h3>
183
+ <table class='form-table' width='700'>
184
+ <tr>
185
+ <td width='200' valign='top'><?php _e("Chat box fill color","wplivechat")?>:</td>
186
+ <td>
187
+ <input id="wplc_settings_fill" name="wplc_settings_fill" type="text" class="color" value="<?php echo $wplc_settings_fill;?>" />
188
+ </td>
189
+ </tr>
190
+ <tr>
191
+ <td width='200' valign='top'><?php _e("Chat box font color","wplivechat")?>:</td>
192
+ <td>
193
+ <input id="wplc_settings_font" name="wplc_settings_font" type="text" class="color" value="<?php echo $wplc_settings_font;?>" />
194
+ </td>
195
+ </tr>
196
+ <tr style='height:30px;'><td></td><td></td></tr>
197
+ <tr>
198
+ <td width='200' valign='top'><?php _e("First section text","wplivechat")?>:</td>
199
+ <td>
200
+ <input type='text' size='50' maxlength='50' class='regular-text' readonly value='Questions?' /> <br />
201
+ <input type='text' size='50' maxlength='50' class='regular-text' readonly value='Chat with us' /> <br />
202
+ </td>
203
+ </tr>
204
+ <tr>
205
+ <td width='200' valign='top'><?php _e("Second section text","wplivechat") ?>:</td>
206
+ <td>
207
+ <input type='text' size='50' maxlength='50' class='regular-text' readonly value='Start Chat' /> <br />
208
+ <input type='text' size='50' maxlength='50' class='regular-text' readonly value='Connecting you to a sales person. Please be patient.' /> <br />
209
+
210
+
211
+ </td>
212
+ </tr>
213
+ <tr>
214
+ <td width='200' valign='top'><?php _e("Reactivate chat section text","wplivechat")?>:</td>
215
+ <td>
216
+ <input type='text' size='50' maxlength='50' class='regular-text' readonly value='Reactivating your previous chat...' />
217
+ <small>
218
+ <i>
219
+ <?php _e("Edit these text fields using the ","wplivechat")?>
220
+ <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=textfields3" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>.
221
+ </i>
222
+ </small>
223
+ <br />
224
+
225
+
226
+ </td>
227
+ </tr>
228
+ </table>
229
+ </div>
230
+ </div>
231
+ <p class='submit'><input type='submit' name='wplc_save_settings' class='button-primary' value='<?php _e("Save Settings","wplivechat")?>' /></p>
232
+ </form>
233
+
234
+ </div>
js/wplc_u.js CHANGED
@@ -1,3 +1,11 @@
 
 
 
 
 
 
 
 
1
  jQuery(document).ready(function() {
2
 
3
 
@@ -8,11 +16,17 @@ jQuery(document).ready(function() {
8
  var wplc_check_cookie_id;
9
  var wplc_check_cookie_stage;
10
  var wplc_check_hide_cookie;
 
11
 
12
  wplc_check_cookie_id = jQuery.cookie('wplc_cid');
13
  wplc_check_cookie_stage = jQuery.cookie('wplc_stage');
14
  wplc_check_hide_cookie = jQuery.cookie('wplc_hide');
15
-
 
 
 
 
 
16
 
17
  function wplc_relay_user_stage(stage,cid) {
18
 
@@ -36,19 +50,14 @@ jQuery(document).ready(function() {
36
  }
37
 
38
  /* minimize chat window */
39
- jQuery("#wp-live-chat-minimize").live("click", function() {
40
  jQuery("#wp-live-chat-1").show();
41
  jQuery("#wp-live-chat-1").css('cursor', 'pointer');
42
-
43
  jQuery("#wp-live-chat-2").hide();
44
  jQuery("#wp-live-chat-3").hide();
45
  jQuery("#wp-live-chat-4").hide();
46
  jQuery("#wp-live-chat-minimize").hide();
47
- jQuery.cookie('wplc_hide', "yes", { expires: 1, path: '/' });
48
- jQuery.cookie('wplc_stage', "2", { expires: 1, path: '/' });
49
-
50
-
51
-
52
  var data = {
53
  action: 'wplc_user_minimize_chat',
54
  security: wplc_nonce,
@@ -59,14 +68,14 @@ jQuery(document).ready(function() {
59
  });
60
  });
61
  /* close chat window */
62
- jQuery("#wp-live-chat-close").live("click", function() {
63
  jQuery("#wp-live-chat").hide();
64
  jQuery("#wp-live-chat-1").hide();
65
  jQuery("#wp-live-chat-2").hide();
66
  jQuery("#wp-live-chat-3").hide();
67
  jQuery("#wp-live-chat-4").hide();
68
  jQuery("#wp-live-chat-minimize").hide();
69
- jQuery.cookie('wplc_hide', "yes", { expires: 1, path: '/' });
70
  jQuery.cookie('wplc_stage', "1", { expires: 1, path: '/' });
71
 
72
 
@@ -85,7 +94,7 @@ jQuery(document).ready(function() {
85
  });
86
 
87
 
88
- jQuery("#wp-live-chat-1").live("click", function() {
89
  //jQuery("#wp-live-chat-1").hide();
90
  jQuery("#wp-live-chat-1").css('cursor', 'default');
91
  jQuery.cookie('wplc_hide', "", { expires: 1, path: '/' });
@@ -93,12 +102,11 @@ jQuery(document).ready(function() {
93
  jQuery("#wp-live-chat-close").show();
94
 
95
  wplc_check_cookie_stage = jQuery.cookie('wplc_stage');
96
- if (wplc_check_cookie_stage == "3") {
97
  jQuery("#wp-live-chat-4").show();
98
  jQuery("#wplc_chatmsg").focus();
99
  jQuery("#wp-live-chat-2").hide();
100
- }
101
- else if (wplc_check_cookie_stage == "2") {
102
  var data = {
103
  action: 'wplc_user_maximize_chat',
104
  security: wplc_nonce,
@@ -106,22 +114,35 @@ jQuery(document).ready(function() {
106
  };
107
  jQuery.post(wplc_ajaxurl, data, function(response) {
108
  //log("user maximized chat success");
109
- });
110
- jQuery("#wp-live-chat-4").show();
111
- jQuery("#wplc_chatmsg").focus();
112
- jQuery("#wp-live-chat-2").hide();
113
  }
114
- else {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  jQuery("#wp-live-chat-2").show();
116
  }
117
-
118
-
119
-
120
  });
121
 
122
  var wplc_user_waiting = null;
123
 
124
- jQuery("#wplc_start_chat_btn").live("click", function() {
125
  var wplc_name = jQuery("#wplc_name").val();
126
  var wplc_email = jQuery("#wplc_email").val();
127
  if (wplc_name.length <= 0) { alert("Please enter your name"); return false; }
@@ -134,10 +155,10 @@ jQuery(document).ready(function() {
134
  var wplc_chat_session_id;
135
 
136
  var data = {
137
- action: 'wplc_start_chat',
138
- security: wplc_nonce,
139
- name: wplc_name,
140
- email: wplc_email
141
  };
142
  jQuery.post(wplc_ajaxurl, data, function(response) {
143
  //console.log("wplc_start_chat");
@@ -168,7 +189,7 @@ jQuery(document).ready(function() {
168
  // chat is now active
169
  jQuery.cookie('wplc_cid', cid, { expires: 1, path: '/' });
170
  jQuery.cookie('wplc_name', wplc_name, { expires: 1, path: '/' });
171
- jQuery.cookie('wplc_stage', 3, { expires: 1, path: '/' });
172
  wplc_user_auto_refresh = setInterval(function (){wpcl_user_auto_update_chat_box(cid);}, 3500);
173
  wplc_user_auto_refresh_status = setInterval(function (){wpcl_user_auto_update_chat_status(wplc_check_cookie_id);}, 3500);
174
 
@@ -178,11 +199,11 @@ jQuery(document).ready(function() {
178
  }
179
  jQuery("#wplc_chatmsg").keyup(function(event){
180
  if(event.keyCode == 13){
181
- jQuery("#wplc_send_msg").click();
182
  }
183
  });
184
 
185
- jQuery("#wplc_send_msg").live("click", function() {
186
  var wplc_cid = jQuery("#wplc_cid").val();
187
  var wplc_chat = jQuery("#wplc_chatmsg").val();
188
  var wplc_name = jQuery("#wplc_name").val();
@@ -247,16 +268,12 @@ jQuery(document).ready(function() {
247
 
248
 
249
  // user pushed the X button, dont show chat window
250
- if (wplc_check_hide_cookie === "yes" && wplc_check_cookie_stage !== '1') {
251
- jQuery("#wp-live-chat").css({ "display" : "block" });
252
- jQuery("#wp-live-chat-1").show();
253
- jQuery("#wp-live-chat-2").hide();
254
- jQuery("#wp-live-chat-3").hide();
255
- jQuery("#wp-live-chat-4").hide();
256
- }
257
- else if (wplc_check_cookie_stage === "1") {
258
  jQuery("#wp-live-chat").hide();
259
- }
 
 
 
260
  else {
261
 
262
  // First time visitor has visited the site, show chat window and set cookie
@@ -270,42 +287,55 @@ jQuery(document).ready(function() {
270
 
271
 
272
 
273
- jQuery("#wp-live-chat-1").show();
274
- jQuery("#wp-live-chat-2").hide();
275
- jQuery("#wp-live-chat-3").hide();
276
- jQuery("#wp-live-chat-4").hide();
277
- jQuery("#wp-live-chat-react").show();
278
- jQuery("#wp-live-chat-minimize").show();
279
- jQuery("#wp-live-chat-close").show();
280
-
281
 
282
 
283
- jQuery("#wp-live-chat").css({ "display" : "block" });
284
 
 
 
 
285
 
286
 
287
- var data = {
288
- action: 'wplc_user_reactivate_chat',
289
- security: wplc_nonce,
290
- cid: wplc_check_cookie_id
291
- };
292
- jQuery.post(wplc_ajaxurl, data, function(response) {
293
- //console.log("wplc_user_reactivate_chat");
294
- jQuery("#wp-live-chat-react").hide();
295
- jQuery("#wp-live-chat-4").show();
296
- jQuery("#wplc_chatmsg").focus();
297
- jQuery("#wp-live-chat-close").show();
298
- jQuery("#wp-live-chat-minimize").show();
299
 
300
- jQuery("#wplc_chatbox").append(response);
301
- var height = jQuery('#wplc_chatbox')[0].scrollHeight;
302
- jQuery('#wplc_chatbox').scrollTop(height);
303
 
304
- wplc_user_auto_refresh = setInterval(function (){wpcl_user_auto_update_chat_box(wplc_check_cookie_id);}, 3500);
305
- wplc_user_auto_refresh_status = setInterval(function (){wpcl_user_auto_update_chat_status(wplc_check_cookie_id);}, 3500);
306
-
307
- });
 
 
 
 
 
 
 
 
 
 
308
  }
309
- }
310
 
 
 
 
311
  });
1
+ /*
2
+ * Cookie Stages
3
+ *
4
+ * 1 = no chat started - small box
5
+ * 2 = chat window opens - enter username & email
6
+ * 3 = awaiting admin to accept chat
7
+ * 4 = Chat window - user and admin can now chat
8
+ */
9
  jQuery(document).ready(function() {
10
 
11
 
16
  var wplc_check_cookie_id;
17
  var wplc_check_cookie_stage;
18
  var wplc_check_hide_cookie;
19
+ var wplc_check_minimize_cookie;
20
 
21
  wplc_check_cookie_id = jQuery.cookie('wplc_cid');
22
  wplc_check_cookie_stage = jQuery.cookie('wplc_stage');
23
  wplc_check_hide_cookie = jQuery.cookie('wplc_hide');
24
+ wplc_check_minimize_cookie = jQuery.cookie('wplc_minimize');
25
+ //set cookie stage
26
+ if(wplc_check_cookie_stage === null){
27
+ jQuery.cookie('wplc_stage', 1, { expires: 1, path: '/' });
28
+ wplc_check_cookie_stage = jQuery.cookie('wplc_stage');
29
+ }
30
 
31
  function wplc_relay_user_stage(stage,cid) {
32
 
50
  }
51
 
52
  /* minimize chat window */
53
+ jQuery("#wp-live-chat-minimize").on("click", function() {
54
  jQuery("#wp-live-chat-1").show();
55
  jQuery("#wp-live-chat-1").css('cursor', 'pointer');
 
56
  jQuery("#wp-live-chat-2").hide();
57
  jQuery("#wp-live-chat-3").hide();
58
  jQuery("#wp-live-chat-4").hide();
59
  jQuery("#wp-live-chat-minimize").hide();
60
+ jQuery.cookie('wplc_minimize', "yes", { expires: 1, path: '/' });
 
 
 
 
61
  var data = {
62
  action: 'wplc_user_minimize_chat',
63
  security: wplc_nonce,
68
  });
69
  });
70
  /* close chat window */
71
+ jQuery("#wp-live-chat-close").on("click", function() {
72
  jQuery("#wp-live-chat").hide();
73
  jQuery("#wp-live-chat-1").hide();
74
  jQuery("#wp-live-chat-2").hide();
75
  jQuery("#wp-live-chat-3").hide();
76
  jQuery("#wp-live-chat-4").hide();
77
  jQuery("#wp-live-chat-minimize").hide();
78
+ jQuery.cookie('wplc_hide', hide_chat, { expires: 1, path: '/' });
79
  jQuery.cookie('wplc_stage', "1", { expires: 1, path: '/' });
80
 
81
 
94
  });
95
 
96
 
97
+ jQuery("#wp-live-chat-1").on("click", function() {
98
  //jQuery("#wp-live-chat-1").hide();
99
  jQuery("#wp-live-chat-1").css('cursor', 'default');
100
  jQuery.cookie('wplc_hide', "", { expires: 1, path: '/' });
102
  jQuery("#wp-live-chat-close").show();
103
 
104
  wplc_check_cookie_stage = jQuery.cookie('wplc_stage');
105
+ if (wplc_check_cookie_stage === "4") {
106
  jQuery("#wp-live-chat-4").show();
107
  jQuery("#wplc_chatmsg").focus();
108
  jQuery("#wp-live-chat-2").hide();
109
+ jQuery.cookie('wplc_minimize', "", { expires: 1, path: '/' });
 
110
  var data = {
111
  action: 'wplc_user_maximize_chat',
112
  security: wplc_nonce,
114
  };
115
  jQuery.post(wplc_ajaxurl, data, function(response) {
116
  //log("user maximized chat success");
117
+ });
 
 
 
118
  }
119
+ /*else if (wplc_check_cookie_stage === "2") {
120
+ var data = {
121
+ action: 'wplc_user_maximize_chat',
122
+ security: wplc_nonce,
123
+ cid: wplc_check_cookie_id
124
+ };
125
+ jQuery.post(wplc_ajaxurl, data, function(response) {
126
+ //log("user maximized chat success");
127
+ });
128
+
129
+ jQuery("#wp-live-chat-2").show();
130
+ //
131
+ //Changed this to show chat window 2 as this seemed to be the issue where the chat would be minimized
132
+ //without putting email or username in and then opened again and go straight into chat
133
+ //
134
+ //jQuery("#wp-live-chat-4").show();
135
+ //jQuery("#wplc_chatmsg").focus();
136
+ //jQuery("#wp-live-chat-2").hide();
137
+ } */
138
+ else if (wplc_check_cookie_stage === "1"){
139
  jQuery("#wp-live-chat-2").show();
140
  }
 
 
 
141
  });
142
 
143
  var wplc_user_waiting = null;
144
 
145
+ jQuery("#wplc_start_chat_btn").on("click", function() {
146
  var wplc_name = jQuery("#wplc_name").val();
147
  var wplc_email = jQuery("#wplc_email").val();
148
  if (wplc_name.length <= 0) { alert("Please enter your name"); return false; }
155
  var wplc_chat_session_id;
156
 
157
  var data = {
158
+ action: 'wplc_start_chat',
159
+ security: wplc_nonce,
160
+ name: wplc_name,
161
+ email: wplc_email
162
  };
163
  jQuery.post(wplc_ajaxurl, data, function(response) {
164
  //console.log("wplc_start_chat");
189
  // chat is now active
190
  jQuery.cookie('wplc_cid', cid, { expires: 1, path: '/' });
191
  jQuery.cookie('wplc_name', wplc_name, { expires: 1, path: '/' });
192
+ jQuery.cookie('wplc_stage', 4, { expires: 1, path: '/' });
193
  wplc_user_auto_refresh = setInterval(function (){wpcl_user_auto_update_chat_box(cid);}, 3500);
194
  wplc_user_auto_refresh_status = setInterval(function (){wpcl_user_auto_update_chat_status(wplc_check_cookie_id);}, 3500);
195
 
199
  }
200
  jQuery("#wplc_chatmsg").keyup(function(event){
201
  if(event.keyCode == 13){
202
+ jQuery("#wplc_send_msg").trigger("click");
203
  }
204
  });
205
 
206
+ jQuery("#wplc_send_msg").on("click", function() {
207
  var wplc_cid = jQuery("#wplc_cid").val();
208
  var wplc_chat = jQuery("#wplc_chatmsg").val();
209
  var wplc_name = jQuery("#wplc_name").val();
268
 
269
 
270
  // user pushed the X button, dont show chat window
271
+ if (wplc_check_hide_cookie === "yes" /*&& wplc_check_cookie_stage !== '1'*/) {
 
 
 
 
 
 
 
272
  jQuery("#wp-live-chat").hide();
273
+ }
274
+ // else if (wplc_check_cookie_stage === "1") {
275
+ // jQuery("#wp-live-chat").hide();
276
+ // }
277
  else {
278
 
279
  // First time visitor has visited the site, show chat window and set cookie
287
 
288
 
289
 
290
+ jQuery("#wp-live-chat-1").show();
291
+ jQuery("#wp-live-chat-2").hide();
292
+ jQuery("#wp-live-chat-3").hide();
293
+ jQuery("#wp-live-chat-4").hide();
294
+ jQuery("#wp-live-chat-react").show();
295
+ jQuery("#wp-live-chat-minimize").show();
296
+ jQuery("#wp-live-chat-close").show();
 
297
 
298
 
 
299
 
300
+ jQuery("#wp-live-chat").css({ "display" : "block" });
301
+
302
+
303
 
304
 
305
+ var data = {
306
+ action: 'wplc_user_reactivate_chat',
307
+ security: wplc_nonce,
308
+ cid: wplc_check_cookie_id
309
+ };
310
+ jQuery.post(wplc_ajaxurl, data, function(response) {
311
+ //console.log("wplc_user_reactivate_chat");
312
+ jQuery("#wp-live-chat-react").hide();
313
+ jQuery("#wp-live-chat-4").show();
314
+ jQuery("#wplc_chatmsg").focus();
315
+ jQuery("#wp-live-chat-close").show();
316
+ jQuery("#wp-live-chat-minimize").show();
317
 
318
+ jQuery("#wplc_chatbox").append(response);
319
+ var height = jQuery('#wplc_chatbox')[0].scrollHeight;
320
+ jQuery('#wplc_chatbox').scrollTop(height);
321
 
322
+ wplc_user_auto_refresh = setInterval(function (){wpcl_user_auto_update_chat_box(wplc_check_cookie_id);}, 3500);
323
+ wplc_user_auto_refresh_status = setInterval(function (){wpcl_user_auto_update_chat_status(wplc_check_cookie_id);}, 3500);
324
+ // set coorect curser
325
+ jQuery("#wp-live-chat-1").css('cursor', 'default');
326
+ //set correct cookie
327
+ jQuery.cookie('wplc_stage', 4, { expires: 1, path: '/' });
328
+ //if chat was minimized
329
+ if(wplc_check_minimize_cookie === 'yes'){
330
+ jQuery("#wp-live-chat-1").show();
331
+ jQuery("#wp-live-chat-1").css('cursor', 'pointer');
332
+ jQuery("#wp-live-chat-2").hide();
333
+ jQuery("#wp-live-chat-3").hide();
334
+ jQuery("#wp-live-chat-4").hide();
335
+ jQuery("#wp-live-chat-minimize").hide();
336
  }
 
337
 
338
+ });
339
+ }
340
+ }
341
  });
readme.txt CHANGED
@@ -3,60 +3,51 @@ Contributors: WP-LiveChat
3
  Donate link: http://www.wp-livechat.com
4
  Tags: live chat, live support, chat plugin, live help, wordpress chat, customer support, chat, live chat plugin
5
  Requires at least: 3.4
6
- Tested up to: 3.7.1
7
  Stable tag: trunk
8
  License: GPLv2
9
 
10
- The most cost effective Live Chat plugin. Chat with your visitors for free!
11
 
12
  == Description ==
13
 
14
- The most cost effective Live Chat plugin. Chat with your visitors for free! WP Live Chat Support is perfect for small businesses. No third party connections or subscriptions required. There's no need to pay for live chat monthly subscriptions in order to better understand your visitors. This is a fully functional live chat plugin. Increase your conversion rates by communicating directly with your visitors when they're ready to do so.
15
 
16
- = Free Version Features =
17
 
18
- WP Live Chat Support is a fully functional live chat plugin
19
- Initiate live chats with your visitors
20
- Easy to use interface for both the admin and the visitor
21
- No advertising or links
22
- No "Powered by" links on the live chat window
23
- No monthly live chat subscriptions needed
24
 
 
25
 
26
- = Pro Version Features =
27
-
28
- Initiate live chats with online visitors
29
- Chat to more than one visitor at a time
30
- Access historical live chat records
31
- Set up your user profile
32
- Add your company logo to the live chat window
33
- Add your photo to the live chat window
34
- Edit all text fields
35
- World-class support
36
- ► Fully customizable live chat experience
37
 
38
  Get the [WP Live Chat Support Pro Add-on](http://wp-livechat.com/purchase-pro/) for only $14.95 once off!
39
 
40
- = Coming Soon =
41
-
42
- * Multiple live chat operators
43
- * Better control of chat history
44
- * More advanced customization
45
-
46
-
47
  == Installation ==
48
 
49
  1. Once activated, click the "Live Chat" link under your settings tabs.
50
- 2. Edit the settings to your preference.
51
  3. Test it out in a post or page.
52
 
53
-
54
  == Frequently Asked Questions ==
55
 
56
  = I've installed the live chat plugin, now what? =
57
 
58
- Once installed and activated, a link should appear in your left navigation panel within your WP-ADMIN section. Click on the "Live Chat" link and follow the on screen instructions.
59
-
60
 
61
  == Screenshots ==
62
 
@@ -72,6 +63,15 @@ Once installed and activated, a link should appear in your left navigation panel
72
 
73
  == Changelog ==
74
 
 
 
 
 
 
 
 
 
 
75
  = 2.6 =
76
  * Fixed a bug that showed 'page not found' when saving the live chat settings
77
  * Better UI
3
  Donate link: http://www.wp-livechat.com
4
  Tags: live chat, live support, chat plugin, live help, wordpress chat, customer support, chat, live chat plugin
5
  Requires at least: 3.4
6
+ Tested up to: 3.8
7
  Stable tag: trunk
8
  License: GPLv2
9
 
10
+ Live Chat Support for Your Site for FREE!
11
 
12
  == Description ==
13
 
14
+ The most cost effective Live Chat plugin. Provide a live chat support for your visitors for free! WP Live Chat Support is perfect for small businesses. No third party live chat connections or subscriptions required. There's no need to pay for live chat monthly subscriptions in order to better understand your visitors. This is a fully functional live chat plugin. Increase your conversion rates by communicating directly with your visitors when they're ready to do so.
15
 
16
+ = Live Chat Free Version Features =
17
 
18
+ * WP Live Chat Support is a fully functional live chat plugin
19
+ * Initiate live chats with your visitors
20
+ * Easy to use interface for both the admin and the visitor
21
+ * No advertising or links
22
+ * No "Powered by" links on the live chat window
23
+ * No monthly live chat subscriptions needed
24
 
25
+ = Live Chat PRO Version Features =
26
 
27
+ * Initiate live chats with online visitors
28
+ * Chat to more than one visitor at a time
29
+ * Access historical live chat records
30
+ * Set up your user profile
31
+ * Add your company logo to the live chat window
32
+ * Add your photo to the live chat window
33
+ * Edit the style of your live chat window
34
+ * Edit all text fields
35
+ * World-class support
36
+ * Fully customizable live chat experience
 
37
 
38
  Get the [WP Live Chat Support Pro Add-on](http://wp-livechat.com/purchase-pro/) for only $14.95 once off!
39
 
 
 
 
 
 
 
 
40
  == Installation ==
41
 
42
  1. Once activated, click the "Live Chat" link under your settings tabs.
43
+ 2. Edit the settings to your preference under Live Chat -> Settings
44
  3. Test it out in a post or page.
45
 
 
46
  == Frequently Asked Questions ==
47
 
48
  = I've installed the live chat plugin, now what? =
49
 
50
+ Once installed and activated, a link should appear in your left navigation panel within your wp-admin section. Click on the "Live Chat" link and follow the on screen instructions.
 
51
 
52
  == Screenshots ==
53
 
63
 
64
  == Changelog ==
65
 
66
+ = 2.7 =
67
+ * Fixed the chat initiation bug
68
+ * Fixed the style bug
69
+ * Added support to email for proper smtp (pro)
70
+ * Fixed cookie bugs
71
+ * Add delete live chat history option (pro)
72
+ * Added UTF8 character support for the live chat
73
+ * Added error reporting (pro)
74
+
75
  = 2.6 =
76
  * Fixed a bug that showed 'page not found' when saving the live chat settings
77
  * Better UI
wp-live-chat-support.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Live Chat Support
4
  Plugin URI: http://www.wp-livechat.com
5
  Description: The easiest to use website live chat plugin. Let your visitors chat with you and increase sales conversion rates with WP Live Chat Support. No third party connection required!
6
- Version: 2.6
7
  Author: WP-LiveChat
8
  Author URI: http://www.wp-livechat.com
9
  */
@@ -17,7 +17,7 @@ global $wplc_tblname_chats;
17
  global $wplc_tblname_msgs;
18
  $wplc_tblname_chats = $wpdb->prefix . "wplc_chat_sessions";
19
  $wplc_tblname_msgs = $wpdb->prefix . "wplc_chat_msgs";
20
- $wplc_version = "2.6";
21
 
22
  require_once ("functions.php");
23
 
@@ -36,7 +36,11 @@ if (function_exists('wplc_head_pro')) {
36
  add_action('wp_enqueue_scripts', 'wplc_add_user_stylesheet' );
37
  add_action('admin_enqueue_scripts', 'wplc_add_admin_stylesheet');
38
 
39
- add_action('admin_menu', 'wplc_admin_menu');
 
 
 
 
40
  add_action('admin_head', 'wplc_superadmin_javascript');
41
  register_activation_hook( __FILE__, 'wplc_activate' );
42
 
@@ -64,7 +68,7 @@ function wplc_action_callback() {
64
 
65
 
66
  function wplc_admin_menu() {
67
- $wplc_mainpage = add_menu_page('WP Live Chat', __('Live Chat','wplivechat'), 'manage_options', 'wplivechat-menu', 'wplc_admin_menu_layout');
68
  add_submenu_page('wplivechat-menu', __('Settings','wplivechat'), __('Settings','wplivechat'), 'manage_options' , 'wplivechat-menu-settings', 'wplc_admin_settings_layout');
69
  add_submenu_page('wplivechat-menu', __('History','wplivechat'), __('History','wplivechat'), 'manage_options' , 'wplivechat-menu-history', 'wplc_admin_history_layout');
70
 
@@ -78,6 +82,7 @@ function wplc_user_top_js() {
78
  wp_register_script( 'wplc-user-jquery-cookie', plugins_url('/js/jquery-cookie.js', __FILE__) );
79
  wp_enqueue_script( 'wplc-user-jquery-cookie' );
80
  $wplc_settings = get_option("WPLC_SETTINGS");
 
81
  ?>
82
  <script type="text/javascript">
83
  <?php if (!function_exists("wplc_register_pro_version")) { ?>
@@ -86,6 +91,18 @@ function wplc_user_top_js() {
86
  var wplc_nonce = '<?php echo $ajax_nonce; ?>';
87
  </script>
88
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
89
  }
90
 
91
  function wplc_draw_user_box() {
@@ -121,7 +138,7 @@ function wplc_output_box() {
121
  } else {
122
  ?>
123
 
124
- <div id="wp-live-chat-minimize" style="display:none;"></div>
125
  <div id="wp-live-chat-close" style="display:none; background-color: <?php echo $wplc_settings_fill; ?> !important; color: <?php echo $wplc_settings_font; ?> !important;">X</div>
126
  <div id="wp-live-chat-1" style="background-color: <?php echo $wplc_settings_fill; ?> !important; color: <?php echo $wplc_settings_font; ?> !important;">
127
  <strong>Questions?</strong> Chat with us
@@ -590,8 +607,9 @@ function wplc_return_admin_chat_javascript($cid) {
590
  function wplc_activate() {
591
  wplc_handle_db();
592
  if (!get_option("WPLC_SETTINGS")) {
593
- add_option('WPLC_SETTINGS',array("wplc_settings_align" => "2", "wplc_settings_enabled" => "1", "wplc_settings_fill" => "73BE2", "wplc_settings_font" => "FFFFFF"));
594
  }
 
595
  }
596
 
597
 
@@ -622,20 +640,17 @@ function wplc_handle_db() {
622
  CREATE TABLE `".$wplc_tblname_msgs."` (
623
  `id` int(11) NOT NULL AUTO_INCREMENT,
624
  `chat_sess_id` int(11) NOT NULL,
625
- `from` varchar(150) NOT NULL,
626
- `msg` varchar(700) NOT NULL,
627
  `timestamp` datetime NOT NULL,
628
  `status` INT(3) NOT NULL,
629
  `originates` INT(3) NOT NULL,
630
  PRIMARY KEY (`id`)
631
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
632
  ";
633
 
634
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
635
  dbDelta($sql);
636
-
637
-
638
-
639
  add_option("wplc_db_version", $wplc_version);
640
  update_option("wplc_db_version",$wplc_version);
641
  }
@@ -684,198 +699,11 @@ function wplc_admin_history_layout() {
684
 
685
 
686
  function wplc_settings_page_basic() {
687
- echo"<div class=\"wrap\"><div id=\"icon-edit\" class=\"icon32 icon32-posts-post\"><br></div><h2>".__("WP Live Chat Support Settings","wplivechat")."</h2>";
688
-
689
- $wplc_settings = get_option("WPLC_SETTINGS");
690
-
691
-
692
- if ($wplc_settings["wplc_settings_align"]) { $wplc_settings_align[intval($wplc_settings["wplc_settings_align"])] = "SELECTED"; }
693
- if ($wplc_settings["wplc_settings_enabled"]) { $wplc_settings_enabled[intval($wplc_settings["wplc_settings_enabled"])] = "SELECTED"; }
694
- if ($wplc_settings["wplc_settings_fill"]) { $wplc_settings_fill = $wplc_settings["wplc_settings_fill"]; } else { $wplc_settings_fill = "73BE28"; }
695
- if ($wplc_settings["wplc_settings_font"]) { $wplc_settings_font = $wplc_settings["wplc_settings_font"]; } else { $wplc_settings_font = "FFFFFF"; }
696
-
697
-
698
-
699
- echo "<form action='' name='wplc_settings' method='POST' id='wplc_settings'>";
700
-
701
-
702
-
703
-
704
- if (function_exists("wplc_register_pro_version")) {
705
- $wplc_pro_chat_name = wplc_settings_page_pro('chat_name');
706
- $wplc_pro_chat_pic = wplc_settings_page_pro('chat_pic');
707
- $wplc_pro_chat_logo = wplc_settings_page_pro('chat_logo');
708
- $wplc_pro_chat_delay = wplc_settings_page_pro('chat_delay');
709
- $wplc_pro_chat_fs = wplc_settings_page_pro('wplc_chat_window_text1');
710
- $wplc_pro_chat_fs2 = wplc_settings_page_pro('wplc_chat_window_text2');
711
- $wplc_pro_chat_emailme = wplc_settings_page_pro('chat_email_on_chat');
712
- $wplc_pro_email_address = wplc_settings_page_pro('chat_email_address');
713
  } else {
714
- $wplc_pro_chat_name = "
715
- <tr>
716
- <td width='200' valign='top'>".__("Name","wplivechat").":</td>
717
- <td>
718
- <input type='text' size='50' maxlength='50' disabled readonly value='admin' /><small><i> ".__("available in the","wplivechat")." <a href=\"http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=name\" title=\"".__("Pro Add-on","wplivechat")."\" target=\"_BLANK\">".__("Pro Add-on","wplivechat")."</a> ".__("only","wplivechat").". </i></small>
719
- </td>
720
- </tr>
721
- ";
722
- $wplc_pro_chat_pic = "
723
- <tr>
724
- <td width='200' valign='top'>".__("Picture","wplivechat").":</td>
725
- <td>
726
- <input id=\"wplc_pro_pic_button\" type=\"button\" value=\"".__("Upload Image","wplivechat")."\" readonly disabled /><small><i> ".__("available in the","wplivechat")." <a href=\"http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=pic\" title=\"".__("Pro Add-on","wplivechat")."\" target=\"_BLANK\">".__("Pro Add-on","wplivechat")."</a> ".__("only","wplivechat").". </i></small>
727
- </td>
728
- </tr>
729
- ";
730
- $wplc_pro_chat_logo = "
731
- <tr>
732
- <td width='200' valign='top'>".__("Logo","wplivechat").":</td>
733
- <td>
734
- <input id=\"wplc_pro_logo_button\" type=\"button\" value=\"".__("Upload Image","wplivechat")."\" readonly disabled /><small><i> ".__("available in the","wplivechat")." <a href=\"http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=pic\" title=\"".__("Pro Add-on","wplivechat")."\" target=\"_BLANK\">".__("Pro Add-on","wplivechat")."</a> ".__("only","wplivechat").". </i></small>
735
- </td>
736
- </tr>
737
- ";
738
- $wplc_pro_chat_delay = "
739
- <tr>
740
- <td width='200' valign='top'>".__("Chat delay (seconds)","wplivechat").":</td>
741
- <td>
742
- <input type='text' size='50' maxlength='50' disabled readonly value='10' /> <small><i> ".__("available in the","wplivechat")." <a href=\"http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=delay\" title=\"".__("Pro Add-on","wplivechat")."\" target=\"_BLANK\">".__("Pro Add-on","wplivechat")."</a> ".__("only","wplivechat").". </i></small>
743
- </td>
744
- </tr>
745
- ";
746
- $wplc_pro_chat_emailme = "
747
- <tr>
748
- <td width='200' valign='top'>".__("Chat notifications","wplivechat").":</td>
749
- <td>
750
- <input id='wplc_pro_chat_notification' name='wplc_pro_chat_notification' type='checkbox' value='yes' disabled=\"disabled\" readonly/>
751
- ".__("Alert me via email as soon as someone wants to chat","wplivechat")."
752
- <small><i> ".__("available in the","wplivechat")." <a href=\"http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=alert\" title=\"".__("Pro Add-on","wplivechat")."\" target=\"_BLANK\">".__("Pro Add-on","wplivechat")."</a> ".__("only","wplivechat").". </i></small>
753
- </td>
754
- </tr>
755
- ";
756
- $wplc_pro_chat_fs = "
757
- <tr style='height:30px;'><td></td><td></td></tr>
758
- <tr>
759
- <td width='200' valign='top'>".__("First section text","wplivechat").":</td>
760
- <td>
761
- <input type='text' size='50' maxlength='50' class='regular-text' readonly value='Questions?' /> <br />
762
- <input type='text' size='50' maxlength='50' class='regular-text' readonly value='Chat with us' /> <br />
763
- </td>
764
- </tr>
765
- <tr>
766
- <td width='200' valign='top'>".__("Second section text","wplivechat").":</td>
767
- <td>
768
- <input type='text' size='50' maxlength='50' class='regular-text' readonly value='Start Chat' /> <br />
769
- <input type='text' size='50' maxlength='50' class='regular-text' readonly value='Connecting you to a sales person. Please be patient.' /> <br />
770
-
771
-
772
- </td>
773
- </tr>
774
- <tr>
775
- <td width='200' valign='top'>".__("Reactivate chat section text","wplivechat").":</td>
776
- <td>
777
- <input type='text' size='50' maxlength='50' class='regular-text' readonly value='Reactivating your previous chat...' /><small><i> ".__("Edit these text fields using the ","wplivechat")." <a href=\"http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=textfields3\" title=\"".__("Pro Add-on","wplivechat")."\" target=\"_BLANK\">".__("Pro Add-on","wplivechat")."</a>. </i></small> <br />
778
-
779
-
780
- </td>
781
- </tr>
782
- ";
783
- $wplc_pro_chat_fs2 = "
784
- <tr>
785
- <td width='200' valign='top'>".__("Offline text","wplivechat").":</td>
786
- <td>
787
- <input type='text' size='50' maxlength='50' class='regular-text' readonly value='Chat offline. Leave a message' /><small><i> ".__("Edit these text fields using the ","wplivechat")." <a href=\"http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=textfields4\" title=\"".__("Pro Add-on","wplivechat")."\" target=\"_BLANK\">".__("Pro Add-on","wplivechat")."</a>. </i></small> <br />
788
-
789
-
790
- </td>
791
- </tr>
792
- ";
793
- $wplc_pro_email_address = "
794
- <tr>
795
- <td width='200' valign='top'>".__("Email Address","wplivechat").":</td>
796
- <td>
797
- <input type='text' size='50' maxlength='150' class='regular-text' readonly value='' /><small><i> ".__("Get offline messages with the ","wplivechat")." <a href=\"http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=offlinemessages\" title=\"".__("Pro Add-on","wplivechat")."\" target=\"_BLANK\">".__("Pro Add-on","wplivechat")."</a>. </i></small> <br />
798
- </td>
799
- </tr>
800
- ";
801
  }
802
-
803
-
804
- echo "<div id=\"wplc_tabs\">";
805
- echo " <ul>";
806
- echo " <li><a href=\"#tabs-1\">".__("General Settings","wplivechat")."</a></li>";
807
- echo " <li><a href=\"#tabs-2\">".__("Chat Box","wplivechat")."</a></li>";
808
- echo " <li><a href=\"#tabs-3\">".__("Offline Messages","wplivechat")."</a></li>";
809
- echo " <li><a href=\"#tabs-4\">".__("Styling","wplivechat")."</a></li>";
810
- echo " </ul>";
811
- echo " <div id=\"tabs-1\">";
812
- echo " <h3>".__("Main Settings",'wplivechat')."</h3>";
813
- echo " <table class='form-table' width='700'>";
814
- echo " <tr>";
815
- echo " <td width='200' valign='top'>".__("Chat enabled","wplivechat").":</td>";
816
- echo " <td>";
817
- echo " <select id='wplc_settings_enabled' name='wplc_settings_enabled'>";
818
- echo " <option value=\"1\" ".$wplc_settings_enabled[1].">".__("Yes","wplivechat")."</option>";
819
- echo " <option value=\"2\" ".$wplc_settings_enabled[2].">".__("No","wplivechat")."</option>";
820
- echo " </select>";
821
- echo " </td>";
822
- echo " </tr>";
823
- echo " </table>";
824
-
825
- echo " </div>";
826
- echo " <div id=\"tabs-2\">";
827
- echo " <h3>".__("Chat Window Settings",'wplivechat')."</h3>";
828
- echo " <table class='form-table' width='700'>";
829
- echo " <tr>";
830
- echo " <td width='200' valign='top'>".__("Chat box alignment","wplivechat").":</td>";
831
- echo " <td>";
832
- echo " <select id='wplc_settings_align' name='wplc_settings_align'>";
833
- echo " <option value=\"1\" ".$wplc_settings_align[1].">".__("Bottom left","wplivechat")."</option>";
834
- echo " <option value=\"2\" ".$wplc_settings_align[2].">".__("Bottom right","wplivechat")."</option>";
835
- echo " </select>";
836
- echo " </td>";
837
- echo " </tr>";
838
- echo " $wplc_pro_chat_name";
839
- echo " $wplc_pro_chat_pic";
840
- echo " $wplc_pro_chat_logo";
841
- echo " $wplc_pro_chat_delay";
842
- echo " $wplc_pro_chat_emailme";
843
- echo " </table>";
844
-
845
- echo " </div>";
846
- echo " <div id=\"tabs-3\">";
847
- echo " <h3>".__("Offline Messages",'wplivechat')."</h3>";
848
- echo " <table class='form-table' width='700'>";
849
- echo " $wplc_pro_email_address";
850
- echo " $wplc_pro_chat_fs2";
851
- echo " </table>";
852
- echo " </div>";
853
-
854
- echo " <div id=\"tabs-4\">";
855
- echo " <h3>".__("Styling",'wplivechat')."</h3>";
856
- echo " <table class='form-table' width='700'>";
857
- echo " <tr>";
858
- echo " <td width='200' valign='top'>".__("Chat box fill color","wplivechat").":</td>";
859
- echo " <td>";
860
- echo " <input id=\"wplc_settings_fill\" name=\"wplc_settings_fill\" type=\"text\" class=\"color\" value=\"".$wplc_settings_fill."\" />";
861
- echo " </td>";
862
- echo " </tr>";
863
- echo " <tr>";
864
- echo " <td width='200' valign='top'>".__("Chat box font color","wplivechat").":</td>";
865
- echo " <td>";
866
- echo " <input id=\"wplc_settings_font\" name=\"wplc_settings_font\" type=\"text\" class=\"color\" value=\"".$wplc_settings_font."\" />";
867
- echo " </td>";
868
- echo " </tr>";
869
- echo " $wplc_pro_chat_fs";
870
- echo " </table>";
871
- echo " </div>";
872
- echo "</div>";
873
- echo "<p class='submit'><input type='submit' name='wplc_save_settings' class='button-primary' value='".__("Save Settings","wplivechat")."' /></p>";
874
- echo "</form>";
875
-
876
- echo "</div>";
877
-
878
-
879
  }
880
  function wplc_head_basic() {
881
  global $wpdb;
@@ -887,7 +715,7 @@ function wplc_head_basic() {
887
  $wplc_data['wplc_settings_font'] = esc_attr($_POST['wplc_settings_font']);
888
  $wplc_data['wplc_settings_enabled'] = esc_attr($_POST['wplc_settings_enabled']);
889
  update_option('WPLC_SETTINGS', $wplc_data);
890
-
891
  echo "<div class='updated'>";
892
  _e("Your settings have been saved.","wplivechat");
893
  echo "</div>";
3
  Plugin Name: WP Live Chat Support
4
  Plugin URI: http://www.wp-livechat.com
5
  Description: The easiest to use website live chat plugin. Let your visitors chat with you and increase sales conversion rates with WP Live Chat Support. No third party connection required!
6
+ Version: 2.7
7
  Author: WP-LiveChat
8
  Author URI: http://www.wp-livechat.com
9
  */
17
  global $wplc_tblname_msgs;
18
  $wplc_tblname_chats = $wpdb->prefix . "wplc_chat_sessions";
19
  $wplc_tblname_msgs = $wpdb->prefix . "wplc_chat_msgs";
20
+ $wplc_version = "2.7";
21
 
22
  require_once ("functions.php");
23
 
36
  add_action('wp_enqueue_scripts', 'wplc_add_user_stylesheet' );
37
  add_action('admin_enqueue_scripts', 'wplc_add_admin_stylesheet');
38
 
39
+ if(function_exists('wplc_admin_menu_pro')){
40
+ add_action('admin_menu', 'wplc_admin_menu_pro');
41
+ } else {
42
+ add_action('admin_menu', 'wplc_admin_menu');
43
+ }
44
  add_action('admin_head', 'wplc_superadmin_javascript');
45
  register_activation_hook( __FILE__, 'wplc_activate' );
46
 
68
 
69
 
70
  function wplc_admin_menu() {
71
+ $wplc_mainpage = add_menu_page('WP Live Chat', __('Live Chat','wplivechat'), 'read', 'wplivechat-menu', 'wplc_admin_menu_layout');
72
  add_submenu_page('wplivechat-menu', __('Settings','wplivechat'), __('Settings','wplivechat'), 'manage_options' , 'wplivechat-menu-settings', 'wplc_admin_settings_layout');
73
  add_submenu_page('wplivechat-menu', __('History','wplivechat'), __('History','wplivechat'), 'manage_options' , 'wplivechat-menu-history', 'wplc_admin_history_layout');
74
 
82
  wp_register_script( 'wplc-user-jquery-cookie', plugins_url('/js/jquery-cookie.js', __FILE__) );
83
  wp_enqueue_script( 'wplc-user-jquery-cookie' );
84
  $wplc_settings = get_option("WPLC_SETTINGS");
85
+
86
  ?>
87
  <script type="text/javascript">
88
  <?php if (!function_exists("wplc_register_pro_version")) { ?>
91
  var wplc_nonce = '<?php echo $ajax_nonce; ?>';
92
  </script>
93
  <?php
94
+
95
+ $hide_chat = get_option('WPLC_HIDE_CHAT');
96
+ if($hide_chat == true){
97
+ $hide_chat = "yes";
98
+ } else {
99
+ $hide_chat = '';
100
+ }
101
+ ?>
102
+ <script>
103
+ var hide_chat = "<?php echo $hide_chat; ?>";
104
+ </script>
105
+ <?php
106
  }
107
 
108
  function wplc_draw_user_box() {
138
  } else {
139
  ?>
140
 
141
+ <div id="wp-live-chat-minimize" style="display:none; background-color: <?php echo $wplc_settings_font; ?> !important; color: <?php echo $wplc_settings_fill; ?> !important;"></div>
142
  <div id="wp-live-chat-close" style="display:none; background-color: <?php echo $wplc_settings_fill; ?> !important; color: <?php echo $wplc_settings_font; ?> !important;">X</div>
143
  <div id="wp-live-chat-1" style="background-color: <?php echo $wplc_settings_fill; ?> !important; color: <?php echo $wplc_settings_font; ?> !important;">
144
  <strong>Questions?</strong> Chat with us
607
  function wplc_activate() {
608
  wplc_handle_db();
609
  if (!get_option("WPLC_SETTINGS")) {
610
+ add_option('WPLC_SETTINGS',array("wplc_settings_align" => "2", "wplc_settings_enabled" => "1", "wplc_settings_fill" => "73BE28", "wplc_settings_font" => "FFFFFF"));
611
  }
612
+ add_option("WPLC_HIDE_CHAT","true");
613
  }
614
 
615
 
640
  CREATE TABLE `".$wplc_tblname_msgs."` (
641
  `id` int(11) NOT NULL AUTO_INCREMENT,
642
  `chat_sess_id` int(11) NOT NULL,
643
+ `from` varchar(150) CHARACTER SET utf8 NOT NULL,
644
+ `msg` varchar(700) CHARACTER SET utf8 NOT NULL,
645
  `timestamp` datetime NOT NULL,
646
  `status` INT(3) NOT NULL,
647
  `originates` INT(3) NOT NULL,
648
  PRIMARY KEY (`id`)
649
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
650
  ";
651
 
652
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
653
  dbDelta($sql);
 
 
 
654
  add_option("wplc_db_version", $wplc_version);
655
  update_option("wplc_db_version",$wplc_version);
656
  }
699
 
700
 
701
  function wplc_settings_page_basic() {
702
+ if(function_exists("wplc_register_pro_version")){
703
+ wplc_settings_page_pro();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
704
  } else {
705
+ include 'includes/settings_page.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
706
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
707
  }
708
  function wplc_head_basic() {
709
  global $wpdb;
715
  $wplc_data['wplc_settings_font'] = esc_attr($_POST['wplc_settings_font']);
716
  $wplc_data['wplc_settings_enabled'] = esc_attr($_POST['wplc_settings_enabled']);
717
  update_option('WPLC_SETTINGS', $wplc_data);
718
+ update_option("WPLC_HIDE_CHAT", $_POST['wplc_hide_chat']);
719
  echo "<div class='updated'>";
720
  _e("Your settings have been saved.","wplivechat");
721
  echo "</div>";