WP Live Chat Support - Version 4.3.0

Version Description

2015-04-13 - Low Priority = * Enhancement: Animations settings have been moved to the 'Styling' tab. * New Feature: Blocked User functionality has been moved to the Free version * Enhancement: All descriptions have been put into tooltips for a cleaner page * New Feature: Functionality added in to handle Chat Experience Ratings (Premium Add-on)

Download this release

Release Info

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

Code changes from version 4.2.12 to 4.3.0

ajax.php CHANGED
@@ -13,7 +13,9 @@ define('SHORTINIT', true);
13
  require_once( '../../../wp-load.php' );
14
 
15
 
16
- define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // full path, no trailing slash
 
 
17
 
18
  $iterations = 55;
19
  /* time in microseconds between updating the user on the page within the DB (lower number = higher resource usage) */
@@ -146,8 +148,8 @@ if ($check == 1) {
146
  }
147
  if ($_POST['action'] == "wplc_admin_close_chat") {
148
  $chat_id = sanitize_text_field($_POST['cid']);
149
- wplc_change_chat_status($chat_id,1);
150
- echo 'done';
151
  }
152
  if ($_POST['action'] == "wplc_admin_send_msg") {
153
  $chat_id = sanitize_text_field($_POST['cid']);
13
  require_once( '../../../wp-load.php' );
14
 
15
 
16
+ if (!defined('WP_PLUGIN_DIR')) {
17
+ define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // full path, no trailing slash
18
+ }
19
 
20
  $iterations = 55;
21
  /* time in microseconds between updating the user on the page within the DB (lower number = higher resource usage) */
148
  }
149
  if ($_POST['action'] == "wplc_admin_close_chat") {
150
  $chat_id = sanitize_text_field($_POST['cid']);
151
+ wplc_change_chat_status($chat_id,1);
152
+ echo 'done';
153
  }
154
  if ($_POST['action'] == "wplc_admin_send_msg") {
155
  $chat_id = sanitize_text_field($_POST['cid']);
css/wplcstyle.css CHANGED
@@ -337,4 +337,11 @@
337
 
338
  .wplc-user-message hr, .wplc-admin-message hr{
339
  margin-bottom: 0px !important;
 
 
 
 
 
 
 
340
  }
337
 
338
  .wplc-user-message hr, .wplc-admin-message hr{
339
  margin-bottom: 0px !important;
340
+ }
341
+
342
+ /* MOVE TO CHAT EXPERIENCE PLUGIN */
343
+
344
+ #wplc_star_rating{
345
+ text-align: center;
346
+ padding: 10px;
347
  }
