WP Live Chat Support - Version 2.8

Version Description

  • Nothing required
Download this release

Release Info

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

Code changes from version 2.6 to 2.8

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,241 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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" value="true" readonly disabled/>
43
+ <small>
44
+ <i>
45
+ <?php _e("available in the","wplivechat")?>
46
+ <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>
47
+ <?php _e("only","wplivechat")?>
48
+ </i>
49
+ </small>
50
+ </td>
51
+ </tr>
52
+ </table>
53
+
54
+ </div>
55
+ <div id="tabs-2">
56
+ <h3><?php _e("Chat Window Settings",'wplivechat')?></h3>
57
+ <table class='form-table' width='700'>
58
+ <tr>
59
+ <td width='200' valign='top'><?php _e("Chat box alignment","wplivechat")?>:</td>
60
+ <td>
61
+ <select id='wplc_settings_align' name='wplc_settings_align'>
62
+ <option value="1" <?php $wplc_settings_align[1]?>><?php _e("Bottom left","wplivechat")?></option>
63
+ <option value="2" <?php $wplc_settings_align[2]?>><?php _e("Bottom right","wplivechat")?></option>
64
+ </select>
65
+ </td>
66
+ </tr>
67
+ <tr>
68
+ <!-- Chat Name-->
69
+ <td width='200' valign='top'>
70
+ <?php _e("Name","wplivechat")?>:
71
+ </td>
72
+ <td>
73
+ <input type='text' size='50' maxlength='50' disabled readonly value='admin' />
74
+ <small>
75
+ <i>
76
+ <?php _e("available in the","wplivechat")?>
77
+ <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>
78
+ <?php _e("only","wplivechat")?>
79
+ </i>
80
+ </small>
81
+ </td>
82
+ </tr>
83
+ <!-- Chat Pic-->
84
+ <tr>
85
+ <td width='200' valign='top'>
86
+ <?php _e("Picture","wplivechat")?>:
87
+ </td>
88
+ <td>
89
+ <input id="wplc_pro_pic_button" type="button" value="<?php _e("Upload Image","wplivechat")?>" readonly disabled />
90
+ <small>
91
+ <i>
92
+ <?php _e("available in the","wplivechat")?>
93
+ <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>
94
+ <?php _e("only","wplivechat")?>
95
+ </i>
96
+ </small>
97
+ </td>
98
+ </tr>
99
+ <!-- Chat Logo-->
100
+ <tr>
101
+ <td width='200' valign='top'>
102
+ <?php _e("Logo","wplivechat")?>:
103
+ </td>
104
+ <td>
105
+ <input id="wplc_pro_logo_button" type="button" value="<?php _e("Upload Image","wplivechat")?>" readonly disabled />
106
+ <small>
107
+ <i>
108
+ <?php _e("available in the","wplivechat")?>
109
+ <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>
110
+ <?php _e("only","wplivechat")?>
111
+ </i>
112
+ </small>
113
+ </td>
114
+ </tr>
115
+ <!-- Chat Delay-->
116
+ <tr>
117
+ <td width='200' valign='top'>
118
+ <?php _e("Chat delay (seconds)","wplivechat")?>:
119
+ </td>
120
+ <td>
121
+ <input type='text' size='50' maxlength='50' disabled readonly value='10' />
122
+ <small>
123
+ <i>
124
+ <?php _e("available in the","wplivechat")?>
125
+ <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>
126
+ <?php _e("only","wplivechat")?>
127
+ </i>
128
+ </small>
129
+ </td>
130
+ </tr>
131
+ <!-- Chat Notification if want to chat-->
132
+ <tr>
133
+ <td width='200' valign='top'>
134
+ <?php _e("Chat notifications","wplivechat")?>:
135
+ </td>
136
+ <td>
137
+ <input id='wplc_pro_chat_notification' name='wplc_pro_chat_notification' type='checkbox' value='yes' disabled="disabled" readonly/>
138
+ <?php _e("Alert me via email as soon as someone wants to chat","wplivechat")?>
139
+ <small>
140
+ <i>
141
+ <?php _e("available in the","wplivechat")?>
142
+ <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>
143
+ <?php _e("only","wplivechat")?>
144
+ </i>
145
+ </small>
146
+ </td>
147
+ </tr>
148
+ </table>
149
+
150
+ </div>
151
+ <div id="tabs-3">
152
+ <h3><?php _e("Offline Messages",'wplivechat')?></h3>
153
+ <table class='form-table' width='700'>
154
+ <tr>
155
+ <td width='200' valign='top'>
156
+ <?php _e("Email Address","wplivechat")?>:
157
+ </td>
158
+ <td>
159
+ <input type='text' size='50' maxlength='150' class='regular-text' readonly value='' />
160
+ <small>
161
+ <i>
162
+ <?php _e("Get offline messages with the ","wplivechat")?>
163
+ <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>.
164
+ </i>
165
+ </small>
166
+ <br />
167
+ </td>
168
+ </tr>
169
+ <tr>
170
+ <td width='200' valign='top'>
171
+ <?php _e("Offline text","wplivechat")?>:
172
+ </td>
173
+ <td>
174
+ <input type='text' size='50' maxlength='50' class='regular-text' readonly value='Chat offline. Leave a message' />
175
+ <small>
176
+ <i> <?php _e("Edit these text fields using the ","wplivechat")?>
177
+ <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>
178
+ </i>
179
+ </small>
180
+ <br />
181
+ </td>
182
+ </tr>
183
+
184
+ </table>
185
+ </div>
186
+
187
+
188
+ <div id="tabs-4">
189
+ <h3><?php _e("Styling",'wplivechat')?></h3>
190
+ <table class='form-table' width='700'>
191
+ <tr>
192
+ <td width='200' valign='top'><?php _e("Chat box fill color","wplivechat")?>:</td>
193
+ <td>
194
+ <input id="wplc_settings_fill" name="wplc_settings_fill" type="text" class="color" value="<?php echo $wplc_settings_fill;?>" />
195
+ </td>
196
+ </tr>
197
+ <tr>
198
+ <td width='200' valign='top'><?php _e("Chat box font color","wplivechat")?>:</td>
199
+ <td>
200
+ <input id="wplc_settings_font" name="wplc_settings_font" type="text" class="color" value="<?php echo $wplc_settings_font;?>" />
201
+ </td>
202
+ </tr>
203
+ <tr style='height:30px;'><td></td><td></td></tr>
204
+ <tr>
205
+ <td width='200' valign='top'><?php _e("First section text","wplivechat")?>:</td>
206
+ <td>
207
+ <input type='text' size='50' maxlength='50' class='regular-text' readonly value='Questions?' /> <br />
208
+ <input type='text' size='50' maxlength='50' class='regular-text' readonly value='Chat with us' /> <br />
209
+ </td>
210
+ </tr>
211
+ <tr>
212
+ <td width='200' valign='top'><?php _e("Second section text","wplivechat") ?>:</td>
213
+ <td>
214
+ <input type='text' size='50' maxlength='50' class='regular-text' readonly value='Start Chat' /> <br />
215
+ <input type='text' size='50' maxlength='50' class='regular-text' readonly value='Connecting you to a sales person. Please be patient.' /> <br />
216
+
217
+
218
+ </td>
219
+ </tr>
220
+ <tr>
221
+ <td width='200' valign='top'><?php _e("Reactivate chat section text","wplivechat")?>:</td>
222
+ <td>
223
+ <input type='text' size='50' maxlength='50' class='regular-text' readonly value='Reactivating your previous chat...' />
224
+ <small>
225
+ <i>
226
+ <?php _e("Edit these text fields using the ","wplivechat")?>
227
+ <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>.
228
+ </i>
229
+ </small>
230
+ <br />
231
+
232
+
233
+ </td>
234
+ </tr>
235
+ </table>
236
+ </div>
237
+ </div>
238
+ <p class='submit'><input type='submit' name='wplc_save_settings' class='button-primary' value='<?php _e("Save Settings","wplivechat")?>' /></p>
239
+ </form>
240
+
241
+ </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
@@ -1,9 +1,9 @@
1
  === WP Live Chat Support ===
