WP Live Chat Support - Version 4.2.9

Version Description

2015-02-18 - Low Priority = * New Feature: You can now choose to record your visitors IP address or not * New Feature: You can now send an offline message to more than one email address (Pro) * New Feature: You can now specify if you want to be online or not (Pro)

Download this release

Release Info

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

Code changes from version 4.2.8 to 4.2.9

Files changed (4) hide show
  1. functions.php +60 -19
  2. includes/settings_page.php +24 -0
  3. readme.txt +7 -0
  4. wp-live-chat-support.php +46 -33
functions.php CHANGED
@@ -4,12 +4,22 @@ $wplc_basic_plugin_url = get_option('siteurl')."/wp-content/plugins/wp-live-chat
4
  function wplc_log_user_on_page($name,$email,$session) {
5
  global $wpdb;
6
  global $wplc_tblname_chats;
7
-
8
 
9
- $user_data = array(
10
- 'ip' => $_SERVER['REMOTE_ADDR'],
11
- 'user_agent' => $_SERVER['HTTP_USER_AGENT']
12
- );
 
 
 
 
 
 
 
 
 
 
 
13
 
14
 
15
  $ins_array = array(
@@ -34,12 +44,19 @@ function wplc_log_user_on_page($name,$email,$session) {
34
  function wplc_update_user_on_page($cid, $status = 5,$session) {
35
  global $wpdb;
36
  global $wplc_tblname_chats;
37
-
38
 
39
- $user_data = array(
40
- 'ip' => $_SERVER['REMOTE_ADDR'],
41
- 'user_agent' => $_SERVER['HTTP_USER_AGENT']
42
- );
 
 
 
 
 
 
 
43
 
44
  $query =
45
  "
@@ -184,6 +201,12 @@ function wplc_list_chats() {
184
  $browser = wplc_return_browser_string($user_data['user_agent']);
185
  $browser_image = wplc_return_browser_image($browser,"16");
186
 
 
 
 
 
 
 
187
  if ($result->status == 2) {
188
  $url = admin_url( 'admin.php?page=wplivechat-menu&action=ac&cid='.$result->id);
189
  $actions = "<a href=\"".$url."\" class=\"wplc_open_chat button button-primary\" window-title=\"WP_Live_Chat_".$result->id."\">".__("Accept Chat","wplivechat")."</a>";
@@ -224,7 +247,7 @@ function wplc_list_chats() {
224
  <strong>" . __("Advanced Info", "wplivechat") . "</strong>
225
  <hr />
226
  <span class='part1'>" . __("Browser:", "wplivechat") . "</span><span class='part2'> $browser <img src='" . $wplc_basic_plugin_url . "/images/$browser_image' alt='$browser' title='$browser' /><br />
227
- <span class='part1'>" . __("IP Address:", "wplivechat") . "</span><span class='part2'> <a href='http://www.ip-adress.com/ip_tracer/" . $user_ip . "' title='Whois for " . $user_ip . "'>" . $user_ip . "</a>
228
  </div>
229
  </div>
230
  <div class='wplc_chat_section'>
@@ -576,10 +599,19 @@ function wplc_user_initiate_chat($name,$email,$cid = null,$session) {
576
 
577
  if ($cid != null) { /* change from a visitor to a chat */
578
 
579
- $user_data = array(
580
- 'ip' => $_SERVER['REMOTE_ADDR'],
581
- 'user_agent' => $_SERVER['HTTP_USER_AGENT']
582
- );
 
 
 
 
 
 
 
 
 
583
 
584
  $query =
585
  "
@@ -602,10 +634,19 @@ function wplc_user_initiate_chat($name,$email,$cid = null,$session) {
602
  }
603
  else { // create new ID for the chat
604
 
605
- $user_data = array(
606
- 'ip' => $_SERVER['REMOTE_ADDR'],
607
- 'user_agent' => $_SERVER['HTTP_USER_AGENT']
608
- );
 
 
 
 
 
 
 
 
 
609
 
610
  $ins_array = array(
611
  'status' => '2',
4
  function wplc_log_user_on_page($name,$email,$session) {
5
  global $wpdb;
6
  global $wplc_tblname_chats;
 
7
 
8
+ $wplc_settings = get_option('WPLC_SETTINGS');
9
+
10
+ if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
11
+ $user_data = array(
12
+ 'ip' => $_SERVER['REMOTE_ADDR'],
13
+ 'user_agent' => $_SERVER['HTTP_USER_AGENT']
14
+ );
15
+ } else {
16
+ $user_data = array(
17
+ 'ip' => "",
18
+ 'user_agent' => $_SERVER['HTTP_USER_AGENT']
19
+ );
20
+ }
21
+
22
+
23
 
24
 
25
  $ins_array = array(
44
  function wplc_update_user_on_page($cid, $status = 5,$session) {
45
  global $wpdb;
46
  global $wplc_tblname_chats;
47
+ $wplc_settings = get_option('WPLC_SETTINGS');
48
 
49
+ if(isset($wplc_settings['wplc_record_ip_address']) && $wplc_settings['wplc_record_ip_address'] == 1){
50
+ $user_data = array(
51
+ 'ip' => $_SERVER['REMOTE_ADDR'],
52
+ 'user_agent' => $_SERVER['HTTP_USER_AGENT']
53
+ );
54
+ } else {
55
+ $user_data = array(
56
+ 'ip' => "",
57
+ 'user_agent' => $_SERVER['HTTP_USER_AGENT']
58
+ );
59
+ }
60
 
61
  $query =
62
  "
201
  $browser = wplc_return_browser_string($user_data['user_agent']);
202
  $browser_image = wplc_return_browser_image($browser,"16");
203
 
204
+ if($user_ip == ""){
205
+ $user_ip = __('IP Address not recorded', 'wplivechat');
206
+ } else {
207
+ $user_ip = "<a href='http://www.ip-adress.com/ip_tracer/" . $user_ip . "' title='".__('Whois for' ,'wplivechat')." ".$user_ip."'>".$user_ip."</a>";
208
+ }
209
+
210
  if ($result->status == 2) {
211
  $url = admin_url( 'admin.php?page=wplivechat-menu&action=ac&cid='.$result->id);
212
  $actions = "<a href=\"".$url."\" class=\"wplc_open_chat button button-primary\" window-title=\"WP_Live_Chat_".$result->id."\">".__("Accept Chat","wplivechat")."</a>";
247
  <strong>" . __("Advanced Info", "wplivechat") . "</strong>
248
  <hr />
249
  <span class='part1'>" . __("Browser:", "wplivechat") . "</span><span class='part2'> $browser <img src='" . $wplc_basic_plugin_url . "/images/$browser_image' alt='$browser' title='$browser' /><br />
250
+ <span class='part1'>" . __("IP Address:", "wplivechat") . "</span><span class='part2'> ".$user_ip."
251
  </div>
252
  </div>
253
  <div class='wplc_chat_section'>
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
  "
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',
includes/settings_page.php CHANGED
@@ -35,6 +35,21 @@
35
  </select>
36
  </td>
37
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  <tr>
39
  <td width='200' valign='top'>
40
  <?php _e("Hide Chat","wplivechat")?>:
@@ -88,6 +103,15 @@
88
  <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"; } ?> />
89
  </td>
90
  </tr>
 
 
 
 
 
 
 
 
 
91
  <tr>
92
  <td width='200' valign='top'>
93
  <?php _e("Include chat window on the following pages:","wplivechat"); ?>
35
  </select>
36
  </td>
37
  </tr>
38
+ <tr>
39
+ <td width='200' valign='top'><?php _e("Choose when I want to be online","wplivechat")?>:
40
+ <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>
41
+ </td>
42
+ <td>
43
+ <input type="checkbox" name="wplc_auto_online" disabled readonly="readonly"/>
44
+ <small>
45
+ <i>
46
+ <?php _e("available in the","wplivechat")?>
47
+ <a href="http://www.wp-livechat.com/purchase-pro/?utm_source=plugin&utm_medium=link&utm_campaign=change_status" title="<?php _e("Pro Add-on","wplivechat")?>" target="_BLANK"><?php _e("Pro Add-on","wplivechat")?></a>
48
+ <?php _e("only","wplivechat")?>
49
+ </i>
50
+ </small>
51
+ </td>
52
+ </tr>
53
  <tr>
54
  <td width='200' valign='top'>
55
  <?php _e("Hide Chat","wplivechat")?>:
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"; } ?> />
104
  </td>
105
  </tr>
106
+ <tr>
107
+ <td width='200' valign='top'>
108
+ <?php _e("Record a visitor's IP Address","wplivechat"); ?>
109
+ <p class="description"><?php _e("Disable this to enable anonymity for your visitors", "wplivechat") ?></p>
110
+ </td>
111
+ <td valign='top'>
112
+ <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
+ </td>
114
+ </tr>
115
  <tr>
116
  <td width='200' valign='top'>
117
  <?php _e("Include chat window on the following pages:","wplivechat"); ?>
readme.txt CHANGED
@@ -45,6 +45,8 @@ The most cost effective Live Chat plugin. Chat with your visitors for free! WP L
45
  * Fully customizable live chat experience
46
  * Offline messages are now stored (When Live Chat is switched off)
47
  * Apply animations to the chat window
 
 
48
 
49
  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!
50
 
@@ -166,6 +168,11 @@ It is highly recommended that you upgrade to WP Live Chat Support version 4.1.4
166
 
167
  == Changelog ==
168
 
 
 
 
 
 
169
  = 4.2.8 2015-02-12 - Low Priority =
170
  * New Feature: You can now apply an animation to the chat window on page load
171
  * New Feature: You can now choose from 5 colour schemes for the chat window
45
  * Fully customizable live chat experience
46
  * Offline messages are now stored (When Live Chat is switched off)
47
  * Apply animations to the chat window
48
+ * Anonymity for your visitors
49
+ * Choose when to accept chats
50
 
51
  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!
52
 
168
 
169
  == Changelog ==
170
 
171
+ = 4.2.9 2015-02-18 - Low Priority =
172
+ * New Feature: You can now choose to record your visitors IP address or not
173
+ * New Feature: You can now send an offline message to more than one email address (Pro)
174
+ * New Feature: You can now specify if you want to be online or not (Pro)
175
+
176
  = 4.2.8 2015-02-12 - Low Priority =
177
  * New Feature: You can now apply an animation to the chat window on page load
178
  * New Feature: You can now choose from 5 colour schemes for the chat window
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.8
7
  Author: WP-LiveChat
8
  Author URI: http://www.wp-livechat.com
9
  */
10
 
11
 
12
- /* 4.2.8 2015-02-12 - Low Priority
 
 
 
 
 
 
13
  * New Feature: You can now apply an animation to the chat window on page load
14
  * New Feature: You can now choose from 5 colour schemes for the chat window
15
  * Enhancement: Aesthetic Improvement to list of agents (Pro)
@@ -143,7 +149,7 @@ global $wplc_tblname_chats;
143
  global $wplc_tblname_msgs;
144
  $wplc_tblname_chats = $wpdb->prefix . "wplc_chat_sessions";
145
  $wplc_tblname_msgs = $wpdb->prefix . "wplc_chat_msgs";
146
- $wplc_version = "4.2.8";
147
 
148
  define('WPLC_BASIC_PLUGIN_DIR', dirname(__FILE__));
149
  define('WPLC_BASIC_PLUGIN_URL', plugins_url() . "/wp-live-chat-support/");
@@ -214,6 +220,9 @@ function wplc_version_control() {
214
  if (!isset($wplc_settings['wplc_enabled_on_mobile'])) {
215
  $wplc_settings['wplc_enabled_on_mobile'] = "1";
216
  }
 
 
 
217
  update_option("WPLC_SETTINGS", $wplc_settings);
218
  }
219
  }
@@ -927,6 +936,12 @@ function wplc_draw_chat_area($cid) {
927
  $status = __("Active", "wplivechat");
928
  }
929
 
 
 
 
 
 
 
930
  echo "<h2>$status " . __('Chat with', 'wplivechat') . " " . $result->name . "</h2>";
931
  echo "<style>#adminmenuwrap { display:none; } #adminmenuback { display:none; } #wpadminbar { display:none; } #wpfooter { display:none; } .update-nag { display:none; }</style>";
932
 
@@ -955,7 +970,7 @@ function wplc_draw_chat_area($cid) {
955
  echo " <strong>" . __("Advanced Info", "wplivechat") . "</strong>";
956
  echo " <hr />";
957
  echo " <span class='part1'>" . __("Browser:", "wplivechat") . "</span><span class='part2'> $browser <img src='" . $wplc_basic_plugin_url . "/images/$browser_image' alt='$browser' title='$browser' /><br />";
958
- echo " <span class='part1'>" . __("IP Address:", "wplivechat") . "</span><span class='part2'> <a href='http://www.ip-adress.com/ip_tracer/" . $user_ip . "' title='" . __('Whois for', 'wplivechat') . " " . $user_ip . "'>" . $user_ip . "</a>";
959
  echo "</div>";
960
 
961
  echo " <div id=\"wplc_sound_update\"></div>";
@@ -1245,7 +1260,8 @@ function wplc_activate() {
1245
  "wplc_loggedin_user_info" => '1',
1246
  "wplc_user_alternative_text" => $wplc_alt_text,
1247
  "wplc_enabled_on_mobile" => '1',
1248
- "wplc_display_name" => '1'
 
1249
  ));
1250
  }
1251
  add_option("WPLC_HIDE_CHAT", "true");
@@ -1413,6 +1429,10 @@ function wplc_head_basic() {
1413
  if (isset($_POST['wplc_display_to_loggedin_only'])) {
1414
  $wplc_data['wplc_display_to_loggedin_only'] = esc_attr($_POST['wplc_display_to_loggedin_only']);
1415
  }
 
 
 
 
1416
 
1417
  update_option('WPLC_SETTINGS', $wplc_data);
1418
  if (isset($_POST['wplc_hide_chat'])) {
@@ -1485,31 +1505,24 @@ function wplc_get_home_path() {
1485
  }
1486
 
1487
  /* Error Checks */
1488
- //if(!function_exists('set_time_limit')){
1489
- // if(is_admin()){
1490
- // echo "
1491
- // <div class='error'>
1492
- // <p>".__("WPLC: set_time_limit() is not enabled on this server. You may experience issues while using WP Live Chat Support as a result of this. Please get in contact your host to get this function enabled.", "wplivechat")."</p>
1493
- // </div>";
1494
- // }
1495
- //}
1496
- //if(defined('WP_MEMORY_LIMIT')){
1497
- // $wplc_memory_limit = strtr(WP_MEMORY_LIMIT, array('M' => ""));
1498
- // $wplc_memory_limit = intval($wplc_memory_limit);
1499
- // if($wplc_memory_limit < 40){
1500
- // if(is_admin()){
1501
- // echo "
1502
- // <div class='error'>
1503
- // <p>".__("WPLC: Your WordPress install currently only has ".WP_MEMORY_LIMIT. " available to it. You may experience issues while using WP Live Chat Support as a result of this. For assistance in increasing your memory limit, please contact support.", "wplivechat")."</p>
1504
- // </div>";
1505
- // }
1506
- // }
1507
- //}
1508
- //if(ini_get('safe_mode')){
1509
- // if(is_admin()){
1510
- // echo "
1511
- // <div class='error'>
1512
- // <p>".__("WPLC: Safe mode is enabled on this server. You may experience issues while using WP Live Chat Support as a result of this. Please contact your host to get safe mode disabled.", "wplivechat")."</p>
1513
- // </div>";
1514
- // }
1515
- //}
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.9
7
  Author: WP-LiveChat
8
  Author URI: http://www.wp-livechat.com
9
  */
10
 
11
 
12
+ /* 4.2.9 2015-02-18 - Low Priority
13
+ * New Feature: You can now choose to record your visitors IP address or not
14
+ * New Feature: You can now send an offline message to more than one email address (Pro)
15
+ * New Feature: You can now specify if you want to be online or not (Pro)
16
+ *
17
+ *
18
+ * 4.2.8 2015-02-12 - Low Priority
19
  * New Feature: You can now apply an animation to the chat window on page load
20
  * New Feature: You can now choose from 5 colour schemes for the chat window
21
  * Enhancement: Aesthetic Improvement to list of agents (Pro)
149
  global $wplc_tblname_msgs;
150
  $wplc_tblname_chats = $wpdb->prefix . "wplc_chat_sessions";
151
  $wplc_tblname_msgs = $wpdb->prefix . "wplc_chat_msgs";
152
+ $wplc_version = "4.2.9";
153
 
154
  define('WPLC_BASIC_PLUGIN_DIR', dirname(__FILE__));
155
  define('WPLC_BASIC_PLUGIN_URL', plugins_url() . "/wp-live-chat-support/");
220
  if (!isset($wplc_settings['wplc_enabled_on_mobile'])) {
221
  $wplc_settings['wplc_enabled_on_mobile'] = "1";
222
  }
223
+ if(!isset($wplc_settings['wplc_record_ip_address'])){
224
+ $wplc_settings['wplc_record_ip_address'] = "1";
225
+ }
226
  update_option("WPLC_SETTINGS", $wplc_settings);
227
  }
228
  }
936
  $status = __("Active", "wplivechat");
937
  }
938
 
939
+ if($user_ip == ""){
940
+ $user_ip = __('IP Address not recorded', 'wplivechat');
941
+ } else {
942
+ $user_ip = "<a href='http://www.ip-adress.com/ip_tracer/" . $user_ip . "' title='".__('Whois for' ,'wplivechat')." ".$user_ip."'>".$user_ip."</a>";
943
+ }
944
+
945
  echo "<h2>$status " . __('Chat with', 'wplivechat') . " " . $result->name . "</h2>";
946
  echo "<style>#adminmenuwrap { display:none; } #adminmenuback { display:none; } #wpadminbar { display:none; } #wpfooter { display:none; } .update-nag { display:none; }</style>";
947
 
970
  echo " <strong>" . __("Advanced Info", "wplivechat") . "</strong>";
971
  echo " <hr />";
972
  echo " <span class='part1'>" . __("Browser:", "wplivechat") . "</span><span class='part2'> $browser <img src='" . $wplc_basic_plugin_url . "/images/$browser_image' alt='$browser' title='$browser' /><br />";
973
+ echo " <span class='part1'>" . __("IP Address:", "wplivechat") . "</span><span class='part2'> ".$user_ip;
974
  echo "</div>";
975
 
976
  echo " <div id=\"wplc_sound_update\"></div>";
1260
  "wplc_loggedin_user_info" => '1',
1261
  "wplc_user_alternative_text" => $wplc_alt_text,
1262
  "wplc_enabled_on_mobile" => '1',
1263
+ "wplc_display_name" => '1',
1264
+ "wplc_record_ip_address" => '1'
1265
  ));
1266
  }
1267
  add_option("WPLC_HIDE_CHAT", "true");
1429
  if (isset($_POST['wplc_display_to_loggedin_only'])) {
1430
  $wplc_data['wplc_display_to_loggedin_only'] = esc_attr($_POST['wplc_display_to_loggedin_only']);
1431
  }
1432
+
1433
+ if(isset($_POST['wplc_record_ip_address'])){
1434
+ $wplc_data['wplc_record_ip_address'] = esc_attr($_POST['wplc_record_ip_address']);
1435
+ }
1436
 
1437
  update_option('WPLC_SETTINGS', $wplc_data);
1438
  if (isset($_POST['wplc_hide_chat'])) {
1505
  }
1506
 
1507
  /* Error Checks */
1508
+ if(is_admin()){
1509
+ $wplc_error_count = 0;
1510
+ $wplc_admin_warnings = "<div class='error'>";
1511
+ if(!function_exists('set_time_limit')){
1512
+ $wplc_admin_warnings .= "
1513
+ <p>".__("WPLC: set_time_limit() is not enabled on this server. You may experience issues while using WP Live Chat Support as a result of this. Please get in contact your host to get this function enabled.", "wplivechat")."</p>
1514
+ ";
1515
+ $wplc_error_count++;
1516
+ }
1517
+ if(ini_get('safe_mode')){
1518
+ $wplc_admin_warnings .= "
1519
+ <p>".__("WPLC: Safe mode is enabled on this server. You may experience issues while using WP Live Chat Support as a result of this. Please contact your host to get safe mode disabled.", "wplivechat")."</p>
1520
+ ";
1521
+ $wplc_error_count++;
1522
+ }
1523
+ $wplc_admin_warnings .= "</div>";
1524
+ if($wplc_error_count > 0){
1525
+ echo $wplc_admin_warnings;
1526
+ }
1527
+ }
1528
+