WP Live Chat Support - Version 9.0.14

Version Description

  • 2020-08-05 =
  • Added WordPress 5.5 compatibility fixes.
  • Fix multiple chat listings after chat server disconnection.
Download this release

Release Info

Developer wpdev3cx
Plugin Icon 128x128 WP Live Chat Support
Version 9.0.14
Comparing to
See all releases

Code changes from version 9.0.13 to 9.0.14

changelog.txt CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  = 9.0.13 - 2020-08-03 =
2
  * Fix bug on visitors' chat initialization.
3
 
1
+ = 9.0.14 - 2020-08-05 =
2
+ * Added WordPress 5.5 compatibility fixes.
3
+ * Fix multiple chat listings after chat server disconnection.
4
+
5
  = 9.0.13 - 2020-08-03 =
6
  * Fix bug on visitors' chat initialization.
7
 
config.php CHANGED
@@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
9
 
10
  define('WPLC_MIN_WP_VERSION', "5.3");
11
  define('WPLC_MIN_PHP_VERSION', "5.4");
12
- define('WPLC_PLUGIN_VERSION', "9.0.13");
13
  define('WPLC_PLUGIN_DIR', dirname(__FILE__));
14
  define('WPLC_PLUGIN_URL', wplc_plugins_url( '/', __FILE__ ) );
15
  define('WPLC_PLUGIN', plugin_basename( __FILE__ ) );
9
 
10
  define('WPLC_MIN_WP_VERSION', "5.3");
11
  define('WPLC_MIN_PHP_VERSION', "5.4");
12
+ define('WPLC_PLUGIN_VERSION', "9.0.14");
13
  define('WPLC_PLUGIN_DIR', dirname(__FILE__));
14
  define('WPLC_PLUGIN_URL', wplc_plugins_url( '/', __FILE__ ) );
15
  define('WPLC_PLUGIN', plugin_basename( __FILE__ ) );
css/vendor/bootstrap/{wplc_bootstrap_9_0_13.css → wplc_bootstrap_9_0_14.css} RENAMED
File without changes
includes/helpers/agents_helper.php CHANGED
@@ -120,18 +120,16 @@ class TCXAgentsHelper {
120
  if ( ! current_user_can( 'edit_user', $user_id ) ) {
121
  return false;
122
  }
123
- if ( current_user_can( 'wplc_cap_admin' ) ) {
124
- $user = get_userdata( $user_id );
125
- if ( $user !== false ) {
126
- update_user_meta( $user_id, 'wplc_ma_agent', '1' );
127
- $wplc_ma_user = new WP_User( $user_id );
128
- $wplc_ma_user->add_cap( 'wplc_ma_agent' );
129
- if ( ! in_array( 'administrator', (array) $user->roles ) ) {
130
- $wplc_ma_user->add_cap( 'wplc_cap_show_history' );
131
- $wplc_ma_user->add_cap( 'wplc_cap_show_offline' );
132
- }
133
- TCXAgentsHelper::update_agent_time( $user_id );
134
  }
 
135
  }
136
  }
137
 
120
  if ( ! current_user_can( 'edit_user', $user_id ) ) {
121
  return false;
122
  }
123
+ $user = get_userdata( $user_id );
124
+ if ( $user !== false ) {
125
+ update_user_meta( $user_id, 'wplc_ma_agent', '1' );
126
+ $wplc_ma_user = new WP_User( $user_id );
127
+ $wplc_ma_user->add_cap( 'wplc_ma_agent' );
128
+ if ( ! in_array( 'administrator', (array) $user->roles ) ) {
129
+ $wplc_ma_user->add_cap( 'wplc_cap_show_history' );
130
+ $wplc_ma_user->add_cap( 'wplc_cap_show_offline' );
 
 
 
131
  }
132
+ TCXAgentsHelper::update_agent_time( $user_id );
133
  }
134
  }
135
 
includes/helpers/utils_helper.php CHANGED
@@ -209,9 +209,13 @@ class TCXUtilsHelper {
209
  if ( json_last_error() == JSON_ERROR_NONE ) {
210
  return true;
211
  } else {
212
- $output = null;
213
-
214
- return false;
 
 
 
 
215
  }
216
  }
217
 