functions.php CHANGED
@@ -592,27 +592,36 @@ function wplc_return_status($status) {
592
  function wplc_user_initiate_chat($name,$email,$cid = null,$session) {
593
  global $wpdb;
594
  global $wplc_tblname_chats;
595
-
596
  if (function_exists("wplc_list_chats_pro")) { /* check if functions-pro is around */
597
  wplc_pro_notify_via_email();
598
  }
599
 
600
- if ($cid != null) { /* change from a visitor to a chat */
601
 
602
- $wplc_settings = get_option('WPLC_SETTINGS');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
603
 
604
- if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
605
- $user_data = array(
606
- 'ip' => $_SERVER['REMOTE_ADDR'],
607
- 'user_agent' => $_SERVER['HTTP_USER_AGENT']
608
- );
609
- } else {
610
- $user_data = array(
611
- 'ip' => "",
612
- 'user_agent' => $_SERVER['HTTP_USER_AGENT']
613
- );
614
- }
615
-
616
  $query =
617
  "
618
  UPDATE $wplc_tblname_chats
@@ -634,19 +643,7 @@ function wplc_user_initiate_chat($name,$email,$cid = null,$session) {
634
  }
635
  else { // create new ID for the chat
636
 
637
- $wplc_settings = get_option('WPLC_SETTINGS');
638
 
639
- if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
640
- $user_data = array(
641
- 'ip' => $_SERVER['REMOTE_ADDR'],
642
- 'user_agent' => $_SERVER['HTTP_USER_AGENT']
643
- );
644
- } else {
645
- $user_data = array(
646
- 'ip' => "",
647
- 'user_agent' => $_SERVER['HTTP_USER_AGENT']
648
- );
649
- }
650
 
651
  $ins_array = array(
652
  'status' => '2',
@@ -927,4 +924,24 @@ function wplc_admin_display_missed_chats() {
927
  echo "
928
  </tbody>
929
  </table>";
930
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
592
  function wplc_user_initiate_chat($name,$email,$cid = null,$session) {
593
  global $wpdb;
594
  global $wplc_tblname_chats;
595
+
596
  if (function_exists("wplc_list_chats_pro")) { /* check if functions-pro is around */
597
  wplc_pro_notify_via_email();
598
  }
599
 
600
+ $wplc_settings = get_option('WPLC_SETTINGS');
601
 
602
+ if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
603
+ $user_data = array(
604
+ 'ip' => $_SERVER['REMOTE_ADDR'],
605
+ 'user_agent' => $_SERVER['HTTP_USER_AGENT']
606
+ );
607
+ $wplc_ce_ip = $_SERVER['REMOTE_ADDR'];
608
+ } else {
609
+ $user_data = array(
610
+ 'ip' => "",
611
+ 'user_agent' => $_SERVER['HTTP_USER_AGENT']
612
+ );
613
+ $wplc_ce_ip = null;
614
+ }
615
+
616
+ if(function_exists('wplc_ce_activate')){
617
+ /* Log the chat for statistical purposes as well */
618
+ if(function_exists('wplc_ce_record_initial_chat')){
619
+ wplc_ce_record_initial_chat($name, $email, $cid, $wplc_ce_ip, $_SERVER['HTTP_REFERER']);
620
+ }
621
+ }
622
+
623
+ if ($cid != null) { /* change from a visitor to a chat */
624
 
 
 
 
 
 
 
 
 
 
 
 
 
625
  $query =
626
  "
627
  UPDATE $wplc_tblname_chats
643
  }
644
  else { // create new ID for the chat
645
 
 
646
 
 
 
 
 
 
 
 
 
 
 
 
647
 
648
  $ins_array = array(
649
  'status' => '2',
924
  echo "
925
  </tbody>
926
  </table>";
927
+ }
928
+
929
+ function wplc_is_user_banned_basic(){
930
+ $banned_ip = get_option('WPLC_BANNED_IP_ADDRESSES');
931
+ if($banned_ip){
932
+ $banned_ip = maybe_unserialize($banned_ip);
933
+ $banned = 0;
934
+ foreach($banned_ip as $ip){
935
+ if(isset($_SERVER['REMOTE_ADDR'])){
936
+ if($ip == $_SERVER['REMOTE_ADDR']){
937
+ $banned++;
938
+ }
939
+ } else {
940
+ $banned = 0;
941
+ }
942
+ }
943
+ } else {
944
+ $banned = 0;
945
+ }
946
+ return $banned;
947
+ }
includes/settings_page.php CHANGED
@@ -1,7 +1,13 @@
1
  <div class="wrap">
 
 
 
 
 
2
  <div id="icon-edit" class="icon32 icon32-posts-post">
3
  <br>
4
  </div>
 
5
  <h2><?php _e("WP Live Chat Support Settings","wplivechat")?></h2>
6
  <?php
7
  $wplc_settings = get_option("WPLC_SETTINGS");
@@ -21,14 +27,13 @@
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
  <li><a href="#tabs-5"><?php _e("Agents", "wplivechat") ?></a></li>
24
- <li><a href="#tabs-6"><?php _e("Animations", "wplivechat") ?></a></li>
25
  <li><a href="#tabs-7"><?php _e("Blocked Visitors", "wplivechat") ?></a></li>
26
  </ul>
27
  <div id="tabs-1">
28
  <h3><?php _e("Main Settings",'wplivechat')?></h3>
29
  <table class='form-table' width='700'>
30
  <tr>
31
- <td width='400' valign='top'><?php _e("Chat enabled","wplivechat")?>:</td>
32
  <td>
33
  <select id='wplc_settings_enabled' name='wplc_settings_enabled'>
34
  <option value="1" <?php if (isset($wplc_settings_enabled[1])) { echo $wplc_settings_enabled[1]; } ?>><?php _e("Yes","wplivechat"); ?></option>
@@ -37,8 +42,7 @@
37
  </td>
38
  </tr>
39
  <tr>
40
- <td width='200' valign='top'><?php _e("Choose when I want to be online","wplivechat")?>:
41
- <p class="description"><?php _e('Checking this will allow you to change your status to "Online" or "Offline" on the "Live Chat" page.', 'wplivechat'); ?></p>
42
  </td>
43
  <td>
44
  <input type="checkbox" name="wplc_auto_online" disabled readonly="readonly"/>
@@ -53,8 +57,7 @@
53
  </tr>
54
  <tr>
55
  <td width='200' valign='top'>
56
- <?php _e("Hide Chat","wplivechat")?>:
57
- <p class="description"><?php _e("Hides chat for 24hrs when user clicks X", "wplivechat") ?> </p>
58
  </td>
59
  <td valign='top'>
60
  <input type="checkbox" value="true" readonly disabled/>
@@ -70,8 +73,7 @@
70
  </tr>
71
  <tr>
72
  <td width='200' valign='top'>
73
- <?php _e("Require Name And Email","wplivechat")?>:
74
- <p class="description"><?php _e("Users will have to enter their Name and Email Address when starting a chat", "wplivechat") ?></p>
75
  </td>
76
  <td valign='top'>
77
  <input type="checkbox" value="1" name="wplc_require_user_info" <?php if(isset($wplc_settings['wplc_require_user_info']) && $wplc_settings['wplc_require_user_info'] == 1 ) { echo "checked"; } ?> />
@@ -79,8 +81,7 @@
79
  </tr>
80
  <tr>
81
  <td width='200' valign='top'>
82
- <?php _e("Input Field Replacement Text","wplivechat")?>:
83
- <p class="description"><?php _e("This is the text that will show in place of the Name And Email fields", "wplivechat") ?></p>
84
  </td>
85
  <td valign='top'>
86
  <textarea cols="45" rows="5" name="wplc_user_alternative_text" ><?php if(isset($wplc_settings['wplc_user_alternative_text'])) { echo stripslashes($wplc_settings['wplc_user_alternative_text']); } ?></textarea>
@@ -88,8 +89,7 @@
88
  </tr>
89
  <tr>
90
  <td width='200' valign='top'>
91
- <?php _e("Use Logged In User Details","wplivechat")?>:
92
- <p class="description"><?php _e("A user's Name and Email Address will be used by default if they are logged in.", "wplivechat") ?></p>
93
  </td>
94
  <td valign='top'>
95
  <input type="checkbox" value="1" name="wplc_loggedin_user_info" <?php if(isset($wplc_settings['wplc_loggedin_user_info']) && $wplc_settings['wplc_loggedin_user_info'] == 1 ) { echo "checked"; } ?> />
@@ -97,8 +97,7 @@
97
  </tr>
98
  <tr>
99
  <td width='200' valign='top'>
100
- <?php _e("Enable On Mobile Devices","wplivechat"); ?>
101
- <p class="description"><?php _e("Disabling this will mean that the Chat Box will not be displayed on mobile devices. (Smartphones and Tablets)", "wplivechat") ?></p>
102
  </td>
103
  <td valign='top'>
104
  <input type="checkbox" value="1" name="wplc_enabled_on_mobile" <?php if(isset($wplc_settings['wplc_enabled_on_mobile']) && $wplc_settings['wplc_enabled_on_mobile'] == 1 ) { echo "checked"; } ?> />
@@ -106,8 +105,7 @@
106
  </tr>
107
  <tr>
108
  <td width='200' valign='top'>
109
- <?php _e("Record a visitor's IP Address","wplivechat"); ?>
110
- <p class="description"><?php _e("Disable this to enable anonymity for your visitors", "wplivechat") ?></p>
111
  </td>
112
  <td valign='top'>
113
  <input type="checkbox" value="1" name="wplc_record_ip_address" <?php if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1 ) { echo "checked"; } ?> />
@@ -115,8 +113,7 @@
115
  </tr>
116
  <tr>
117
  <td width='200' valign='top'>
118
- <?php _e("Include chat window on the following pages:","wplivechat"); ?>
119
- <p class="description"><?php _e("Show the chat window on the following pages. Leave blank to show on all. (Use comma-separated Page ID's)", "wplivechat") ?></p>
120
  </td>
121
  <td valign='top'>
122
  <input type="text" readonly="readonly" />
@@ -131,8 +128,7 @@
131
  </tr>
132
  <tr>
133
  <td width='200' valign='top'>
134
- <?php _e("Exclude chat window on the following pages:","wplivechat"); ?>
135
- <p class="description"><?php _e("Do not show the chat window on the following pages. Leave blank to show on all. (Use comma-separated Page ID's)", "wplivechat") ?></p>
136
  </td>
137
  <td valign='top'>
138
  <input type="text" readonly="readonly"/>
@@ -145,9 +141,7 @@
145
  </small>
146
  </td>
147
  </tr>
148
-
149
  </table>
150
-
151
  </div>
152
  <div id="tabs-2">
153
  <h3><?php _e("Chat Window Settings",'wplivechat')?></h3>
@@ -165,11 +159,10 @@
165
  </tr>
166
  <tr>
167
  <td>
168
- <?php _e("Auto Pop-up","wplivechat") ?>
169
  </td>
170
  <td>
171
  <input type="checkbox" name="wplc_auto_pop_up" value="1" <?php if(isset($wplc_settings['wplc_auto_pop_up']) && $wplc_settings['wplc_auto_pop_up'] == 1 ) { echo "checked"; } ?>/>
172
- <p class="description"><small><?php _e("Expand the chat box automatically (prompts the user to enter their name and email address).","wplivechat") ?></small></p>
173
  </td>
174
  </tr>
175
  <tr>
@@ -255,18 +248,17 @@
255
  </tr>
256
  <tr>
257
  <td>
258
- <?php _e("Display name and avatar in chat", "wplivechat") ?>
259
  </td>
260
  <td>
261
  <input type="checkbox" name="wplc_display_name" value="1" <?php if (isset($wplc_settings['wplc_display_name']) && $wplc_settings['wplc_display_name'] == 1) {
262
  echo "checked";
263
  } ?>/>
264
- <p class="description"><small><?php _e("Display the agent and user name above each message in the chat window.", "wplivechat") ?></small></p>
265
  </td>
266
  </tr>
267
  <tr>
268
  <td>
269
- <?php _e("Only show the chat window to users that are logged in", "wplivechat") ?>
270
  </td>
271
  <td>
272
  <input type="checkbox" name="wplc_display_to_loggedin_only" value="1" <?php
@@ -274,7 +266,6 @@
274
  echo "checked";
275
  }
276
  ?>/>
277
- <p class="description"><small><?php _e("By checking this, only users that are logged in will be able to chat with you.", "wplivechat") ?></small></p>
278
  </td>
279
  </tr>
280
  </table>
@@ -285,11 +276,10 @@
285
  <table class='form-table' width='700'>
286
  <tr>
287
  <td>
288
- <?php _e("Do not allow users to send offline messages", "wplivechat") ?>
289
  </td>
290
  <td>
291
- <input type="checkbox" name="wplc_hide_when_offline" value="1" readonly="readonly"/>
292
- <p class="description"><small><?php _e("The chat window will be hidden when it is offline. Users will not be able to send offline messages to you", "wplivechat") ?></small></p>
293
  </td>
294
  </tr>
295
  <tr>
@@ -399,13 +389,6 @@
399
 
400
  </td>
401
  </tr>
402
- </table>
403
- </div>
404
- <div id="tabs-5">
405
- <h3><?php _e("Multiple Agents", "wplivechat") ?></h3>
406
- <p><?php _e("Get","wplivechat") ?> <a href="http://wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=multipleAgents" target="_BLANK"><?php _e("Multiple agent support", "wplivechat") ?></a></p>
407
- </div>
408
- <div id="tabs-6">
409
  <style>
410
  .wplc_animation_block div{
411
  display: inline-block;
@@ -429,41 +412,51 @@
429
  .wplc_animation_active{
430
  box-shadow: 2px 2px 2px #CCC;
431
  }
432
- </style>
433
- <h3><?php _e("Animations", "wplivechat") ?></h3>
434
- <p><?php _e("Get a variety of animations in the ","wplivechat") ?> <a href="http://wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=animations" target="_BLANK"><?php _e("Pro add-on", "wplivechat") ?></a></p>
435
- <table class='form-table'>
436
- <tr>
437
- <th><label for=""><?php _e('Choose an animation (Pro Only)', 'sola_t'); ?></label></th>
438
-
439
- <td>
440
- <div class='wplc_animation_block'>
441
- <div class='wplc_animation_image'>
442
- <i class="fa fa-arrow-circle-up wplc_orange"></i>
443
- <p><?php _e('Slide Up', 'wplivechat'); ?></p>
444
- </div>
445
- <div class='wplc_animation_image'>
446
- <i class="fa fa-arrows-h wplc_red"></i>
447
- <p><?php _e('Slide From The Side', 'wplivechat'); ?></p>
448
- </div>
449
- <div class='wplc_animation_image'>
450
- <i class="fa fa-arrows-alt wplc_orange"></i>
451
- <p><?php _e('Fade In', 'wplivechat'); ?></p>
452
- </div>
453
- <div class='wplc_animation_image'>
454
- <i class="fa fa-thumb-tack wplc_red"></i>
455
- <p><?php _e('No Animation', 'wplivechat'); ?></p>
456
- </div>
457
- </div>
458
- </td>
459
- </tr>
460
- </table>
 
 
 
 
461
  </div>
462
  <div id="tabs-7">
463
  <h3><?php _e("Blocked Visitors - Based on IP Address", "wplivechat") ?></h3>
464
- <small><i> <?php _e("Block visitors from chatting to you based on their IP address using the ","wplivechat")?><a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=blocked_visitors" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a></i></small>
465
- <br/><br/>
466
- <textarea name="wplc_ban_users_ip" style="width: 50%; min-height: 200px;" placeholder="<?php _e('Enter each IP Address you would like to block on a new line', 'wplivechat'); ?>" autocomplete="false" disabled readonly></textarea>
 
 
 
 
 
 
467
  <p class="description"><?php _e('Blocking a user\'s IP Address here will hide the chat window from them, preventing them from chatting with you. Each IP Address must be on a new line', 'wplivechat'); ?></p>
468
  </div>
469
  </div>
1
  <div class="wrap">
2
+ <style>
3
+ .wplc_light_grey{
4
+ color: #666;
5
+ }
6
+ </style>
7
  <div id="icon-edit" class="icon32 icon32-posts-post">
8
  <br>
9
  </div>
10
+ <!--<i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title=""></i>-->
11
  <h2><?php _e("WP Live Chat Support Settings","wplivechat")?></h2>
12
  <?php
13
  $wplc_settings = get_option("WPLC_SETTINGS");
27
  <li><a href="#tabs-3"><?php _e("Offline Messages","wplivechat")?></a></li>
28
  <li><a href="#tabs-4"><?php _e("Styling","wplivechat")?></a></li>
29
  <li><a href="#tabs-5"><?php _e("Agents", "wplivechat") ?></a></li>
 
30
  <li><a href="#tabs-7"><?php _e("Blocked Visitors", "wplivechat") ?></a></li>
31
  </ul>
32
  <div id="tabs-1">
33
  <h3><?php _e("Main Settings",'wplivechat')?></h3>
34
  <table class='form-table' width='700'>
35
  <tr>
36
+ <td width='400' valign='top'><?php _e("Chat enabled","wplivechat")?>: </td>
37
  <td>
38
  <select id='wplc_settings_enabled' name='wplc_settings_enabled'>
39
  <option value="1" <?php if (isset($wplc_settings_enabled[1])) { echo $wplc_settings_enabled[1]; } ?>><?php _e("Yes","wplivechat"); ?></option>
42
  </td>
43
  </tr>
44
  <tr>
45
+ <td width='200' valign='top'><?php _e("Choose when I want to be online","wplivechat")?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('Checking this will allow you to change your status to Online or Offline on the Live Chat page.', 'wplivechat'); ?>"></i>
 
46
  </td>
47
  <td>
48
  <input type="checkbox" name="wplc_auto_online" disabled readonly="readonly"/>
57
  </tr>
58
  <tr>
59
  <td width='200' valign='top'>
60
+ <?php _e("Hide Chat","wplivechat")?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Hides chat for 24hrs when user clicks X", "wplivechat") ?>"></i>
 
61
  </td>
62
  <td valign='top'>
63
  <input type="checkbox" value="true" readonly disabled/>
73
  </tr>
74
  <tr>
75
  <td width='200' valign='top'>
76
+ <?php _e("Require Name And Email","wplivechat")?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Users will have to enter their Name and Email Address when starting a chat", "wplivechat") ?>"></i>
 
77
  </td>
78
  <td valign='top'>
79
  <input type="checkbox" value="1" name="wplc_require_user_info" <?php if(isset($wplc_settings['wplc_require_user_info']) && $wplc_settings['wplc_require_user_info'] == 1 ) { echo "checked"; } ?> />
81
  </tr>
82
  <tr>
83
  <td width='200' valign='top'>
84
+ <?php _e("Input Field Replacement Text","wplivechat")?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("This is the text that will show in place of the Name And Email fields", "wplivechat") ?>"></i>
 
85
  </td>
86
  <td valign='top'>
87
  <textarea cols="45" rows="5" name="wplc_user_alternative_text" ><?php if(isset($wplc_settings['wplc_user_alternative_text'])) { echo stripslashes($wplc_settings['wplc_user_alternative_text']); } ?></textarea>
89
  </tr>
90
  <tr>
91
  <td width='200' valign='top'>
92
+ <?php _e("Use Logged In User Details","wplivechat")?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("A user's Name and Email Address will be used by default if they are logged in.", "wplivechat") ?>"></i>
 
93
  </td>
94
  <td valign='top'>
95
  <input type="checkbox" value="1" name="wplc_loggedin_user_info" <?php if(isset($wplc_settings['wplc_loggedin_user_info']) && $wplc_settings['wplc_loggedin_user_info'] == 1 ) { echo "checked"; } ?> />
97
  </tr>
98
  <tr>
99
  <td width='200' valign='top'>
100
+ <?php _e("Enable On Mobile Devices","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Disabling this will mean that the Chat Box will not be displayed on mobile devices. (Smartphones and Tablets)", "wplivechat") ?>"></i>
 
101
  </td>
102
  <td valign='top'>
103
  <input type="checkbox" value="1" name="wplc_enabled_on_mobile" <?php if(isset($wplc_settings['wplc_enabled_on_mobile']) && $wplc_settings['wplc_enabled_on_mobile'] == 1 ) { echo "checked"; } ?> />
105
  </tr>
106
  <tr>
107
  <td width='200' valign='top'>
108
+ <?php _e("Record a visitor's IP Address","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Disable this to enable anonymity for your visitors", "wplivechat") ?>"></i>
 
109
  </td>
110
  <td valign='top'>
111
  <input type="checkbox" value="1" name="wplc_record_ip_address" <?php if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1 ) { echo "checked"; } ?> />
113
  </tr>
114
  <tr>
115
  <td width='200' valign='top'>
116
+ <?php _e("Include chat window on the following pages","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Show the chat window on the following pages. Leave blank to show on all. (Use comma-separated Page ID's)", "wplivechat") ?>"></i>
 
117
  </td>
118
  <td valign='top'>
119
  <input type="text" readonly="readonly" />
128
  </tr>
129
  <tr>
130
  <td width='200' valign='top'>
131
+ <?php _e("Exclude chat window on the following pages","wplivechat"); ?>: <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Do not show the chat window on the following pages. Leave blank to show on all. (Use comma-separated Page ID's)", "wplivechat") ?>"></i>
 
132
  </td>
133
  <td valign='top'>
134
  <input type="text" readonly="readonly"/>
141
  </small>
142
  </td>
143
  </tr>
 
144
  </table>
 
145
  </div>
146
  <div id="tabs-2">
147
  <h3><?php _e("Chat Window Settings",'wplivechat')?></h3>
159
  </tr>
160
  <tr>
161
  <td>
162
+ <?php _e("Auto Pop-up","wplivechat") ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Expand the chat box automatically (prompts the user to enter their name and email address).","wplivechat") ?>"></i>
163
  </td>
164
  <td>
165
  <input type="checkbox" name="wplc_auto_pop_up" value="1" <?php if(isset($wplc_settings['wplc_auto_pop_up']) && $wplc_settings['wplc_auto_pop_up'] == 1 ) { echo "checked"; } ?>/>
 
166
  </td>
167
  </tr>
168
  <tr>
248
  </tr>
249
  <tr>
250
  <td>
251
+ <?php _e("Display name and avatar in chat", "wplivechat") ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("Display the agent and user name above each message in the chat window.", "wplivechat") ?>"></i>
252
  </td>
253
  <td>
254
  <input type="checkbox" name="wplc_display_name" value="1" <?php if (isset($wplc_settings['wplc_display_name']) && $wplc_settings['wplc_display_name'] == 1) {
255
  echo "checked";
256
  } ?>/>
 
257
  </td>
258
  </tr>
259
  <tr>
260
  <td>
261
+ <?php _e("Only show the chat window to users that are logged in", "wplivechat") ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("By checking this, only users that are logged in will be able to chat with you.", "wplivechat") ?>"></i>
262
  </td>
263
  <td>
264
  <input type="checkbox" name="wplc_display_to_loggedin_only" value="1" <?php
266
  echo "checked";
267
  }
268
  ?>/>
 
269
  </td>
270
  </tr>
271
  </table>
276
  <table class='form-table' width='700'>
277
  <tr>
278
  <td>
279
+ <?php _e("Do not allow users to send offline messages", "wplivechat") ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e("The chat window will be hidden when it is offline. Users will not be able to send offline messages to you", "wplivechat") ?>"></i>
280
  </td>
281
  <td>
282
+ <input type="checkbox" name="wplc_hide_when_offline" value="1" readonly="readonly" disabled/>
 
283
  </td>
284
  </tr>
285
  <tr>
389
 
390
  </td>
391
  </tr>
 
 
 
 
 
 
 
392
  <style>
393
  .wplc_animation_block div{
394
  display: inline-block;
412
  .wplc_animation_active{
413
  box-shadow: 2px 2px 2px #CCC;
414
  }
415
+ </style>
416
+ <tr>
417
+ <td>
418
+ <label for=""><?php _e('Choose an animation. Only available in the', 'sola_t'); ?></label>
419
+ <a href="http://wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=animations" target="_BLANK"><?php _e("Pro", "wplivechat") ?></a>
420
+ </td>
421
+
422
+ <td>
423
+ <div class='wplc_animation_block'>
424
+ <div class='wplc_animation_image'>
425
+ <i class="fa fa-arrow-circle-up wplc_orange"></i>
426
+ <p><?php _e('Slide Up', 'wplivechat'); ?></p>
427
+ </div>
428
+ <div class='wplc_animation_image'>
429
+ <i class="fa fa-arrows-h wplc_red"></i>
430
+ <p><?php _e('Slide From The Side', 'wplivechat'); ?></p>
431
+ </div>
432
+ <div class='wplc_animation_image'>
433
+ <i class="fa fa-arrows-alt wplc_orange"></i>
434
+ <p><?php _e('Fade In', 'wplivechat'); ?></p>
435
+ </div>
436
+ <div class='wplc_animation_image'>
437
+ <i class="fa fa-thumb-tack wplc_red"></i>
438
+ <p><?php _e('No Animation', 'wplivechat'); ?></p>
439
+ </div>
440
+ </div>
441
+ </td>
442
+ </tr>
443
+ </table>
444
+ </div>
445
+ <div id="tabs-5">
446
+ <h3><?php _e("Multiple Agents", "wplivechat") ?></h3>
447
+ <p><?php _e("Get","wplivechat") ?> <a href="http://wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=multipleAgents" target="_BLANK"><?php _e("Multiple agent support", "wplivechat") ?></a></p>
448
  </div>
449
  <div id="tabs-7">
450
  <h3><?php _e("Blocked Visitors - Based on IP Address", "wplivechat") ?></h3>
451
+ <textarea name="wplc_ban_users_ip" style="width: 50%; min-height: 200px;" placeholder="<?php _e('Enter each IP Address you would like to block on a new line', 'wplivechat'); ?>" autocomplete="false"><?php
452
+ $ip_addresses = get_option('WPLC_BANNED_IP_ADDRESSES');
453
+ if($ip_addresses){
454
+ $ip_addresses = maybe_unserialize($ip_addresses);
455
+ foreach($ip_addresses as $ip){
456
+ echo $ip."\n";
457
+ }
458
+ }
459
+ ?></textarea>
460
  <p class="description"><?php _e('Blocking a user\'s IP Address here will hide the chat window from them, preventing them from chatting with you. Each IP Address must be on a new line', 'wplivechat'); ?></p>
461
  </div>
462
  </div>
js/wplc_tabs.js CHANGED
@@ -1,3 +1,11 @@
1
  jQuery("document").ready(function() {
2
  jQuery("#wplc_tabs").tabs();
 
 
 
 
 
 
 
 
3
  });
1
  jQuery("document").ready(function() {
2
  jQuery("#wplc_tabs").tabs();
3
+
4
+
5
+
6
+ jQuery(function () {
7
+ jQuery(".wplc_settings_tooltip").tooltip({
8
+ position: {my: "left+15 center", at: "right center"}
9
+ });
10
+ });
11
  });
readme.txt CHANGED
@@ -26,6 +26,7 @@ The most cost effective Live Chat plugin. Chat with your visitors for free! WP L
26
  * Desktop Notifications when receiving new Live Chats
27
  * View any live chats you may have missed
28
  * A comprehensive list of live chat options
 
29
 
30
 
31
  = Pro Version Features =
@@ -47,7 +48,6 @@ The most cost effective Live Chat plugin. Chat with your visitors for free! WP L
47
  * Apply animations to the chat window
48
  * Anonymity for your visitors
49
  * Choose when to accept chats
50
- * Ban visitors from chatting to you based on IP Address
51
 
52
  Get the [WP Live Chat Support Pro Add-on](http://wp-livechat.com/purchase-pro/?utm_source=readme&utm_medium=wordpress&utm_campaign=buy) for only $29.95 once off!
53
 
@@ -172,6 +172,12 @@ It is highly recommended that you upgrade to WP Live Chat Support version 4.1.4
172
 
173
  == Changelog ==
174
 
 
 
 
 
 
 
175
  = 4.2.12 2015-03-24 - Low Priority =
176
  * Bug Fix: Warning to update showing erroneously
177
 
26
  * Desktop Notifications when receiving new Live Chats
27
  * View any live chats you may have missed
28
  * A comprehensive list of live chat options
29
+ * Ban visitors from chatting to you based on IP Address
30
 
31
 
32
  = Pro Version Features =
48
  * Apply animations to the chat window
49
  * Anonymity for your visitors
50
  * Choose when to accept chats
 
51
 
52
  Get the [WP Live Chat Support Pro Add-on](http://wp-livechat.com/purchase-pro/?utm_source=readme&utm_medium=wordpress&utm_campaign=buy) for only $29.95 once off!
53
 
172
 
173
  == Changelog ==
174
 
175
+ = 4.3.0 2015-04-13 - Low Priority =
176
+ * Enhancement: Animations settings have been moved to the 'Styling' tab.
177
+ * New Feature: Blocked User functionality has been moved to the Free version
178
+ * Enhancement: All descriptions have been put into tooltips for a cleaner page
179
+ * New Feature: Functionality added in to handle Chat Experience Ratings (Premium Add-on)
180
+
181
  = 4.2.12 2015-03-24 - Low Priority =
182
  * Bug Fix: Warning to update showing erroneously
183
 
wp-live-chat-support.php CHANGED
@@ -3,13 +3,19 @@
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: 4.2.12
7
  Author: WP-LiveChat
8
  Author URI: http://www.wp-livechat.com
9
  */
10
 
11
 
12
- /* 4.2.12 2015-03-24 - Low Priority
 
 
 
 
 
 
13
  * Bug Fix: Warning to update showing erroneously
14
  *
15
  * 4.2.11 2015-03-23 - Low Priority
@@ -174,7 +180,7 @@ global $wplc_tblname_chats;
174
  global $wplc_tblname_msgs;
175
  $wplc_tblname_chats = $wpdb->prefix . "wplc_chat_sessions";
176
  $wplc_tblname_msgs = $wpdb->prefix . "wplc_chat_msgs";
177
- $wplc_version = "4.2.12";
178
 
179
  define('WPLC_BASIC_PLUGIN_DIR', dirname(__FILE__));
180
  define('WPLC_BASIC_PLUGIN_URL', plugins_url() . "/wp-live-chat-support/");
@@ -437,99 +443,99 @@ function wplc_output_box() {
437
  ?>
438
  <div id="wp-live-chat" wplc_animation='<?php echo $wplc_animation; ?>' style="<?php echo $wplc_starting_point." ".$wplc_box_align; ?>; " class="<?php echo $wplc_class; ?> wplc_close" original_pos="<?php echo $original_pos; ?>" wplc-auto-pop-up="<?php if (isset($wplc_settings['wplc_auto_pop_up'])) { echo $wplc_settings['wplc_auto_pop_up']; } ?>" >
439
  <?php
440
- if (function_exists("wplc_register_pro_version")) {
441
- wplc_pro_output_box();
442
- } else {
443
- ?>
444
- <div class="wp-live-chat-wraper">
445
- <div id="wp-live-chat-header" style="background-color: <?php echo $wplc_settings_fill; ?> !important; color: <?php echo $wplc_settings_font; ?> !important; ">
446
- <i id="wp-live-chat-minimize" class="fa fa-minus" style="display:none;" ></i>
447
- <i id="wp-live-chat-close" class="fa fa-times" style="display:none;" ></i>
448
-
449
- <div id="wp-live-chat-1" >
450
- <div style="display:block; ">
451
- <strong><?php _e("Questions?", "wplivechat") ?></strong> <?php _e("Chat with us", "wplivechat") ?>
 
452
  </div>
453
  </div>
454
- </div>
455
 
456
- <div id="wp-live-chat-2" style="display:none;">
457
- <div id="wp-live-chat-2-info">
458
- <strong><?php _e('Start Live Chat', 'wplivechat'); ?></strong>
459
- </div>
460
- <?php
461
- $wplc_settings = get_option("WPLC_SETTINGS");
462
 
463
- if (isset($wplc_settings['wplc_loggedin_user_info']) && $wplc_settings['wplc_loggedin_user_info'] == 1) {
464
- $wplc_use_loggedin_user_details = 1;
465
- } else {
466
- $wplc_use_loggedin_user_details = 0;
467
- }
468
 
469
- $wplc_loggedin_user_name = "";
470
- $wplc_loggedin_user_email = "";
471
 
472
- if ($wplc_use_loggedin_user_details == 1) {
473
- global $current_user;
474
 
475
- if ($current_user->data != null) {
476
- //Logged in. Get name and email
477
- $wplc_loggedin_user_name = $current_user->user_nicename;
478
- $wplc_loggedin_user_email = $current_user->user_email;
 
 
 
 
479
  }
480
- } else {
481
- $wplc_loggedin_user_name = '';
482
- $wplc_loggedin_user_email = '';
483
- }
484
 
485
- if (isset($wplc_settings['wplc_require_user_info']) && $wplc_settings['wplc_require_user_info'] == 1) {
486
- $wplc_ask_user_details = 1;
487
- } else {
488
- $wplc_ask_user_details = 0;
489
- }
490
-
491
- if ($wplc_ask_user_details == 1) {
492
- //Ask the user to enter name and email
493
- ?>
494
- <input type="text" name="wplc_name" id="wplc_name" value="<?php echo $wplc_loggedin_user_name; ?>" placeholder="<?php _e("Name", "wplivechat"); ?>" />
495
- <input type="text" name="wplc_email" id="wplc_email" wplc_hide="0" value="<?php echo $wplc_loggedin_user_email; ?>" placeholder="<?php _e("Email", "wplivechat"); ?>" />
496
- <?php
497
- } else {
498
- //Dont ask the user
499
- echo '<div style="padding: 7px; text-align: center;">';
500
- if (isset($wplc_settings['wplc_user_alternative_text'])) {
501
- echo stripslashes($wplc_settings['wplc_user_alternative_text']);
502
  }
503
- echo '</div>';
504
 
505
- $wplc_random_user_number = rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9);
506
- //$wplc_loggedin_user_email = $wplc_random_user_number."@".$wplc_random_user_number.".com";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
507
  ?>
508
- <input type="hidden" name="wplc_name" id="wplc_name" value="<?php if ($wplc_loggedin_user_name != '') { echo $wplc_loggedin_user_name; } else { echo 'user' . $wplc_random_user_number; } ?>" />
509
- <input type="hidden" name="wplc_email" id="wplc_email" wplc_hide="1" value="<?php if ($wplc_loggedin_user_email != '' && $wplc_loggedin_user_email != null) { echo $wplc_loggedin_user_email; } else { echo $wplc_random_user_number . '@' . $wplc_random_user_number . '.com'; } ?>" />
510
- <?php
511
- }
512
- ?>
513
- <input id="wplc_start_chat_btn" type="button" value="<?php _e("Start Chat", "wplivechat"); ?>" style="background-color: <?php echo $wplc_settings_fill; ?> !important; color: <?php echo $wplc_settings_font; ?> !important;"/>
514
- </div>
515
- <div id="wp-live-chat-3" style="display:none;">
516
- <p><?php _e("Connecting you to a sales person. Please be patient.", "wplivechat") ?></p>
517
- </div>
518
- <div id="wp-live-chat-react" style="display:none;">
519
- <p><?php _e("Reactivating your previous chat...", "wplivechat") ?></p>
520
- </div>
521
- <div id="wp-live-chat-4" style="display:none;">
522
- <div id="wplc_sound_update" style='height:0; width:0; display:none; border:0;'></div>
523
- <div id="wplc_chatbox"></div>
524
- <p style="text-align:center; font-size:11px;"><?php _e("Press ENTER to send your message", "wplivechat") ?></p>
525
- <p>
526
- <input type="text" name="wplc_chatmsg" id="wplc_chatmsg" value="" />
527
- <input type="hidden" name="wplc_cid" id="wplc_cid" value="" />
528
- <input id="wplc_send_msg" type="button" value="<?php _e("Send", "wplivechat"); ?>" style="display:none;" />
529
- </p>
530
- </div>
531
- </div>
532
- <?php } ?>
533
  </div>
534
  <?php
535
 
@@ -544,6 +550,8 @@ function wplc_display_box() {
544
 
545
  if(function_exists('wplc_is_user_banned')){
546
  $user_banned = wplc_is_user_banned();
 
 
547
  } else {
548
  $user_banned = 0;
549
  }
@@ -572,14 +580,14 @@ function wplc_display_box() {
572
  if ($wplc_is_mobile && !isset($wplc_settings['wplc_enabled_on_mobile']) && $wplc_settings['wplc_enabled_on_mobile'] != 1) {
573
  return;
574
  }
575
- if(function_exists('wplc_hide_chat_when_offline')){
576
  $wplc_hide_chat = wplc_hide_chat_when_offline();
577
- if(!$wplc_hide_chat){
578
  wplc_pro_draw_user_box();
579
  }
580
  } else {
581
  wplc_pro_draw_user_box();
582
- }
583
  } else {
584
  wplc_draw_user_box();
585
  }
@@ -607,6 +615,7 @@ function wplc_admin_display_chat($cid) {
607
  }
608
 
609
  function wplc_admin_accept_chat($cid) {
 
610
  wplc_change_chat_status($cid, 3);
611
  return true;
612
  }
@@ -1354,6 +1363,11 @@ function wplc_add_user_stylesheet() {
1354
  wp_register_style('wplc-style', plugins_url('/css/wplcstyle.css', __FILE__));
1355
  wp_enqueue_style('wplc-style');
1356
  }
 
 
 
 
 
1357
  }
1358
 
1359
  function wplc_add_admin_stylesheet() {
@@ -1382,7 +1396,7 @@ function wplc_admin_scripts_basic() {
1382
  if (isset($_GET['page']) && $_GET['page'] == "wplivechat-menu-settings") {
1383
  wp_enqueue_script('jquery');
1384
  wp_enqueue_script('jquery-ui-core');
1385
-
1386
  wp_register_script('my-wplc-color', plugins_url('js/jscolor.js', __FILE__), false, '1.4.1', false);
1387
  wp_enqueue_script('my-wplc-color');
1388
  wp_enqueue_script('jquery-ui-tabs');
@@ -1397,7 +1411,10 @@ function wplc_admin_settings_layout() {
1397
 
1398
  function wplc_admin_history_layout() {
1399
  echo"<div class=\"wrap\"><div id=\"icon-edit\" class=\"icon32 icon32-posts-post\"><br></div><h2>" . __("WP Live Chat History", "wplivechat") . "</h2>";
1400
- if (function_exists("wplc_register_pro_version")) {
 
 
 
1401
  wplc_pro_admin_display_history();
1402
  } else {
1403
  echo "<br /><br >" . __('This option is only available in the ', 'wplivechat') . "<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', 'wplivechat') . "</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 $19.95 once off!', 'wplivechat') . "</a>";
@@ -1476,6 +1493,16 @@ function wplc_head_basic() {
1476
  if(isset($_POST['wplc_record_ip_address'])){
1477
  $wplc_data['wplc_record_ip_address'] = esc_attr($_POST['wplc_record_ip_address']);
1478
  }
 
 
 
 
 
 
 
 
 
 
1479
 
1480
  update_option('WPLC_SETTINGS', $wplc_data);
1481
  if (isset($_POST['wplc_hide_chat'])) {
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: 4.3.0
7
  Author: WP-LiveChat
8
  Author URI: http://www.wp-livechat.com
9
  */
10
 
11
 
12
+ /* 4.3.0 2015-04-13 - Low Priority
13
+ * Enhancement: Animations settings have been moved to the 'Styling' tab.
14
+ * New Feature: Blocked User functionality has been moved to the Free version
15
+ * Enhancement: All descriptions have been put into tooltips for a cleaner page
16
+ * New Feature: Functionality added in to handle Chat Experience Ratings (Premium Add-on)
17
+ *
18
+ * 4.2.12 2015-03-24 - Low Priority
19
  * Bug Fix: Warning to update showing erroneously
20
  *
21
  * 4.2.11 2015-03-23 - Low Priority
180
  global $wplc_tblname_msgs;
181
  $wplc_tblname_chats = $wpdb->prefix . "wplc_chat_sessions";
182
  $wplc_tblname_msgs = $wpdb->prefix . "wplc_chat_msgs";
183
+ $wplc_version = "4.3.00";
184
 
185
  define('WPLC_BASIC_PLUGIN_DIR', dirname(__FILE__));
186
  define('WPLC_BASIC_PLUGIN_URL', plugins_url() . "/wp-live-chat-support/");
443
  ?>
444
  <div id="wp-live-chat" wplc_animation='<?php echo $wplc_animation; ?>' style="<?php echo $wplc_starting_point." ".$wplc_box_align; ?>; " class="<?php echo $wplc_class; ?> wplc_close" original_pos="<?php echo $original_pos; ?>" wplc-auto-pop-up="<?php if (isset($wplc_settings['wplc_auto_pop_up'])) { echo $wplc_settings['wplc_auto_pop_up']; } ?>" >
445
  <?php
446
+ if (function_exists("wplc_register_pro_version")) {
447
+ wplc_pro_output_box();
448
+ } else {
449
+ ?>
450
+ <div class="wp-live-chat-wraper">
451
+ <div id="wp-live-chat-header" style="background-color: <?php echo $wplc_settings_fill; ?> !important; color: <?php echo $wplc_settings_font; ?> !important; ">
452
+ <i id="wp-live-chat-minimize" class="fa fa-minus" style="display:none;" ></i>
453
+ <i id="wp-live-chat-close" class="fa fa-times" style="display:none;" ></i>
454
+
455
+ <div id="wp-live-chat-1" >
456
+ <div style="display:block; ">
457
+ <strong><?php _e("Questions?", "wplivechat") ?></strong> <?php _e("Chat with us", "wplivechat") ?>
458
+ </div>
459
  </div>
460
  </div>
 
461
 
462
+ <div id="wp-live-chat-2" style="display:none;">
463
+ <div id="wp-live-chat-2-info">
464
+ <strong><?php _e('Start Live Chat', 'wplivechat'); ?></strong>
465
+ </div>
466
+ <?php
467
+ $wplc_settings = get_option("WPLC_SETTINGS");
468
 
469
+ if (isset($wplc_settings['wplc_loggedin_user_info']) && $wplc_settings['wplc_loggedin_user_info'] == 1) {
470
+ $wplc_use_loggedin_user_details = 1;
471
+ } else {
472
+ $wplc_use_loggedin_user_details = 0;
473
+ }
474
 
475
+ $wplc_loggedin_user_name = "";
476
+ $wplc_loggedin_user_email = "";
477
 
478
+ if ($wplc_use_loggedin_user_details == 1) {
479
+ global $current_user;
480
 
481
+ if ($current_user->data != null) {
482
+ //Logged in. Get name and email
483
+ $wplc_loggedin_user_name = $current_user->user_nicename;
484
+ $wplc_loggedin_user_email = $current_user->user_email;
485
+ }
486
+ } else {
487
+ $wplc_loggedin_user_name = '';
488
+ $wplc_loggedin_user_email = '';
489
  }
 
 
 
 
490
 
491
+ if (isset($wplc_settings['wplc_require_user_info']) && $wplc_settings['wplc_require_user_info'] == 1) {
492
+ $wplc_ask_user_details = 1;
493
+ } else {
494
+ $wplc_ask_user_details = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
495
  }
 
496
 
497
+ if ($wplc_ask_user_details == 1) {
498
+ //Ask the user to enter name and email
499
+ ?>
500
+ <input type="text" name="wplc_name" id="wplc_name" value="<?php echo $wplc_loggedin_user_name; ?>" placeholder="<?php _e("Name", "wplivechat"); ?>" />
501
+ <input type="text" name="wplc_email" id="wplc_email" wplc_hide="0" value="<?php echo $wplc_loggedin_user_email; ?>" placeholder="<?php _e("Email", "wplivechat"); ?>" />
502
+ <?php
503
+ } else {
504
+ //Dont ask the user
505
+ echo '<div style="padding: 7px; text-align: center;">';
506
+ if (isset($wplc_settings['wplc_user_alternative_text'])) {
507
+ echo stripslashes($wplc_settings['wplc_user_alternative_text']);
508
+ }
509
+ echo '</div>';
510
+
511
+ $wplc_random_user_number = rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9);
512
+ //$wplc_loggedin_user_email = $wplc_random_user_number."@".$wplc_random_user_number.".com";
513
+ ?>
514
+ <input type="hidden" name="wplc_name" id="wplc_name" value="<?php if ($wplc_loggedin_user_name != '') { echo $wplc_loggedin_user_name; } else { echo 'user' . $wplc_random_user_number; } ?>" />
515
+ <input type="hidden" name="wplc_email" id="wplc_email" wplc_hide="1" value="<?php if ($wplc_loggedin_user_email != '' && $wplc_loggedin_user_email != null) { echo $wplc_loggedin_user_email; } else { echo $wplc_random_user_number . '@' . $wplc_random_user_number . '.com'; } ?>" />
516
+ <?php
517
+ }
518
  ?>
519
+ <input id="wplc_start_chat_btn" type="button" value="<?php _e("Start Chat", "wplivechat"); ?>" style="background-color: <?php echo $wplc_settings_fill; ?> !important; color: <?php echo $wplc_settings_font; ?> !important;"/>
520
+ </div>
521
+ <div id="wp-live-chat-3" style="display:none;">
522
+ <p><?php _e("Connecting you to a sales person. Please be patient.", "wplivechat") ?></p>
523
+ </div>
524
+ <div id="wp-live-chat-react" style="display:none;">
525
+ <p><?php _e("Reactivating your previous chat...", "wplivechat") ?></p>
526
+ </div>
527
+ <div id="wp-live-chat-4" style="display:none;">
528
+ <div id="wplc_sound_update" style='height:0; width:0; display:none; border:0;'></div>
529
+ <div id="wplc_chatbox"></div>
530
+ <p style="text-align:center; font-size:11px;"><?php _e("Press ENTER to send your message", "wplivechat") ?></p>
531
+ <p>
532
+ <input type="text" name="wplc_chatmsg" id="wplc_chatmsg" value="" />
533
+ <input type="hidden" name="wplc_cid" id="wplc_cid" value="" />
534
+ <input id="wplc_send_msg" type="button" value="<?php _e("Send", "wplivechat"); ?>" style="display:none;" />
535
+ </p>
536
+ </div>
537
+ </div>
538
+ <?php } ?>
 
 
 
 
 
539
  </div>
540
  <?php
541
 
550
 
551
  if(function_exists('wplc_is_user_banned')){
552
  $user_banned = wplc_is_user_banned();
553
+ } else if (function_exists('wplc_is_user_banned')){
554
+ $user_banned = wplc_is_user_banned_basic();
555
  } else {
556
  $user_banned = 0;
557
  }
580
  if ($wplc_is_mobile && !isset($wplc_settings['wplc_enabled_on_mobile']) && $wplc_settings['wplc_enabled_on_mobile'] != 1) {
581
  return;
582
  }
583
+ if (function_exists('wplc_hide_chat_when_offline')) {
584
  $wplc_hide_chat = wplc_hide_chat_when_offline();
585
+ if (!$wplc_hide_chat) {
586
  wplc_pro_draw_user_box();
587
  }
588
  } else {
589
  wplc_pro_draw_user_box();
590
+ }
591
  } else {
592
  wplc_draw_user_box();
593
  }
615
  }
616
 
617
  function wplc_admin_accept_chat($cid) {
618
+
619
  wplc_change_chat_status($cid, 3);
620
  return true;
621
  }
1363
  wp_register_style('wplc-style', plugins_url('/css/wplcstyle.css', __FILE__));
1364
  wp_enqueue_style('wplc-style');
1365
  }
1366
+ if(function_exists('wplc_ce_activate')){
1367
+ if(function_exists('wplc_ce_load_user_styles')){
1368
+ wplc_ce_load_user_styles();
1369
+ }
1370
+ }
1371
  }
1372
 
1373
  function wplc_add_admin_stylesheet() {
1396
  if (isset($_GET['page']) && $_GET['page'] == "wplivechat-menu-settings") {
1397
  wp_enqueue_script('jquery');
1398
  wp_enqueue_script('jquery-ui-core');
1399
+ wp_enqueue_script('jquery-ui-tooltip');
1400
  wp_register_script('my-wplc-color', plugins_url('js/jscolor.js', __FILE__), false, '1.4.1', false);
1401
  wp_enqueue_script('my-wplc-color');
1402
  wp_enqueue_script('jquery-ui-tabs');
1411
 
1412
  function wplc_admin_history_layout() {
1413
  echo"<div class=\"wrap\"><div id=\"icon-edit\" class=\"icon32 icon32-posts-post\"><br></div><h2>" . __("WP Live Chat History", "wplivechat") . "</h2>";
1414
+
1415
+ if(function_exists("wplc_ce_activate")){
1416
+ wplc_ce_admin_display_history();
1417
+ } else if (function_exists("wplc_register_pro_version")) {
1418
  wplc_pro_admin_display_history();
1419
  } else {
1420
  echo "<br /><br >" . __('This option is only available in the ', 'wplivechat') . "<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', 'wplivechat') . "</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 $19.95 once off!', 'wplivechat') . "</a>";
1493
  if(isset($_POST['wplc_record_ip_address'])){
1494
  $wplc_data['wplc_record_ip_address'] = esc_attr($_POST['wplc_record_ip_address']);
1495
  }
1496
+
1497
+ if(isset($_POST['wplc_ban_users_ip'])){
1498
+ $wplc_banned_ip_addresses = explode('<br />', nl2br($_POST['wplc_ban_users_ip']));
1499
+ foreach($wplc_banned_ip_addresses as $key => $value) {
1500
+ $data[$key] = trim($value);
1501
+ }
1502
+ $wplc_banned_ip_addresses = maybe_serialize($data);
1503
+
1504
+ update_option('WPLC_BANNED_IP_ADDRESSES', $wplc_banned_ip_addresses);
1505
+ }
1506
 
1507
  update_option('WPLC_SETTINGS', $wplc_data);
1508
  if (isset($_POST['wplc_hide_chat'])) {