WP Live Chat Support - Version 8.0.04

Version Description

  • 2018-02-12 - Low priority =
  • Allowed strings from the front end to be translated
  • Fixed the iPhone Safari display bug (zooming in to the chat box)
  • Added support for the agent to detect and connect to the closest chat server
Download this release

Release Info

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

Code changes from version 8.0.03 to 8.0.04

css/themes/classic.css CHANGED
@@ -811,4 +811,25 @@ div#bleeper_chat_ended {
811
  border-bottom-right-radius: 10px;
812
  border-bottom-left-radius: 10px;
813
  box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
814
  }
811
  border-bottom-right-radius: 10px;
812
  border-bottom-left-radius: 10px;
813
  box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
814
+ }
815
+
816
+ /* System notification message style */
817
+ #bleeper_notification_message {
818
+ position: absolute;
819
+ border-radius: 3px;
820
+ padding: 3px 6px;
821
+ top: -5px;
822
+ animation: wplc_notification_slide_in .2s forwards;
823
+ }
824
+
825
+ @keyframes wplc_notification_slide_in {
826
+ from {
827
+ top: -5px;
828
+ opacity: 0;
829
+ }
830
+ to {
831
+
832
+ top: -35px;
833
+ opacity: .8;
834
+ }
835
  }
css/themes/modern.css CHANGED
@@ -997,8 +997,23 @@ button.wplc_retry_chat {
997
  float:right;
998
  }
999
 
 
 
 
 
 
 
 
 
 
 
 
1000
  @media screen and (max-width: 400px) {
1001
 
 
 
 
 
1002
  #wp-live-chat-4 {
1003
  bottom: 150px;
1004
  right: 2%;
@@ -1140,4 +1155,25 @@ div#bleeper_chat_ended {
1140
  border-bottom-right-radius: 10px;
1141
  border-bottom-left-radius: 10px;
1142
  box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1143
  }
997
  float:right;
998
  }
999
 
1000
+ /* iPhone X */
1001
+ @media only screen
1002
+ and (device-width : 375px)
1003
+ and (device-height : 812px)
1004
+ and (-webkit-device-pixel-ratio : 3) {
1005
+
1006
+ #wplc_chatmsg {
1007
+ font-size:16px !important;
1008
+ }
1009
+ }
1010
+
1011
  @media screen and (max-width: 400px) {
1012
 
1013
+ #wplc_chatmsg {
1014
+ font-size:16px !important;
1015
+ }
1016
+
1017
  #wp-live-chat-4 {
1018
  bottom: 150px;
1019
  right: 2%;
1155
  border-bottom-right-radius: 10px;
1156
  border-bottom-left-radius: 10px;
1157
  box-shadow: 0 0 40px 1px rgba(0,0,0,.07);
1158
+ }
1159
+
1160
+ /* System notification message style */
1161
+ #bleeper_notification_message {
1162
+ position: absolute;
1163
+ border-radius: 3px;
1164
+ padding: 3px 6px;
1165
+ top: -5px;
1166
+ animation: wplc_notification_slide_in .2s forwards;
1167
+ }
1168
+
1169
+ @keyframes wplc_notification_slide_in {
1170
+ from {
1171
+ top: -5px;
1172
+ opacity: 0;
1173
+ }
1174
+ to {
1175
+
1176
+ top: -35px;
1177
+ opacity: .8;
1178
+ }
1179
  }