@@ -622,6 +626,7 @@ class TCXUtilsHelper {
622
  'nonce' => wp_create_nonce( "wplc" ),
623
  'user_id' => $wplc_current_user->ID,
624
  'agent_name' => $wplc_settings->wplc_loggedin_user_info ? $wplc_current_user->display_name : 'Agent',
 
625
  'agent_department' => get_user_meta( $wplc_current_user->ID, 'wplc_user_department', true ),
626
  'typing_string' => __( 'Typing...', 'wp-live-chat-support' ),
627
  'accepting_status' => __( 'Status (Online)', 'wp-live-chat-support' ),
209
  if ( json_last_error() == JSON_ERROR_NONE ) {
210
  return true;
211
  } else {
212
+ $output = TCXUtilsHelper::wplc_json_decode($string);
213
+ if ( json_last_error() == JSON_ERROR_NONE ) {
214
+ return true;
215
+ }else {
216
+ $output = null;
217
+ return false;
218
+ }
219
  }
220
  }
221
 
626
  'nonce' => wp_create_nonce( "wplc" ),
627
  'user_id' => $wplc_current_user->ID,
628
  'agent_name' => $wplc_settings->wplc_loggedin_user_info ? $wplc_current_user->display_name : 'Agent',
629
+ 'agent_email' => $wplc_settings->wplc_loggedin_user_info ? $wplc_current_user->user_email : 'NoEmail',
630
  'agent_department' => get_user_meta( $wplc_current_user->ID, 'wplc_user_department', true ),
631
  'typing_string' => __( 'Typing...', 'wp-live-chat-support' ),
632
  'accepting_status' => __( 'Status (Online)', 'wp-live-chat-support' ),
includes/wplc_loader.php CHANGED
@@ -23,12 +23,6 @@ require_once( WPLC_PLUGIN_DIR . "/includes/wplc_crons.php" );
23
  require_once (WPLC_PLUGIN_DIR . "/modules/activation_wizard/activation_wizard_controller.php");
24
  require_once (WPLC_PLUGIN_DIR . "/modules/activation_wizard/activation_wizard_page.php");
25
 
26
- /*require_once( WPLC_PLUGIN_DIR . "/modules/missed_chats/missed_chat_controller.php" );
27
- require_once( WPLC_PLUGIN_DIR . "/modules/missed_chats/missed_chats_page.php" );
28
-
29
- require_once( WPLC_PLUGIN_DIR . "/modules/history/history_controller.php" );
30
- require_once( WPLC_PLUGIN_DIR . "/modules/history/history_page.php" );*/
31
-
32
  require_once (WPLC_PLUGIN_DIR . "/modules/sessions/sessions_controller.php");
33
  require_once (WPLC_PLUGIN_DIR . "/modules/sessions/sessions_page.php");
34
 
@@ -68,9 +62,6 @@ require_once( WPLC_PLUGIN_DIR . "/modules/tools/tools_page.php" );
68
  require_once( WPLC_PLUGIN_DIR . "/modules/chat_client/chat_client_controller.php" );
69
  require_once( WPLC_PLUGIN_DIR . "/modules/chat_client/chat_client_page.php" );
70
 
71
- /*require_once( WPLC_PLUGIN_DIR . "/modules/agent_local/agent_local_controller.php" );
72
- require_once( WPLC_PLUGIN_DIR . "/modules/agent_local/agent_local_chatbox_controller.php" );
73
- require_once( WPLC_PLUGIN_DIR . "/modules/agent_local/agent_local_page.php" );*/
74
 
75
  require_once( WPLC_PLUGIN_DIR . "/modules/agent_chat/agent_chat_controller.php" );
76
  require_once( WPLC_PLUGIN_DIR . "/modules/agent_chat/agent_chat_page.php" );