2
  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
 
@@ -11,7 +11,7 @@ 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
 
@@ -35,7 +35,7 @@ The most cost effective Live Chat plugin. Chat with your visitors for free! WP L
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
 
@@ -72,6 +72,9 @@ 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
1
  === WP Live Chat Support ===
2
  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, live support plugin, live chat support plugin
5
+ Requires at least: 3.5
6
+ Tested up to: 3.8.1
7
  Stable tag: trunk
8
  License: GPLv2
9
 
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 using WP Live Chat Support.
15
 
16
  = Free Version Features =
17
 
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 $24.95 once off!
39
 
40
  = Coming Soon =
41
 
72
 
73
  == Changelog ==
74
 
75
+ = 2.7 =
76
+ * Fixed bug that stopped dynamic css loading in some themes
77
+
78
  = 2.6 =
79
  * Fixed a bug that showed 'page not found' when saving the live chat settings
80
  * 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,10 +17,9 @@ 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
 
 
24
  add_action('wp_ajax_wplc_admin_set_transient', 'wplc_action_callback');
25
 
26
  add_action('wp_footer', 'wplc_display_box');
@@ -36,7 +35,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 +67,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 +81,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 +90,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 +137,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
@@ -359,7 +375,7 @@ function wplc_admin_menu_layout_display() {
359
  <?php if (function_exists("wplc_register_pro_version")) { wplc_list_chats_pro(); } else { wplc_list_chats(); } ?>
360
  </div>
361
  <h1>Online Visitors</h1>
362
- <p><?php _e("With the Pro add-on of WP Live Chat Support, you can","wplivechat"); ?> <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=initiate1" title="<?php _e("see who's online and initiate chats","wplivechat"); ?>" target=\"_BLANK\"><?php _e("see who's online and initiate chats","wplivechat"); ?></a> <?php _e("with your online visitors with the click of a button.","wplivechat"); ?> <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=initiate2" title="<?php _e("Buy the Pro add-on now for only $14.95 once off. Updates free forever.","wplivechat"); ?>" target=\"_BLANK\"><strong><?php _e("Buy the Pro add-on now for only $14.95 once off. Updates free forever.","wplivechat"); ?></strong></a></p>
363
  <?php
364
  }