includes/blocks/wplc-inline-chat-box/wplc_functions.js CHANGED
@@ -3,7 +3,7 @@ jQuery(document).ready( function($){
3
  var chat_box_button = '<div class="wplc_gutenberg_button active" style="background-color: #' + wplc_styles.color_1 + '; background-image: url(' + wplc_images.close_icon + ');"></div>';
4
  var chatbox_preview_img = '<img class="wplc_gutenberg_avatar_img" style="max-width:inherit;" id="agent_grav_' + wplc_agent_info.id + '" title="' + wplc_agent_info.name + '" src="https://www.gravatar.com/avatar/' + wplc_agent_info.email + '?s=60" />';
5
  var chatbox_preview_overlay_image = '<div class="wplc_gutenberg_overlay_image" style="background-image: url(\'https://www.gravatar.com/avatar/' + wplc_agent_info.email + '?s=60\');"></div>';
6
- var chat_box_content = chat_box_button + '<div class="wplc_gutenberg_chat_box"><div class="wplc_gutenberg_header" style="background-color: #' + wplc_styles.color_1 + ' !important;"><span class="wplc_gutenberg_avatar">' + chatbox_preview_img + chatbox_preview_overlay_image + '</span><span class="wplc_gutenberg_name">' + wplc_agent_info.name + '</span><span class="wplc_gutenberg_chevron dashicons dashicons-arrow-up-alt2"></span></div><div class="wplc_gutenberg_body" style="background-image: url(' + wplc_images.background_image + ');"></div><div class="wplc_gutenberg_text_box"><span class="wplc_gutenberg_typing">Type here</span></div></div>';
7
 
8
  // Update select fields on page load
9
  $('#wplc-inline-chat-box .wplc_selected_theme').each(function(){
3
  var chat_box_button = '<div class="wplc_gutenberg_button active" style="background-color: #' + wplc_styles.color_1 + '; background-image: url(' + wplc_images.close_icon + ');"></div>';
4
  var chatbox_preview_img = '<img class="wplc_gutenberg_avatar_img" style="max-width:inherit;" id="agent_grav_' + wplc_agent_info.id + '" title="' + wplc_agent_info.name + '" src="https://www.gravatar.com/avatar/' + wplc_agent_info.email + '?s=60" />';
5
  var chatbox_preview_overlay_image = '<div class="wplc_gutenberg_overlay_image" style="background-image: url(\'https://www.gravatar.com/avatar/' + wplc_agent_info.email + '?s=60\');"></div>';
6
+ var chat_box_content = chat_box_button + '<div class="wplc_gutenberg_chat_box"><div class="wplc_gutenberg_header" style="background-color: #' + wplc_styles.color_1 + ' !important;"><span class="wplc_gutenberg_avatar">' + chatbox_preview_img + chatbox_preview_overlay_image + '</span><span class="wplc_gutenberg_name">' + wplc_agent_info.name + '</span><span class="wplc_gutenberg_chevron dashicons dashicons-arrow-up-alt2"></span></div><div class="wplc_gutenberg_body" style="background-image: url(' + wplc_images.background_image + ');"></div><div class="wplc_gutenberg_text_box"><span class="wplc_gutenberg_typing">'+bleeper_localized_strings[5]+'</span></div></div>';
7
 
8
  // Update select fields on page load
9
  $('#wplc-inline-chat-box .wplc_selected_theme').each(function(){
includes/surveys.php CHANGED
@@ -128,6 +128,7 @@ function wplc_survey_hook_control_settings_page_more_tabs() {
128
  add_action('wplc_hook_admin_settings_save','wplc_survey_save_settings');
129
  function wplc_survey_save_settings() {
130
  if (isset($_POST['wplc_save_settings'])) {
 
131
  if (isset($_POST['wplc_enable_surveys'])) {
132
  $wplc_survey_data['wplc_enable_surveys'] = esc_attr($_POST['wplc_enable_surveys']);
133
  } else {
@@ -153,6 +154,7 @@ function wplc_survey_save_settings() {
153
  } else {
154
  $wplc_survey_data['survey_display'] = "1";
155
  }
 
156
 
157
  update_option('WPLC_SURVEY_SETTINGS', $wplc_survey_data);
158
 
@@ -215,15 +217,19 @@ add_action('wp_enqueue_scripts', 'wplc_nimble_load_scripts' , 99 );
215
  function wplc_nimble_load_scripts() {
216
  $settings = get_option('WPLC_SURVEY_SETTINGS');
217
  $wplc_settings = get_option('WPLC_SETTINGS');
218
-
219
  if( isset( $settings['wplc_enable_surveys'] ) && intval($settings['wplc_enable_surveys']) == 1 && !isset($_COOKIE['ns_participated'])){
220
 
 
 
221
  if( isset( $settings['survey_user'] ) ){ $ns_id = $settings['survey_user']; } else { $ns_id = ''; }
222
  if( isset( $settings['survey'] ) ){ $ns_sid = $settings['survey']; } else { $ns_sid = ''; }
223
  if( isset( $settings['lead_form'] ) ){ $ns_lfid = $settings['lead_form']; } else { $ns_lfid = ''; }
224
 
225
  //wp_enqueue_script( 'nimble-squirrel-user-script', '//nimblesquirrel.com/api/nimblesquirrel.js', array(), '1.0.0', true );
226
- wp_enqueue_script( 'nimble-squirrel-user-script', '//nimblesquirrel.com/api/v2.0/nimblesquirrel.js', array(), '1.0.0', true );
 
 
227
  wp_localize_script( 'nimble-squirrel-user-script', 'ns_id', $ns_id );
228
 
229
 
128
  add_action('wplc_hook_admin_settings_save','wplc_survey_save_settings');
129
  function wplc_survey_save_settings() {
130
  if (isset($_POST['wplc_save_settings'])) {
131
+
132
  if (isset($_POST['wplc_enable_surveys'])) {
133
  $wplc_survey_data['wplc_enable_surveys'] = esc_attr($_POST['wplc_enable_surveys']);
134
  } else {
154
  } else {
155
  $wplc_survey_data['survey_display'] = "1";
156
  }
157
+
158
 
159
  update_option('WPLC_SURVEY_SETTINGS', $wplc_survey_data);
160
 
217
  function wplc_nimble_load_scripts() {
218
  $settings = get_option('WPLC_SURVEY_SETTINGS');
219
  $wplc_settings = get_option('WPLC_SETTINGS');
220
+
221
  if( isset( $settings['wplc_enable_surveys'] ) && intval($settings['wplc_enable_surveys']) == 1 && !isset($_COOKIE['ns_participated'])){
222
 
223
+
224
+
225
  if( isset( $settings['survey_user'] ) ){ $ns_id = $settings['survey_user']; } else { $ns_id = ''; }
226
  if( isset( $settings['survey'] ) ){ $ns_sid = $settings['survey']; } else { $ns_sid = ''; }
227
  if( isset( $settings['lead_form'] ) ){ $ns_lfid = $settings['lead_form']; } else { $ns_lfid = ''; }
228
 
229
  //wp_enqueue_script( 'nimble-squirrel-user-script', '//nimblesquirrel.com/api/nimblesquirrel.js', array(), '1.0.0', true );
230
+
231
+
232
+ wp_enqueue_script( 'nimble-squirrel-user-script', 'https://nimblesquirrel.com/api/v2.0/nimblesquirrel.js', array(), '1.0.0', true );
233
  wp_localize_script( 'nimble-squirrel-user-script', 'ns_id', $ns_id );
234
 
235
 
js/wplc_server.js CHANGED
@@ -984,6 +984,20 @@ var wplc_generate_system_notification_object = function(msg,other,originates) {
984
  return the_message;
985
  }
986
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
987
  /*
988
  * Updates the message element with a new message.
989
  * - mid: Message ID which is appended to class selector as .message_{mid}
984
  return the_message;
985
  }
986
 
987
+ function wplc_display_system_notification(message) {
988
+ message_output = '<div id="bleeper_notification_message" class="wplc-color-bg-1 wplc-color-2">' + message.msg + '</div>';
989
+
990
+ if (jQuery('#bleeper_notification_message').length == 0) {
991
+ jQuery('#wp-live-chat-4').prepend(message_output);
992
+ }
993
+ }
994
+
995
+ function wplc_clear_system_notification() {
996
+ if (jQuery('#bleeper_notification_message').length !== 0) {
997
+ jQuery('#bleeper_notification_message').remove();
998
+ }
999
+ }
1000
+
1001
  /*
1002
  * Updates the message element with a new message.
1003
  * - mid: Message ID which is appended to class selector as .message_{mid}
js/wplc_u_admin_events.js CHANGED
@@ -1,3 +1,4 @@
 
1
  var wplc_upsell_events_array = [];
2
  var wplc_new_chat_ringer_dismissed = false;
3
 
@@ -17,6 +18,7 @@ jQuery("#toolbar-item-open-bleeper").hide();
17
 
18
 
19
  jQuery(document).ready(function(){
 
20
  if ( typeof bleeper_in_dashboard !== "undefined" && bleeper_in_dashboard === "0") {
21
 
22
  jQuery(".nifty_top_wrapper").hide();
@@ -31,7 +33,27 @@ jQuery(document).ready(function(){
31
 
32
  }).done(function(response){
33
  jQuery(response).insertAfter("#bleeper_content_wrapper");
34
- jQuery.event.trigger({type: "bleeper_dom_ready"});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  if ( typeof bleeper_in_dashboard !== "undefined" && bleeper_in_dashboard === "0") {
37
 
@@ -93,7 +115,7 @@ jQuery(document).on("bleeper_limited", function(e){
93
  if(is_limited === "true" || is_limited === true){
94
  jQuery("#wplc_limited_container").fadeIn();
95
  } else {
96
- //console.log("not_limited");
97
  }
98
  }
99
  });
@@ -864,4 +886,4 @@ function wplc_desktop_notification() {
864
  body: bleeper_new_chat_notification_text
865
  });
866
  }
867
- }
1
+
2
  var wplc_upsell_events_array = [];
3
  var wplc_new_chat_ringer_dismissed = false;
4
 
18
 
19
 
20
  jQuery(document).ready(function(){
21
+
22
  if ( typeof bleeper_in_dashboard !== "undefined" && bleeper_in_dashboard === "0") {
23
 
24
  jQuery(".nifty_top_wrapper").hide();
33
 
34
  }).done(function(response){
35
  jQuery(response).insertAfter("#bleeper_content_wrapper");
36
+
37
+ /* find closest server */
38
+ bleeper_ping_servers(function(lowest_ping_index) {
39
+
40
+ if(typeof bleeper_end_point_override !== "undefined"){
41
+ /* use the override if we have set it */
42
+ node_uri = bleeper_end_point_override; //Override
43
+ } else {
44
+ if (typeof bleeper_server_location !== "undefined") {
45
+ // use this as the user selected the server in the settings
46
+ node_uri = bleeper_server_list[parseInt(bleeper_server_location)];
47
+ } else {
48
+ // use the fastest server instead
49
+ node_uri = bleeper_server_list[lowest_ping_index];
50
+ }
51
+ }
52
+ if (window.console) { console.log("[Bleeper] Connecting to "+node_uri); }
53
+ jQuery.event.trigger({type: "bleeper_dom_ready"});
54
+
55
+ });
56
+
57
 
58
  if ( typeof bleeper_in_dashboard !== "undefined" && bleeper_in_dashboard === "0") {
59
 
115
  if(is_limited === "true" || is_limited === true){
116
  jQuery("#wplc_limited_container").fadeIn();
117
  } else {
118
+ //not limited
119
  }
120
  }
121
  });
886
  body: bleeper_new_chat_notification_text
887
  });
888
  }
889
+ }
js/wplc_u_node_events.js CHANGED
@@ -63,6 +63,7 @@ jQuery(document).ready(function() {
63
  if (e.status === "active") {
64
  jQuery.event.trigger({type: "wplc_open_chat_2", wplc_online: wplc_online});
65
  }
 
66
  });
67
 
68
  /**
@@ -71,11 +72,10 @@ jQuery(document).ready(function() {
71
  * @return void
72
  */
73
  jQuery(document).on("bleeper_disconnected", function() {
 
74
  if(typeof wplc_error_messages !== "undefined" && typeof wplc_error_messages['disconnected_message'] !== "undefined"){
75
  var the_message = wplc_generate_system_notification_object(wplc_error_messages['disconnected_message'], {}, 0);
76
- wplc_push_message_to_chatbox(the_message,'u', function() {
77
- wplc_scroll_to_bottom();
78
- });
79
  }
80
  });
81
 
@@ -215,7 +215,7 @@ jQuery(document).ready(function() {
215
  jQuery(document).on("bleeper_agent_joined", function(e) {
216
  if (typeof e.ndata !== "undefined" && typeof e.ndata === "object") {
217
  if (typeof agent_joined[parseInt(e.ndata.agent)] === "undefined") {
218
- the_message = wplc_generate_system_notification_object(e.ndata.agent_name+" has joined.", {}, 0);
219
  wplc_push_message_to_chatbox(the_message,'u', function() {
220
  wplc_scroll_to_bottom();
221
  });
@@ -232,7 +232,7 @@ jQuery(document).ready(function() {
232
  */
233
  jQuery(document).on("bleeper_agent_left", function(e) {
234
  if (typeof e.ndata !== "undefined" && typeof e.ndata === "object") {
235
- the_message = wplc_generate_system_notification_object(e.ndata.agent_name+" has left.", {}, 0);
236
  if (typeof agent_joined[parseInt(e.ndata.agent)] !== "undefined" && agent_joined[parseInt(e.ndata.agent)] === true) {
237
  agent_joined[parseInt(e.ndata.agent)] = undefined;
238
  wplc_push_message_to_chatbox(the_message,'u', function() {
@@ -246,7 +246,7 @@ jQuery(document).ready(function() {
246
 
247
  jQuery(document).on("bleeper_chat_ended_notification", function(e) {
248
  if (typeof e.ndata !== "undefined" && typeof e.ndata === "object") {
249
- the_message = wplc_generate_system_notification_object(e.ndata.agent_name+" has ended the chat.", {}, 0);
250
  wplc_push_message_to_chatbox(the_message,'u', function() {
251
  wplc_scroll_to_bottom();
252
  });
@@ -264,7 +264,7 @@ jQuery(document).ready(function() {
264
  * @return void
265
  */
266
  jQuery(document).on("bleeper_agent_disconnected", function(e) {
267
- the_message = wplc_generate_system_notification_object(e.ndata.agent_name+" has disconnected.", {}, 0);
268
  if (typeof agent_joined[parseInt(e.ndata.aid)] !== "undefined" && agent_joined[parseInt(e.ndata.aid)] === true) {
269
  agent_joined[parseInt(e.ndata.aid)] = undefined;
270
  wplc_push_message_to_chatbox(the_message,'u', function() {
63
  if (e.status === "active") {
64
  jQuery.event.trigger({type: "wplc_open_chat_2", wplc_online: wplc_online});
65
  }
66
+ wplc_clear_system_notification();
67
  });
68
 
69
  /**
72
  * @return void
73
  */
74
  jQuery(document).on("bleeper_disconnected", function() {
75
+ console.log('disconnected');
76
  if(typeof wplc_error_messages !== "undefined" && typeof wplc_error_messages['disconnected_message'] !== "undefined"){
77
  var the_message = wplc_generate_system_notification_object(wplc_error_messages['disconnected_message'], {}, 0);
78
+ wplc_display_system_notification(the_message);
 
 
79
  }
80
  });
81
 
215
  jQuery(document).on("bleeper_agent_joined", function(e) {
216
  if (typeof e.ndata !== "undefined" && typeof e.ndata === "object") {
217
  if (typeof agent_joined[parseInt(e.ndata.agent)] === "undefined") {
218
+ the_message = wplc_generate_system_notification_object(e.ndata.agent_name+bleeper_localized_strings[0], {}, 0);
219
  wplc_push_message_to_chatbox(the_message,'u', function() {
220
  wplc_scroll_to_bottom();
221
  });
232
  */
233
  jQuery(document).on("bleeper_agent_left", function(e) {
234
  if (typeof e.ndata !== "undefined" && typeof e.ndata === "object") {
235
+ the_message = wplc_generate_system_notification_object(e.ndata.agent_name+bleeper_localized_strings[1], {}, 0);
236
  if (typeof agent_joined[parseInt(e.ndata.agent)] !== "undefined" && agent_joined[parseInt(e.ndata.agent)] === true) {
237
  agent_joined[parseInt(e.ndata.agent)] = undefined;
238
  wplc_push_message_to_chatbox(the_message,'u', function() {
246
 
247
  jQuery(document).on("bleeper_chat_ended_notification", function(e) {
248
  if (typeof e.ndata !== "undefined" && typeof e.ndata === "object") {
249
+ the_message = wplc_generate_system_notification_object(e.ndata.agent_name+bleeper_localized_strings[2], {}, 0);
250
  wplc_push_message_to_chatbox(the_message,'u', function() {
251
  wplc_scroll_to_bottom();
252
  });
264
  * @return void
265
  */
266
  jQuery(document).on("bleeper_agent_disconnected", function(e) {
267
+ the_message = wplc_generate_system_notification_object(e.ndata.agent_name+bleeper_localized_strings[3], {}, 0);
268
  if (typeof agent_joined[parseInt(e.ndata.aid)] !== "undefined" && agent_joined[parseInt(e.ndata.aid)] === true) {
269
  agent_joined[parseInt(e.ndata.aid)] = undefined;
270
  wplc_push_message_to_chatbox(the_message,'u', function() {
modules/beta_features.php CHANGED
@@ -34,6 +34,10 @@ function wplc_beta_settings_tab_content() {
34
  }
35
  $wplc_end_point_override = get_option("wplc_end_point_override");
36
  $wplc_end_point_override = $wplc_end_point_override === false ? "" : $wplc_end_point_override;
 
 
 
 
37
  $wplc_new_chat_ringer_count = 5;
38
  if(isset($wplc_settings['wplc_new_chat_ringer_count'])){
39
  $wplc_new_chat_ringer_count = intval($wplc_settings['wplc_new_chat_ringer_count']);
@@ -56,6 +60,21 @@ function wplc_beta_settings_tab_content() {
56
  <small><em><?php _e("Disabling this will revert the chat dashboard back to the legacy version.", "wplivechat"); ?></em></small>
57
  </td>
58
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  <tr>
60
  <td width="250" valign="top">
61
  <label for="wplc_use_node_server"><?php _e("Chat server token","wplivechat"); ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('Security token for accessing chats on the node server. Changing this will remove current chats', 'wplivechat'); ?>"></i></label>
@@ -124,6 +143,10 @@ function wplc_beta_settings_save_hooked($wplc_data){
124
  if (isset($_POST['wplc_end_point_override'])) {
125
  update_option("wplc_end_point_override", esc_attr($_POST['wplc_end_point_override']));
126
  }
 
 
 
 
127
  if (isset($_POST['wplc_new_chat_ringer_count'])) {
128
  $wplc_data['wplc_new_chat_ringer_count'] = intval($_POST['wplc_new_chat_ringer_count']);
129
  }
34
  }
35
  $wplc_end_point_override = get_option("wplc_end_point_override");
36
  $wplc_end_point_override = $wplc_end_point_override === false ? "" : $wplc_end_point_override;
37
+ $wplc_server_location = get_option("wplc_server_location");
38
+ $wplc_server_location = $wplc_server_location === false ? "auto" : $wplc_server_location;
39
+
40
+
41
  $wplc_new_chat_ringer_count = 5;
42
  if(isset($wplc_settings['wplc_new_chat_ringer_count'])){
43
  $wplc_new_chat_ringer_count = intval($wplc_settings['wplc_new_chat_ringer_count']);
60
  <small><em><?php _e("Disabling this will revert the chat dashboard back to the legacy version.", "wplivechat"); ?></em></small>
61
  </td>
62
  </tr>
63
+ <tr>
64
+ <td width="250" valign="top">
65
+ <label for="wplc_server_location"><?php _e("Server location","wplivechat"); ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('Select a server location that is near to you.', 'wplivechat'); ?>"></i></label>
66
+ </td>
67
+ <td valign="top">
68
+ <select name='wplc_server_location'>
69
+ <option value='auto' <?php if (isset($wplc_server_location) && $wplc_server_location === "auto") { echo "selected"; } ?>><?php _e("Automatic (suggested)"); ?></option>
70
+ <option value='us1' <?php if (isset($wplc_server_location) && $wplc_server_location === "us1") { echo "selected"; } ?>><?php echo sprintf(__("United States - %s","wplivechat"), "#1"); ?></option>
71
+ <option value='us2' <?php if (isset($wplc_server_location) && $wplc_server_location === "us2") { echo "selected"; } ?>><?php echo sprintf(__("United States - %s","wplivechat"), "#2"); ?></option>
72
+ <option value='eu1' <?php if (isset($wplc_server_location) && $wplc_server_location === "eu1") { echo "selected"; } ?>><?php echo sprintf(__("Europe - %s","wplivechat"), "#1"); ?></option>
73
+ <option value='eu2' <?php if (isset($wplc_server_location) && $wplc_server_location === "eu2") { echo "selected"; } ?>><?php echo sprintf(__("Europe - %s","wplivechat"), "#2"); ?></option>
74
+ </select>
75
+
76
+ </td>
77
+ </tr>
78
  <tr>
79
  <td width="250" valign="top">
80
  <label for="wplc_use_node_server"><?php _e("Chat server token","wplivechat"); ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('Security token for accessing chats on the node server. Changing this will remove current chats', 'wplivechat'); ?>"></i></label>
143
  if (isset($_POST['wplc_end_point_override'])) {
144
  update_option("wplc_end_point_override", esc_attr($_POST['wplc_end_point_override']));
145
  }
146
+ if (isset($_POST['wplc_server_location'])) {
147
+ update_option("wplc_server_location", esc_attr($_POST['wplc_server_location']));
148
+ }
149
+
150
  if (isset($_POST['wplc_new_chat_ringer_count'])) {
151
  $wplc_data['wplc_new_chat_ringer_count'] = intval($_POST['wplc_new_chat_ringer_count']);
152
  }
modules/node_server.php CHANGED
@@ -483,7 +483,8 @@ function wplc_admin_remote_dashboard_scripts($wplc_settings){
483
 
484
 
485
 
486
- wp_register_script('wplc-admin-js-sockets', trailingslashit( $bleeper_url ) . "socket.io/socket.io.js", false, $wplc_version, false);
 
487
  //wp_register_script('wplc-admin-js-sockets', "http://localhost:3000/socket.io/socket.io.js", false, $wplc_version, false);
488
  wp_enqueue_script('wplc-admin-js-sockets');
489
 
@@ -638,6 +639,18 @@ function wplc_admin_remote_dashboard_scripts($wplc_settings){
638
  wp_localize_script( 'wplc-admin-js-agent', 'bleeper_ringer_count', "" . $wplc_ringer_count );
639
  }
640
 
 
 
 
 
 
 
 
 
 
 
 
 
641
  $wplc_end_point_override = get_option("wplc_end_point_override");
642
  if($wplc_end_point_override !== false && $wplc_end_point_override !== ""){
643
  wp_localize_script( 'wplc-admin-js-agent', 'bleeper_end_point_override', $wplc_end_point_override );
483
 
484
 
485
 
486
+ wp_register_script('wplc-admin-js-sockets', "https://bleeper.io/app/assets/js/vendor/socket.io/socket.io.slim.js", false, $wplc_version, false);
487
+ //wp_register_script('wplc-admin-js-sockets', trailingslashit( $bleeper_url ) . "socket.io/socket.io.js", false, $wplc_version, false);
488
  //wp_register_script('wplc-admin-js-sockets', "http://localhost:3000/socket.io/socket.io.js", false, $wplc_version, false);
489
  wp_enqueue_script('wplc-admin-js-sockets');
490
 
639
  wp_localize_script( 'wplc-admin-js-agent', 'bleeper_ringer_count', "" . $wplc_ringer_count );
640
  }
641
 
642
+
643
+ $wplc_server_location = get_option( "wplc_server_location" );
644
+ if( $wplc_server_location !== false && $wplc_server_location !== "" && $wplc_server_location !== "auto" ){
645
+ if ( $wplc_server_location === "us1") { $wplc_server_location = "0"; }
646
+ else if ( $wplc_server_location === "us2") { $wplc_server_location = "3"; }
647
+ else if ( $wplc_server_location === "eu1") { $wplc_server_location = "1"; }
648
+ else if ( $wplc_server_location === "eu2") { $wplc_server_location = "2"; }
649
+ else { $wplc_server_location = "0"; }
650
+ wp_localize_script( 'wplc-admin-js-agent', 'bleeper_server_location', $wplc_server_location );
651
+ }
652
+
653
+ /* use the end point override as the final decision for identifying the actual end point override variable */
654
  $wplc_end_point_override = get_option("wplc_end_point_override");
655
  if($wplc_end_point_override !== false && $wplc_end_point_override !== ""){
656
  wp_localize_script( 'wplc-admin-js-agent', 'bleeper_end_point_override', $wplc_end_point_override );
readme.txt CHANGED
@@ -230,6 +230,11 @@ It is highly recommended that you upgrade to WP Live Chat Support version 4.4.0
230
 
231
  == Changelog ==
232
 
 
 
 
 
 
233
  = 8.0.03 - 2018-01-30 - Medium priority =
234
  * Fixed a CSS bug
235
  * Corrected a bug with the default theme not being set correctly.
230
 
231
  == Changelog ==
232
 
233
+ = 8.0.04 - 2018-02-12 - Low priority =
234
+ * Allowed strings from the front end to be translated
235
+ * Fixed the iPhone Safari display bug (zooming in to the chat box)
236
+ * Added support for the agent to detect and connect to the closest chat server
237
+
238
  = 8.0.03 - 2018-01-30 - Medium priority =
239
  * Fixed a CSS bug
240
  * Corrected a bug with the default theme not being set correctly.
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: 8.0.03
7
  Author: WP-LiveChat
8
  Author URI: http://www.wp-livechat.com
9
  Text Domain: wplivechat
@@ -11,7 +11,12 @@
11
  */
12
 
13
  /**
14
- *
 
 
 
 
 
15
  * 8.0.03 - 2018-01-30 - Medium priority
16
  * Fixed a CSS bug
17
  * Corrected a bug with the default theme not being set correctly.
@@ -594,7 +599,7 @@ global $debug_start;
594
  $wplc_tblname_offline_msgs = $wpdb->prefix . "wplc_offline_messages";
595
  $wplc_tblname_chats = $wpdb->prefix . "wplc_chat_sessions";
596
  $wplc_tblname_msgs = $wpdb->prefix . "wplc_chat_msgs";
597
- $wplc_version = "8.0.03";
598
 
599
  define('WPLC_BASIC_PLUGIN_DIR', dirname(__FILE__));
600
  define('WPLC_BASIC_PLUGIN_URL', plugins_url( '/', __FILE__ ) );
@@ -1158,7 +1163,8 @@ function wplc_push_js_to_front_basic() {
1158
  } else {
1159
  $bleeper_url = BLEEPER_NODE_SERVER_URL;
1160
  }
1161
- wp_register_script('wplc-node-server-script', trailingslashit( $bleeper_url ) . "socket.io/socket.io.js", array('jquery'), $wplc_version);
 
1162
 
1163
 
1164
  //wp_register_script('wplc-node-server-script', 'http://localhost:3000/socket.io/socket.io.js', array('jquery'), $wplc_version);
@@ -1176,6 +1182,17 @@ function wplc_push_js_to_front_basic() {
1176
  }
1177
  }
1178
 
 
 
 
 
 
 
 
 
 
 
 
1179
  $wplc_end_point_override = get_option("wplc_end_point_override");
1180
  if($wplc_end_point_override !== false && $wplc_end_point_override !== ""){
1181
  wp_localize_script( 'wplc-server-script', 'bleeper_end_point_override', $wplc_end_point_override );
@@ -1329,7 +1346,7 @@ function wplc_push_js_to_front_basic() {
1329
  'server_connection_lost' => __("Connection to server lost. Please reload this page. Error: ", "wplivechat"),
1330
  'chat_ended_by_operator' => ( empty( $wplc_settings['wplc_text_chat_ended'] ) ) ? __("The chat has been ended by the operator.", "wplivechat") : esc_attr( $wplc_settings['wplc_text_chat_ended'] ) ,
1331
  'empty_message' => __( "Please enter a message", "wplivechat" ),
1332
- 'disconnected_message' => __("You have been disconnected", "wplivechat"),
1333
  );
1334
 
1335
  $wplc_error_messages = apply_filters( "wplc_user_error_messages_filter", $wplc_error_messages );
@@ -1379,6 +1396,16 @@ function wplc_push_js_to_front_basic() {
1379
  wp_localize_script('wplc-user-script', 'wplc_localized_string_is_typing', $agent . __(" is typing...","wplivechat"));
1380
  wp_localize_script('wplc-user-script', 'wplc_localized_string_is_typing_single', __(" is typing...","wplivechat"));
1381
 
 
 
 
 
 
 
 
 
 
 
1382
 
1383
  if( isset( $wplc_settings['wplc_elem_trigger_id'] ) && trim( $wplc_settings['wplc_elem_trigger_id'] ) !== "" ) {
1384
  if( isset( $wplc_settings['wplc_elem_trigger_action'] ) ){
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: 8.0.04
7
  Author: WP-LiveChat
8
  Author URI: http://www.wp-livechat.com
9
  Text Domain: wplivechat
11
  */
12
 
13
  /**
14
+ *
15
+ * 8.0.04 - 2018-02-12 - Low priority
16
+ * Allowed strings from the front end to be translated
17
+ * Fixed the iPhone Safari display bug (zooming in to the chat box)
18
+ * Added support for the agent to detect and connect to the closest chat server
19
+ *
20
  * 8.0.03 - 2018-01-30 - Medium priority
21
  * Fixed a CSS bug
22
  * Corrected a bug with the default theme not being set correctly.
599
  $wplc_tblname_offline_msgs = $wpdb->prefix . "wplc_offline_messages";
600
  $wplc_tblname_chats = $wpdb->prefix . "wplc_chat_sessions";
601
  $wplc_tblname_msgs = $wpdb->prefix . "wplc_chat_msgs";
602
+ $wplc_version = "8.0.04";
603
 
604
  define('WPLC_BASIC_PLUGIN_DIR', dirname(__FILE__));
605
  define('WPLC_BASIC_PLUGIN_URL', plugins_url( '/', __FILE__ ) );
1163
  } else {
1164
  $bleeper_url = BLEEPER_NODE_SERVER_URL;
1165
  }
1166
+ //wp_register_script('wplc-node-server-script', trailingslashit( $bleeper_url ) . "socket.io/socket.io.js", array('jquery'), $wplc_version);
1167
+ wp_register_script('wplc-node-server-script', "https://bleeper.io/app/assets/js/vendor/socket.io/socket.io.slim.js", array('jquery'), $wplc_version);
1168
 
1169
 
1170
  //wp_register_script('wplc-node-server-script', 'http://localhost:3000/socket.io/socket.io.js', array('jquery'), $wplc_version);
1182
  }
1183
  }
1184
 
1185
+ $wplc_server_location = get_option( "wplc_server_location" );
1186
+ if( $wplc_server_location !== false && $wplc_server_location !== "" && $wplc_server_location !== "auto" ){
1187
+ if ( $wplc_server_location === "us1") { $wplc_server_location = "0"; }
1188
+ else if ( $wplc_server_location === "us2") { $wplc_server_location = "3"; }
1189
+ else if ( $wplc_server_location === "eu1") { $wplc_server_location = "1"; }
1190
+ else if ( $wplc_server_location === "eu2") { $wplc_server_location = "2"; }
1191
+ else { $wplc_server_location = "0"; }
1192
+ wp_localize_script( 'wplc-server-script', 'bleeper_server_location', $wplc_server_location );
1193
+ }
1194
+
1195
+
1196
  $wplc_end_point_override = get_option("wplc_end_point_override");
1197
  if($wplc_end_point_override !== false && $wplc_end_point_override !== ""){
1198
  wp_localize_script( 'wplc-server-script', 'bleeper_end_point_override', $wplc_end_point_override );
1346
  'server_connection_lost' => __("Connection to server lost. Please reload this page. Error: ", "wplivechat"),
1347
  'chat_ended_by_operator' => ( empty( $wplc_settings['wplc_text_chat_ended'] ) ) ? __("The chat has been ended by the operator.", "wplivechat") : esc_attr( $wplc_settings['wplc_text_chat_ended'] ) ,
1348
  'empty_message' => __( "Please enter a message", "wplivechat" ),
1349
+ 'disconnected_message' => __("Disconnected, attempting to reconnect...", "wplivechat"),
1350
  );
1351
 
1352
  $wplc_error_messages = apply_filters( "wplc_user_error_messages_filter", $wplc_error_messages );
1396
  wp_localize_script('wplc-user-script', 'wplc_localized_string_is_typing', $agent . __(" is typing...","wplivechat"));
1397
  wp_localize_script('wplc-user-script', 'wplc_localized_string_is_typing_single', __(" is typing...","wplivechat"));
1398
 
1399
+ $bleeper_string_array = array(
1400
+ __(" has joined.","wplivechat"),
1401
+ __(" has left.","wplivechat"),
1402
+ __(" has ended the chat.", "wplivechat"),
1403
+ __(" has disconnected.", "wplivechat"),
1404
+ __("(edited)", "wplivechat"),
1405
+ __("Type here","wplivechat")
1406
+ );
1407
+
1408
+ wp_localize_script('wplc-user-script', 'bleeper_localized_strings', $bleeper_string_array );
1409
 
1410
  if( isset( $wplc_settings['wplc_elem_trigger_id'] ) && trim( $wplc_settings['wplc_elem_trigger_id'] ) !== "" ) {
1411
  if( isset( $wplc_settings['wplc_elem_trigger_action'] ) ){