@@ -84,10 +75,6 @@ require_once( WPLC_PLUGIN_DIR . "/modules/departments/departments_controller.php
84
  require_once( WPLC_PLUGIN_DIR . "/modules/departments/departments_page.php" );
85
  require_once( WPLC_PLUGIN_DIR . "/modules/departments/manage_department_controller.php" );
86
 
87
- /*require_once (WPLC_PLUGIN_DIR . "/modules/triggers/triggers_controller.php");
88
- require_once (WPLC_PLUGIN_DIR . "/modules/triggers/triggers_page.php");
89
- require_once (WPLC_PLUGIN_DIR . "/modules/triggers/manage_trigger_controller.php");*/
90
-
91
  require_once( WPLC_PLUGIN_DIR . "/includes/data_access/chat_data.php" );
92
  require_once( WPLC_PLUGIN_DIR . "/includes/data_access/chat_rating_data.php" );
93
  require_once( WPLC_PLUGIN_DIR . "/includes/data_access/custom_fields_data.php" );
23
  require_once (WPLC_PLUGIN_DIR . "/modules/activation_wizard/activation_wizard_controller.php");
24
  require_once (WPLC_PLUGIN_DIR . "/modules/activation_wizard/activation_wizard_page.php");
25
 
 
 
 
 
 
 
26
  require_once (WPLC_PLUGIN_DIR . "/modules/sessions/sessions_controller.php");
27
  require_once (WPLC_PLUGIN_DIR . "/modules/sessions/sessions_page.php");
28
 
62
  require_once( WPLC_PLUGIN_DIR . "/modules/chat_client/chat_client_controller.php" );
63
  require_once( WPLC_PLUGIN_DIR . "/modules/chat_client/chat_client_page.php" );
64
 
 
 
 
65
 
66
  require_once( WPLC_PLUGIN_DIR . "/modules/agent_chat/agent_chat_controller.php" );
67
  require_once( WPLC_PLUGIN_DIR . "/modules/agent_chat/agent_chat_page.php" );
75
  require_once( WPLC_PLUGIN_DIR . "/modules/departments/departments_page.php" );
76
  require_once( WPLC_PLUGIN_DIR . "/modules/departments/manage_department_controller.php" );
77
 
 
 
 
 
78
  require_once( WPLC_PLUGIN_DIR . "/includes/data_access/chat_data.php" );
79
  require_once( WPLC_PLUGIN_DIR . "/includes/data_access/chat_rating_data.php" );
80
  require_once( WPLC_PLUGIN_DIR . "/includes/data_access/custom_fields_data.php" );
includes/wplc_updater.php CHANGED
@@ -495,7 +495,7 @@ class TCXUpdater {
495
  TCXAgentsHelper::update_agent_time( $uid );
496
  } else {
497
  foreach ( $agents as $agent ) {
498
- TCXAgentsHelper::set_user_as_agent( $agent->ID );
499
  }
500
  }
501
 
495
  TCXAgentsHelper::update_agent_time( $uid );
496
  } else {
497
  foreach ( $agents as $agent ) {
498
+ TCXAgentsHelper::set_user_as_agent( $agent->ID);
499
  }
500
  }
501
 
modules/agent_chat/js/agent_chat.js CHANGED
@@ -97,7 +97,6 @@ function wplc_set_chat_status(isOnline) {
97
  } else if (isOnline) {
98
  wplc_set_chat_panel_ui();
99
  jQuery("#wplc_chat_offline").hide();
100
-
101
  } else {
102
  jQuery("#wplc_chat_list").empty();
103
  jQuery("#wplc_chat_panel").hide();
97
  } else if (isOnline) {
98
  wplc_set_chat_panel_ui();
99
  jQuery("#wplc_chat_offline").hide();
 
100
  } else {
101
  jQuery("#wplc_chat_list").empty();
102
  jQuery("#wplc_chat_panel").hide();
modules/agent_chat/js/agent_chat_chatbox.js CHANGED
@@ -619,6 +619,7 @@ function wplc_setup_mcu_channel() {
619
  jQuery("body").on('mcu-socket-connecting', function (e) {
620
  jQuery("#wplc_connecting_loader").show();
621
  wplc_unload_chat(wplc_running_chat);
 
622
  jQuery("#wplc_chat_panel").hide();
623
 
624
  });
619
  jQuery("body").on('mcu-socket-connecting', function (e) {
620
  jQuery("#wplc_connecting_loader").show();
621
  wplc_unload_chat(wplc_running_chat);
622
+ jQuery("#wplc_chat_list").empty();
623
  jQuery("#wplc_chat_panel").hide();
624
 
625
  });
modules/data_tools/data_tools_controller.php CHANGED
@@ -75,7 +75,7 @@ class DataToolsController extends BaseController
75
  {
76
  //import file exported from old version!
77
  $key = $key=="WPLC_SETTINGS"? "WPLC_JSON_SETTINGS" :$key;
78
- update_option( $key,$import_key_check[$key]=="JSON" ? json_encode($value):$value );
79
  }
80
 
81
  fclose($handle);
75
  {
76
  //import file exported from old version!
77
  $key = $key=="WPLC_SETTINGS"? "WPLC_JSON_SETTINGS" :$key;
78
+ update_option( $key,$import_key_check[$key]=="JSON" ? TCXUtilsHelper::wplc_json_encode($value):$value );
79
  }
80
 
81
  fclose($handle);
modules/data_tools/data_tools_page.php CHANGED
@@ -158,7 +158,7 @@ function wplc_export_settings(){
158
 
159
  $csvdata[] = array(
160
  "OPTION" => $key,
161
- "VALUE" => base64_encode($value=="JSON"? $current_setting : json_encode($current_setting))
162
  );
163
  }
164
  }
158
 
159
  $csvdata[] = array(
160
  "OPTION" => $key,
161
+ "VALUE" => base64_encode($value=="JSON"? $current_setting : TCXUtilsHelper::wplc_json_encode($current_setting))
162
  );
163
  }