365
  else {
@@ -590,8 +606,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 +639,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
  }
@@ -678,204 +692,17 @@ function wplc_admin_history_layout() {
678
  wplc_pro_admin_display_history();
679
  }
680
  else {
681
- echo "<br /><br >This option is only available in the <a href=\"http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=history1\" title=\"".__("Pro Add-on","wplivechat")."\" target=\"_BLANK\">Pro Add-on</a> of WP Live Chat. <a href=\"http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=history2\" title=\"".__("Pro Add-on","wplivechat")."\" target=\"_BLANK\">Get it now for only $14.95 once off!</a>";
682
  }
683
  }
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 +714,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.8
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.8";
 
 
21
 
22
+ require_once (plugin_dir_path( __FILE__ )."functions.php");
23
  add_action('wp_ajax_wplc_admin_set_transient', 'wplc_action_callback');
24
 
25
  add_action('wp_footer', 'wplc_display_box');
35
  add_action('wp_enqueue_scripts', 'wplc_add_user_stylesheet' );
36
  add_action('admin_enqueue_scripts', 'wplc_add_admin_stylesheet');
37
 
38
+ if(function_exists('wplc_admin_menu_pro')){
39
+ add_action('admin_menu', 'wplc_admin_menu_pro');
40
+ } else {
41
+ add_action('admin_menu', 'wplc_admin_menu');
42
+ }
43
  add_action('admin_head', 'wplc_superadmin_javascript');
44
  register_activation_hook( __FILE__, 'wplc_activate' );
45
 
67
 
68
 