164
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: live chat, live support, chat plugin, live help, wordpress live chat, chat
4
  Requires at least: 5.3
5
  Tested up to: 5.4.2
6
  Requires PHP: 5.4
7
- Stable tag: 9.0.13
8
  License: GPLv2
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
  Text Domain: wp-live-chat-support
@@ -159,6 +159,9 @@ If the live chat box still does not appear on your website, please go through th
159
  Huge update with over 300 changes that include: Bugfixes, Vulnerability Fixes & Plugin Security, Plugin Optimization & Rebranding Updates. We suggest you remove any existing installations of this plugin and install 8.1.x fresh.
160
 
161
  == Changelog ==
 
 
 
162
  = 9.0.13 - 2020-08-03 =
163
  * Fix bug on visitors' chat initialization.
164
 
4
  Requires at least: 5.3
5
  Tested up to: 5.4.2
6
  Requires PHP: 5.4
7
+ Stable tag: 9.0.14
8
  License: GPLv2
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
  Text Domain: wp-live-chat-support
159
  Huge update with over 300 changes that include: Bugfixes, Vulnerability Fixes & Plugin Security, Plugin Optimization & Rebranding Updates. We suggest you remove any existing installations of this plugin and install 8.1.x fresh.
160
 
161
  == Changelog ==
162
+ = 9.0.14 - 2020-08-05 =
163
+ * Added WordPress 5.5 compatibility fixes.
164
+ * Fix multiple chat listings after chat server disconnection.
165
  = 9.0.13 - 2020-08-03 =
166
  * Fix bug on visitors' chat initialization.
167
 
wp-live-chat-support.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP-Live Chat by 3CX
4
  Plugin URI: https://www.3cx.com/wp-live-chat/
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 by 3CX.
6
- Version: 9.0.13
7
  Author: 3CX
8
  Author URI: https://www.3cx.com/wp-live-chat/
9
  Domain Path: /languages
@@ -193,6 +193,9 @@ function wplc_uninstall() {
193
  $admins = get_role( 'administrator' );
194
  if ( $admins !== null ) {
195
  $admins->remove_cap( 'wplc_ma_agent' );
 
 
 
196
  }
197
 
198
  $users = TCXAgentsHelper::get_agent_users();
@@ -200,6 +203,11 @@ function wplc_uninstall() {
200
  delete_user_meta( $user->ID, 'wplc_user_department' );
201
  delete_user_meta( $user->ID, 'wplc_ma_agent' );
202
  delete_user_meta( $user->ID, 'wplc_user_tagline' );
 
 
 
 
 
203
  }
204
  }
205
  }
3
  Plugin Name: WP-Live Chat by 3CX
4
  Plugin URI: https://www.3cx.com/wp-live-chat/
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 by 3CX.
6
+ Version: 9.0.14
7
  Author: 3CX
8
  Author URI: https://www.3cx.com/wp-live-chat/
9
  Domain Path: /languages
193
  $admins = get_role( 'administrator' );
194
  if ( $admins !== null ) {
195
  $admins->remove_cap( 'wplc_ma_agent' );
196
+ $admins->remove_cap( 'wplc_cap_admin' );
197
+ $admins->remove_cap( "wplc_cap_show_history" );
198
+ $admins->remove_cap( "wplc_cap_show_offline" );
199
  }
200
 
201
  $users = TCXAgentsHelper::get_agent_users();
203
  delete_user_meta( $user->ID, 'wplc_user_department' );
204
  delete_user_meta( $user->ID, 'wplc_ma_agent' );
205
  delete_user_meta( $user->ID, 'wplc_user_tagline' );
206
+ $user->remove_cap('wplc_ma_agent');
207
+ if ( ! in_array( 'administrator', (array) $user->roles ) ) {
208
+ $user->remove_cap( 'wplc_cap_show_history' );
209
+ $user->remove_cap( 'wplc_cap_show_offline' );
210
+ }
211
  }
212
  }
213
  }