69
  function wplc_admin_menu() {
70
+ $wplc_mainpage = add_menu_page('WP Live Chat', __('Live Chat','wplivechat'), 'read', 'wplivechat-menu', 'wplc_admin_menu_layout');
71
  add_submenu_page('wplivechat-menu', __('Settings','wplivechat'), __('Settings','wplivechat'), 'manage_options' , 'wplivechat-menu-settings', 'wplc_admin_settings_layout');
72
  add_submenu_page('wplivechat-menu', __('History','wplivechat'), __('History','wplivechat'), 'manage_options' , 'wplivechat-menu-history', 'wplc_admin_history_layout');
73
 
81
  wp_register_script( 'wplc-user-jquery-cookie', plugins_url('/js/jquery-cookie.js', __FILE__) );
82
  wp_enqueue_script( 'wplc-user-jquery-cookie' );
83
  $wplc_settings = get_option("WPLC_SETTINGS");
84
+
85
  ?>
86
  <script type="text/javascript">
87
  <?php if (!function_exists("wplc_register_pro_version")) { ?>
90
  var wplc_nonce = '<?php echo $ajax_nonce; ?>';
91
  </script>
92
  <?php
93
+
94
+ $hide_chat = get_option('WPLC_HIDE_CHAT');
95
+ if($hide_chat == true){
96
+ $hide_chat = "yes";
97
+ } else {
98
+ $hide_chat = '';
99
+ }
100
+ ?>
101
+ <script>
102
+ var hide_chat = "<?php echo $hide_chat; ?>";
103
+ </script>
104
+ <?php
105
  }
106
 
107
  function wplc_draw_user_box() {
137
  } else {
138
  ?>
139
 
140
+ <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>
141
  <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>
142
  <div id="wp-live-chat-1" style="background-color: <?php echo $wplc_settings_fill; ?> !important; color: <?php echo $wplc_settings_font; ?> !important;">
143
  <strong>Questions?</strong> Chat with us
375
  <?php if (function_exists("wplc_register_pro_version")) { wplc_list_chats_pro(); } else { wplc_list_chats(); } ?>
376
  </div>
377
  <h1>Online Visitors</h1>
378
+ <p><?php _e("With the Pro add-on of WP Live Chat Support, you can","wplivechat"); ?> <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=initiate1" title="<?php _e("see who's online and initiate chats","wplivechat"); ?>" target=\"_BLANK\"><?php _e("see who's online and initiate chats","wplivechat"); ?></a> <?php _e("with your online visitors with the click of a button.","wplivechat"); ?> <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=initiate2" title="<?php _e("Buy the Pro add-on now for only $24.95 once off. Free Updates FOREVER.","wplivechat"); ?>" target=\"_BLANK\"><strong><?php _e("Buy the Pro add-on now for only $24.95 once off. Free Updates Forever.","wplivechat"); ?></strong></a></p>
379
  <?php
380
  }
381
  else {
606
  function wplc_activate() {
607
  wplc_handle_db();
608
  if (!get_option("WPLC_SETTINGS")) {
609
+ add_option('WPLC_SETTINGS',array("wplc_settings_align" => "2", "wplc_settings_enabled" => "1", "wplc_settings_fill" => "73BE28", "wplc_settings_font" => "FFFFFF"));
610
  }
611
+ add_option("WPLC_HIDE_CHAT","true");
612
  }
613
 
614
 
639
  CREATE TABLE `".$wplc_tblname_msgs."` (
640
  `id` int(11) NOT NULL AUTO_INCREMENT,
641
  `chat_sess_id` int(11) NOT NULL,
642
+ `from` varchar(150) CHARACTER SET utf8 NOT NULL,
643
+ `msg` varchar(700) CHARACTER SET utf8 NOT NULL,
644
  `timestamp` datetime NOT NULL,
645
  `status` INT(3) NOT NULL,
646
  `originates` INT(3) NOT NULL,
647
  PRIMARY KEY (`id`)
648
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
649
  ";
650
 
651
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
652
  dbDelta($sql);
 
 
 
653
  add_option("wplc_db_version", $wplc_version);
654
  update_option("wplc_db_version",$wplc_version);
655
  }
692
  wplc_pro_admin_display_history();
693
  }
694
  else {
695
+ echo "<br /><br >This option is only available in the <a href=\"http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=history1\" title=\"".__("Pro Add-on","wplivechat")."\" target=\"_BLANK\">Pro Add-on</a> of WP Live Chat. <a href=\"http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=history2\" title=\"".__("Pro Add-on","wplivechat")."\" target=\"_BLANK\">Get it now for only $24.95 once off!</a>";
696
  }
697
  }
698
 
699
 
700
  function wplc_settings_page_basic() {
701
+ if(function_exists("wplc_register_pro_version")){
702
+ wplc_settings_page_pro();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
703
  } else {
704
+ include 'includes/settings_page.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
705
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
706
  }
707
  function wplc_head_basic() {
708
  global $wpdb;
714
  $wplc_data['wplc_settings_font'] = esc_attr($_POST['wplc_settings_font']);
715
  $wplc_data['wplc_settings_enabled'] = esc_attr($_POST['wplc_settings_enabled']);
716
  update_option('WPLC_SETTINGS', $wplc_data);
717
+ update_option("WPLC_HIDE_CHAT", $_POST['wplc_hide_chat']);
718
  echo "<div class='updated'>";
719
  _e("Your settings have been saved.","wplivechat");
720
  echo "</div>";