Version Description
- 2020-07-28 =
- Fix bug on display business hours.
- Added message on agent's chat view when chat is offline due to business hours settings.
- Fix bug on agent's chats list with broken image link.
- Fix chat notifications ringtone and browser notification.
Download this release
Release Info
Developer | wpdev3cx |
Plugin | WP Live Chat Support |
Version | 9.0.8 |
Comparing to | |
See all releases |
Code changes from version 9.0.7 to 9.0.8
- ajax/agent.php +4 -4
- changelog.txt +6 -0
- config.php +2 -2
- includes/wplc_updater.php +94 -59
- modules/activation_wizard/activation_wizard_controller.php +1 -1
- modules/activation_wizard/wizard_partials/channel_selection.php +4 -25
- modules/activation_wizard/wizard_partials/invite_agents.php +4 -12
- modules/agent_chat/agent_chat_page.php +2 -1
- modules/agent_chat/agent_chat_style.css +1 -0
- modules/agent_chat/agent_chat_view.php +13 -7
- modules/agent_chat/js/agent_chat.js +73 -76
- modules/settings/js/settings.js +1 -1
- readme.txt +10 -2
- wp-live-chat-support.php +2 -1
ajax/agent.php
CHANGED
@@ -92,10 +92,6 @@ function wplc_long_poll_listing() {
|
|
92 |
$chats = TCXChatHelper::update_chat_statuses( $chats );
|
93 |
}
|
94 |
|
95 |
-
$pending = count( array_filter( $chats, function ( $chat ) {
|
96 |
-
return $chat->status == ChatStatus::PENDING_AGENT;
|
97 |
-
} ) ) > 0;
|
98 |
-
|
99 |
$to_update = array();
|
100 |
$to_delete = array();
|
101 |
$to_add = array();
|
@@ -118,6 +114,10 @@ function wplc_long_poll_listing() {
|
|
118 |
}
|
119 |
}
|
120 |
|
|
|
|
|
|
|
|
|
121 |
foreach ( $old_chat_data as $chat_hash ) {
|
122 |
if ( ! in_array( $chat_hash['id'], array_map( function ( $chat ) {
|
123 |
return $chat->id;
|
92 |
$chats = TCXChatHelper::update_chat_statuses( $chats );
|
93 |
}
|
94 |
|
|
|
|
|
|
|
|
|
95 |
$to_update = array();
|
96 |
$to_delete = array();
|
97 |
$to_add = array();
|
114 |
}
|
115 |
}
|
116 |
|
117 |
+
$pending = count( array_filter( $to_add, function ( $chat ) {
|
118 |
+
return $chat->status == ChatStatus::PENDING_AGENT;
|
119 |
+
} ) ) > 0;
|
120 |
+
|
121 |
foreach ( $old_chat_data as $chat_hash ) {
|
122 |
if ( ! in_array( $chat_hash['id'], array_map( function ( $chat ) {
|
123 |
return $chat->id;
|
changelog.txt
CHANGED
@@ -1,3 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
= 9.0.6 - 2020-07-27 =
|
2 |
* Fix bug which appears when visitor had multiple browser tabs with active chat.
|
3 |
* Fix bug "TcxFa is not defined" on websites front end.
|
1 |
+
= 9.0.8 - 2020-07-28 =
|
2 |
+
* Fix bug on display business hours.
|
3 |
+
* Added message on agent's chat view when chat is offline due to business hours settings.
|
4 |
+
* Fix bug on agent's chats list with broken image link.
|
5 |
+
* Fix chat notifications ringtone and browser notification.
|
6 |
+
|
7 |
= 9.0.6 - 2020-07-27 =
|
8 |
* Fix bug which appears when visitor had multiple browser tabs with active chat.
|
9 |
* Fix bug "TcxFa is not defined" on websites front end.
|
config.php
CHANGED
@@ -9,10 +9,10 @@ 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 |
define('WPLC_PLUGIN_DIR', dirname(__FILE__));
|
14 |
define('WPLC_PLUGIN_URL', wplc_plugins_url( '/', __FILE__ ) );
|
15 |
define('WPLC_PLUGIN', plugin_basename( __FILE__ ) );
|
16 |
-
define('WPLC_ACTIVATION_SERVER', 'https://wplc.3cx.net' );
|
17 |
define('WPLC_CHAT_SERVER','https://wplc.3cx.net/api/chatrouter');
|
18 |
define('WPLC_ENABLE_CHANNELS', "wp,mcu,phone" );
|
9 |
|
10 |
define('WPLC_MIN_WP_VERSION', "5.3");
|
11 |
define('WPLC_MIN_PHP_VERSION', "5.4");
|
12 |
+
define('WPLC_PLUGIN_VERSION', "9.0.8");
|
13 |
define('WPLC_PLUGIN_DIR', dirname(__FILE__));
|
14 |
define('WPLC_PLUGIN_URL', wplc_plugins_url( '/', __FILE__ ) );
|
15 |
define('WPLC_PLUGIN', plugin_basename( __FILE__ ) );
|
16 |
+
define('WPLC_ACTIVATION_SERVER', 'https://wplc.3cx.net' );
|
17 |
define('WPLC_CHAT_SERVER','https://wplc.3cx.net/api/chatrouter');
|
18 |
define('WPLC_ENABLE_CHANNELS', "wp,mcu,phone" );
|
includes/wplc_updater.php
CHANGED
@@ -9,9 +9,9 @@ class TCXUpdater {
|
|
9 |
|
10 |
public function __construct() {
|
11 |
$this->wplc_migration_functions = array(
|
12 |
-
"
|
13 |
-
"9.0.
|
14 |
-
"9.0.
|
15 |
);
|
16 |
}
|
17 |
|
@@ -19,41 +19,49 @@ class TCXUpdater {
|
|
19 |
|
20 |
|
21 |
$old_version = get_option( "wplc_current_version", WPLC_PLUGIN_VERSION );
|
22 |
-
if($old_version != WPLC_PLUGIN_VERSION)
|
23 |
-
{
|
24 |
//Already exists a version so we have to skip activation wizard mode.
|
25 |
update_option( "WPLC_SETUP_WIZARD_RUN", true );
|
26 |
}
|
27 |
|
28 |
-
$keys
|
29 |
-
$filtered_keys = array_filter($keys,function ( $key ) use ( $old_version ) {
|
30 |
return version_compare( $key, $old_version ) >= 0;
|
31 |
-
});
|
32 |
uksort( $filtered_keys, "version_compare" );
|
33 |
|
34 |
|
35 |
$filtered_migration_functions = array();
|
36 |
-
foreach ( $filtered_keys as
|
37 |
-
|
38 |
-
$filtered_migration_functions[] = $this->wplc_migration_functions[$key];
|
39 |
}
|
40 |
|
41 |
foreach ( $filtered_migration_functions as $migration_functions ) {
|
42 |
foreach ( $migration_functions as $func ) {
|
43 |
-
$dbSettings
|
44 |
$wplc_settings = $this->$func( $dbSettings, $wplc_settings );
|
45 |
}
|
46 |
}
|
47 |
update_option( "wplc_current_version", WPLC_PLUGIN_VERSION );
|
48 |
}
|
49 |
|
50 |
-
public function wplc_migrate_quick_responses($dbSettings, $wplc_settings) {
|
51 |
|
52 |
global $wpdb;
|
53 |
-
$quick_responses = get_posts( array(
|
54 |
-
|
55 |
-
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
foreach ( $quick_responses as $quick_response ) {
|
58 |
$sort_num = get_post_meta( $quick_response->ID, "wplc_quick_response_number", true );
|
59 |
$quick_response_to_save = new TCXQuickResponse();
|
@@ -64,20 +72,20 @@ class TCXUpdater {
|
|
64 |
$quick_response_to_save->status = $quick_response->post_status == 'publish' ? 1 : 0;
|
65 |
|
66 |
TCXQuickResponsesData::add_quick_response( $wpdb, $quick_response_to_save );
|
67 |
-
wp_delete_post($quick_response->ID,true);
|
68 |
}
|
69 |
if ( post_type_exists( 'wplc_quick_response' ) ) {
|
70 |
unregister_post_type( 'wplc_quick_response' );
|
71 |
}
|
72 |
|
73 |
$users = get_users();
|
74 |
-
foreach($users as $user) {
|
75 |
-
$user->remove_cap("edit_wplc_quick_response");
|
76 |
-
$user->remove_cap("edit_other_wplc_quick_response");
|
77 |
-
$user->remove_cap("publish_wplc_quick_response");
|
78 |
-
$user->remove_cap("read_wplc_quick_response");
|
79 |
-
$user->remove_cap("read_private_wplc_quick_response");
|
80 |
-
$user->remove_cap("delete_wplc_quick_response");
|
81 |
}
|
82 |
|
83 |
return $wplc_settings;
|
@@ -119,8 +127,8 @@ class TCXUpdater {
|
|
119 |
}
|
120 |
|
121 |
$wplc_settings->wplc_channel_url = admin_url( 'admin-ajax.php' );
|
122 |
-
if ( isset( $dbSettings['wplc_use_node_server'] ) && $dbSettings['wplc_use_node_server']==1 ) {
|
123 |
-
$wplc_settings->wplc_channel =
|
124 |
}
|
125 |
|
126 |
if ( isset( $dbSettings['wplc_bh_days'] ) && ! is_array( $dbSettings['wplc_bh_days'] ) ) {
|
@@ -179,10 +187,9 @@ class TCXUpdater {
|
|
179 |
}
|
180 |
}
|
181 |
|
182 |
-
if ( !isset( $dbSettings['wplc_exclude_post_types'] ) || ! is_array( $dbSettings['wplc_exclude_post_types'] ) ) {
|
183 |
$wplc_settings->wplc_exclude_post_types = array();
|
184 |
-
}else
|
185 |
-
{
|
186 |
$wplc_settings->wplc_exclude_post_types = $dbSettings['wplc_exclude_post_types'];
|
187 |
}
|
188 |
|
@@ -202,11 +209,11 @@ class TCXUpdater {
|
|
202 |
$scheduleMigrated = new stdClass();
|
203 |
$scheduleMigrated->code = TCXUtilsHelper::generateRandomString( 6, false );
|
204 |
$scheduleMigrated->from = new stdClass();
|
205 |
-
$scheduleMigrated->from->h = $schedule['hs'];
|
206 |
-
$scheduleMigrated->from->m = $schedule['ms'];
|
207 |
$scheduleMigrated->to = new stdClass();
|
208 |
-
$scheduleMigrated->to->h = $schedule['he'];
|
209 |
-
$scheduleMigrated->to->m = $schedule['me'];
|
210 |
$scheduleResult[ $day ][] = $scheduleMigrated;
|
211 |
}
|
212 |
}
|
@@ -255,30 +262,29 @@ class TCXUpdater {
|
|
255 |
|
256 |
$old_settings = get_option( "WPLC_SETTINGS" );
|
257 |
if ( ! empty( $old_settings ) ) {
|
258 |
-
add_option( "WPLC_JSON_SETTINGS", json_encode( TCXUtilsHelper::convertToArray( $wplc_settings
|
259 |
delete_option( "WPLC_SETTINGS" );
|
260 |
} else {
|
261 |
-
update_option( "WPLC_JSON_SETTINGS", json_encode( TCXUtilsHelper::convertToArray( $wplc_settings),JSON_UNESCAPED_UNICODE
|
262 |
}
|
263 |
|
264 |
$activator = wp_get_current_user();
|
265 |
-
TCXAgentsHelper::set_user_as_agent($activator->ID);
|
266 |
|
267 |
return $wplc_settings;
|
268 |
}
|
269 |
|
270 |
-
public function wplc_migrate_settings_9_0_4($dbSettings, $wplc_settings){
|
271 |
|
272 |
-
if($dbSettings['wplc_channel']==='phone') {
|
273 |
-
$channel_url
|
274 |
-
$url_data
|
275 |
-
$wplc_settings->wplc_files_url =
|
276 |
-
}else
|
277 |
-
|
278 |
-
$wplc_settings->wplc_files_url = WPLC_PLUGIN_URL;
|
279 |
}
|
280 |
|
281 |
-
update_option( "WPLC_JSON_SETTINGS", json_encode( TCXUtilsHelper::convertToArray( $wplc_settings),JSON_UNESCAPED_UNICODE
|
282 |
|
283 |
return $wplc_settings;
|
284 |
}
|
@@ -297,6 +303,7 @@ class TCXUpdater {
|
|
297 |
break;
|
298 |
}
|
299 |
}
|
|
|
300 |
return $wplc_settings;
|
301 |
}
|
302 |
|
@@ -309,6 +316,7 @@ class TCXUpdater {
|
|
309 |
$wplc_settings->wplc_require_user_info = 'none';
|
310 |
}
|
311 |
}
|
|
|
312 |
return $wplc_settings;
|
313 |
}
|
314 |
|
@@ -433,32 +441,59 @@ class TCXUpdater {
|
|
433 |
|
434 |
}
|
435 |
|
436 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
437 |
TCXChatHelper::complete_all_ended_chats();
|
438 |
}
|
439 |
|
440 |
-
public function wplc_set_users_capabilities(){
|
441 |
|
442 |
$admins = get_role( 'administrator' );
|
443 |
if ( $admins !== null ) {
|
444 |
$admins->add_cap( 'wplc_cap_admin' );
|
445 |
-
$admins->add_cap("wplc_cap_show_history");
|
446 |
-
$admins->add_cap("wplc_cap_show_offline");
|
447 |
}
|
448 |
|
449 |
-
$agents=TCXAgentsHelper::get_agent_users();
|
450 |
|
451 |
-
if(count($agents)==0)
|
452 |
-
{
|
453 |
$uid = get_current_user_id();
|
454 |
-
TCXAgentsHelper::set_user_as_agent($uid);
|
455 |
TCXAgentsHelper::set_agent_accepting( $uid, true );
|
456 |
TCXAgentsHelper::update_agent_time( $uid );
|
457 |
-
}else
|
458 |
-
|
459 |
-
|
460 |
-
{
|
461 |
-
TCXAgentsHelper::set_user_as_agent($agent->ID);
|
462 |
}
|
463 |
}
|
464 |
|
9 |
|
10 |
public function __construct() {
|
11 |
$this->wplc_migration_functions = array(
|
12 |
+
"9.0.0" => array( "wplc_migrate_settings_9_0", "migrate_old_user_info", "wplc_cleanup_old_options","wplc_migrate_old_business_hours", "wplc_migrate_quick_responses" ),
|
13 |
+
"9.0.4" => array( "wplc_migrate_settings_9_0_4" ),
|
14 |
+
"9.0.8" => array( "wplc_fix_trailing_zeros_business_hours" )
|
15 |
);
|
16 |
}
|
17 |
|
19 |
|
20 |
|
21 |
$old_version = get_option( "wplc_current_version", WPLC_PLUGIN_VERSION );
|
22 |
+
if ( $old_version != WPLC_PLUGIN_VERSION ) {
|
|
|
23 |
//Already exists a version so we have to skip activation wizard mode.
|
24 |
update_option( "WPLC_SETUP_WIZARD_RUN", true );
|
25 |
}
|
26 |
|
27 |
+
$keys = array_keys( $this->wplc_migration_functions );
|
28 |
+
$filtered_keys = array_filter( $keys, function ( $key ) use ( $old_version ) {
|
29 |
return version_compare( $key, $old_version ) >= 0;
|
30 |
+
} );
|
31 |
uksort( $filtered_keys, "version_compare" );
|
32 |
|
33 |
|
34 |
$filtered_migration_functions = array();
|
35 |
+
foreach ( $filtered_keys as $key ) {
|
36 |
+
$filtered_migration_functions[] = $this->wplc_migration_functions[ $key ];
|
|
|
37 |
}
|
38 |
|
39 |
foreach ( $filtered_migration_functions as $migration_functions ) {
|
40 |
foreach ( $migration_functions as $func ) {
|
41 |
+
$dbSettings = TCXSettings::getDbSettings();
|
42 |
$wplc_settings = $this->$func( $dbSettings, $wplc_settings );
|
43 |
}
|
44 |
}
|
45 |
update_option( "wplc_current_version", WPLC_PLUGIN_VERSION );
|
46 |
}
|
47 |
|
48 |
+
public function wplc_migrate_quick_responses( $dbSettings, $wplc_settings ) {
|
49 |
|
50 |
global $wpdb;
|
51 |
+
$quick_responses = get_posts( array(
|
52 |
+
'post_type' => 'wplc_quick_response',
|
53 |
+
'post_status' => array(
|
54 |
+
'publish',
|
55 |
+
'pending',
|
56 |
+
'draft',
|
57 |
+
'auto-draft',
|
58 |
+
'future',
|
59 |
+
'private',
|
60 |
+
'inherit',
|
61 |
+
'trash'
|
62 |
+
)
|
63 |
+
)
|
64 |
+
);
|
65 |
foreach ( $quick_responses as $quick_response ) {
|
66 |
$sort_num = get_post_meta( $quick_response->ID, "wplc_quick_response_number", true );
|
67 |
$quick_response_to_save = new TCXQuickResponse();
|
72 |
$quick_response_to_save->status = $quick_response->post_status == 'publish' ? 1 : 0;
|
73 |
|
74 |
TCXQuickResponsesData::add_quick_response( $wpdb, $quick_response_to_save );
|
75 |
+
wp_delete_post( $quick_response->ID, true );
|
76 |
}
|
77 |
if ( post_type_exists( 'wplc_quick_response' ) ) {
|
78 |
unregister_post_type( 'wplc_quick_response' );
|
79 |
}
|
80 |
|
81 |
$users = get_users();
|
82 |
+
foreach ( $users as $user ) {
|
83 |
+
$user->remove_cap( "edit_wplc_quick_response" );
|
84 |
+
$user->remove_cap( "edit_other_wplc_quick_response" );
|
85 |
+
$user->remove_cap( "publish_wplc_quick_response" );
|
86 |
+
$user->remove_cap( "read_wplc_quick_response" );
|
87 |
+
$user->remove_cap( "read_private_wplc_quick_response" );
|
88 |
+
$user->remove_cap( "delete_wplc_quick_response" );
|
89 |
}
|
90 |
|
91 |
return $wplc_settings;
|
127 |
}
|
128 |
|
129 |
$wplc_settings->wplc_channel_url = admin_url( 'admin-ajax.php' );
|
130 |
+
if ( isset( $dbSettings['wplc_use_node_server'] ) && $dbSettings['wplc_use_node_server'] == 1 ) {
|
131 |
+
$wplc_settings->wplc_channel = 'mcu';
|
132 |
}
|
133 |
|
134 |
if ( isset( $dbSettings['wplc_bh_days'] ) && ! is_array( $dbSettings['wplc_bh_days'] ) ) {
|
187 |
}
|
188 |
}
|
189 |
|
190 |
+
if ( ! isset( $dbSettings['wplc_exclude_post_types'] ) || ! is_array( $dbSettings['wplc_exclude_post_types'] ) ) {
|
191 |
$wplc_settings->wplc_exclude_post_types = array();
|
192 |
+
} else {
|
|
|
193 |
$wplc_settings->wplc_exclude_post_types = $dbSettings['wplc_exclude_post_types'];
|
194 |
}
|
195 |
|
209 |
$scheduleMigrated = new stdClass();
|
210 |
$scheduleMigrated->code = TCXUtilsHelper::generateRandomString( 6, false );
|
211 |
$scheduleMigrated->from = new stdClass();
|
212 |
+
$scheduleMigrated->from->h = str_pad( $schedule['hs'], 2, "0", STR_PAD_LEFT);
|
213 |
+
$scheduleMigrated->from->m = str_pad( $schedule['ms'], 2, "0", STR_PAD_LEFT);
|
214 |
$scheduleMigrated->to = new stdClass();
|
215 |
+
$scheduleMigrated->to->h = str_pad( $schedule['he'], 2, "0", STR_PAD_LEFT);
|
216 |
+
$scheduleMigrated->to->m = str_pad( $schedule['me'], 2, "0", STR_PAD_LEFT);
|
217 |
$scheduleResult[ $day ][] = $scheduleMigrated;
|
218 |
}
|
219 |
}
|
262 |
|
263 |
$old_settings = get_option( "WPLC_SETTINGS" );
|
264 |
if ( ! empty( $old_settings ) ) {
|
265 |
+
add_option( "WPLC_JSON_SETTINGS", json_encode( TCXUtilsHelper::convertToArray( $wplc_settings ), JSON_UNESCAPED_UNICODE ) );
|
266 |
delete_option( "WPLC_SETTINGS" );
|
267 |
} else {
|
268 |
+
update_option( "WPLC_JSON_SETTINGS", json_encode( TCXUtilsHelper::convertToArray( $wplc_settings ), JSON_UNESCAPED_UNICODE ) );
|
269 |
}
|
270 |
|
271 |
$activator = wp_get_current_user();
|
272 |
+
TCXAgentsHelper::set_user_as_agent( $activator->ID );
|
273 |
|
274 |
return $wplc_settings;
|
275 |
}
|
276 |
|
277 |
+
public function wplc_migrate_settings_9_0_4( $dbSettings, $wplc_settings ) {
|
278 |
|
279 |
+
if ( $dbSettings['wplc_channel'] === 'phone' ) {
|
280 |
+
$channel_url = $dbSettings['wplc_channel_url'] . '#' . $dbSettings['wplc_chat_party'];
|
281 |
+
$url_data = TCXUtilsHelper::wplc_parse_click2callUrl( $channel_url );
|
282 |
+
$wplc_settings->wplc_files_url = $url_data['files_url'];
|
283 |
+
} else {
|
284 |
+
$wplc_settings->wplc_files_url = WPLC_PLUGIN_URL;
|
|
|
285 |
}
|
286 |
|
287 |
+
update_option( "WPLC_JSON_SETTINGS", json_encode( TCXUtilsHelper::convertToArray( $wplc_settings ), JSON_UNESCAPED_UNICODE ) );
|
288 |
|
289 |
return $wplc_settings;
|
290 |
}
|
303 |
break;
|
304 |
}
|
305 |
}
|
306 |
+
|
307 |
return $wplc_settings;
|
308 |
}
|
309 |
|
316 |
$wplc_settings->wplc_require_user_info = 'none';
|
317 |
}
|
318 |
}
|
319 |
+
|
320 |
return $wplc_settings;
|
321 |
}
|
322 |
|
441 |
|
442 |
}
|
443 |
|
444 |
+
private function wplc_fix_trailing_zeros_business_hours($dbSettings, $wplc_settings){
|
445 |
+
// this update function exists just to fix faulty business hours settings created by upgrade from 8.X to 9.X (till 9.0.7)
|
446 |
+
// that's why we are doing the job using only $wplc_settings
|
447 |
+
//
|
448 |
+
$result = array();
|
449 |
+
foreach($dbSettings['wplc_bh_schedule'] as $day => $daySchedules)
|
450 |
+
{
|
451 |
+
$result[$day] = array();
|
452 |
+
if(is_array($daySchedules) || is_object($daySchedules)) {
|
453 |
+
foreach ( $daySchedules as $index => $schedule ) {
|
454 |
+
$new_schedule = new stdClass();
|
455 |
+
$new_schedule->from = new stdClass();
|
456 |
+
$new_schedule->to = new stdClass();
|
457 |
+
$new_schedule->code = TCXUtilsHelper::generateRandomString( 6, false );
|
458 |
+
$new_schedule->from->h = str_pad( $schedule['from']['h'], 2, "0", STR_PAD_LEFT );
|
459 |
+
$new_schedule->from->m = str_pad( $schedule['from']['m'], 2, "0", STR_PAD_LEFT );
|
460 |
+
|
461 |
+
$new_schedule->to->h = str_pad( $schedule['to']['h'], 2, "0", STR_PAD_LEFT );
|
462 |
+
$new_schedule->to->m = str_pad( $schedule['to']['m'], 2, "0", STR_PAD_LEFT );
|
463 |
+
$result[ $day ][ $index ] = $new_schedule;
|
464 |
+
}
|
465 |
+
}
|
466 |
+
}
|
467 |
+
|
468 |
+
$wplc_settings->wplc_bh_schedule = $result;
|
469 |
+
update_option( "WPLC_JSON_SETTINGS", json_encode( TCXUtilsHelper::convertToArray( $wplc_settings ), JSON_UNESCAPED_UNICODE ) );
|
470 |
+
|
471 |
+
return $wplc_settings;
|
472 |
+
}
|
473 |
+
|
474 |
+
public function wplc_complete_existing_chats() {
|
475 |
TCXChatHelper::complete_all_ended_chats();
|
476 |
}
|
477 |
|
478 |
+
public function wplc_set_users_capabilities() {
|
479 |
|
480 |
$admins = get_role( 'administrator' );
|
481 |
if ( $admins !== null ) {
|
482 |
$admins->add_cap( 'wplc_cap_admin' );
|
483 |
+
$admins->add_cap( "wplc_cap_show_history" );
|
484 |
+
$admins->add_cap( "wplc_cap_show_offline" );
|
485 |
}
|
486 |
|
487 |
+
$agents = TCXAgentsHelper::get_agent_users();
|
488 |
|
489 |
+
if ( count( $agents ) == 0 ) {
|
|
|
490 |
$uid = get_current_user_id();
|
491 |
+
TCXAgentsHelper::set_user_as_agent( $uid );
|
492 |
TCXAgentsHelper::set_agent_accepting( $uid, true );
|
493 |
TCXAgentsHelper::update_agent_time( $uid );
|
494 |
+
} else {
|
495 |
+
foreach ( $agents as $agent ) {
|
496 |
+
TCXAgentsHelper::set_user_as_agent( $agent->ID );
|
|
|
|
|
497 |
}
|
498 |
}
|
499 |
|
modules/activation_wizard/activation_wizard_controller.php
CHANGED
@@ -172,7 +172,7 @@ class ActivationWizardController extends BaseController {
|
|
172 |
$this->view_data["preview_component"] = new ChatClientController( "chat-preview", "preview_view" );
|
173 |
$this->view_data["steps"] = $this->load_steps();
|
174 |
$this->view_data["saveUrl"] = admin_url( "admin.php?page=wplc-getting-started&wplc_action=save_activation_settings&nonce=" . wp_create_nonce( "saveActivationSettings" ) );
|
175 |
-
|
176 |
return $this->load_view( plugin_dir_path( __FILE__ ) . "activation_wizard_view.php", $return_html, $add_wrapper );
|
177 |
}
|
178 |
}
|
172 |
$this->view_data["preview_component"] = new ChatClientController( "chat-preview", "preview_view" );
|
173 |
$this->view_data["steps"] = $this->load_steps();
|
174 |
$this->view_data["saveUrl"] = admin_url( "admin.php?page=wplc-getting-started&wplc_action=save_activation_settings&nonce=" . wp_create_nonce( "saveActivationSettings" ) );
|
175 |
+
$this->view_data["active_channels"] = count(explode(',',str_replace('wp,','',WPLC_ENABLE_CHANNELS) ));
|
176 |
return $this->load_view( plugin_dir_path( __FILE__ ) . "activation_wizard_view.php", $return_html, $add_wrapper );
|
177 |
}
|
178 |
}
|
modules/activation_wizard/wizard_partials/channel_selection.php
CHANGED
@@ -1,32 +1,11 @@
|
|
1 |
<h2 class="wplc_wizard_title">Channel Selection</h2>
|
2 |
<div class="row">
|
3 |
<div class="col-12
|
4 |
-
offset-lg-<?= (12-(4
|
5 |
-
offset-md-<?= (12-(6
|
6 |
-
offset-sm-<?= (12-(12
|
7 |
-
offset-xs-<?= (12-(12
|
8 |
<div class="row">
|
9 |
-
<?php if ( in_array( 'wp', explode(',',WPLC_ENABLE_CHANNELS ) ) ) { ?>
|
10 |
-
<div class="channel-card col-lg-4 col-md-6 col-sm-12 col-xs-12">
|
11 |
-
<div class="box-part text-center" data-channel="wp"><i class="fas fa-server" aria-hidden="true"></i>
|
12 |
-
<div class="title">
|
13 |
-
<h3>On-Premise</h3>
|
14 |
-
</div>
|
15 |
-
<div class="text">
|
16 |
-
<span>
|
17 |
-
<ul>
|
18 |
-
<li><i class="fa fa-check"></i><?= __("High use of WP site resources.", "wp-live-chat-support")?></li>
|
19 |
-
<li><i class="fa fa-check"></i><?= __("Suitable for small websites.", "wp-live-chat-support")?></li>
|
20 |
-
<li><i class="fa fa-check"></i><?= __("Agents must log in to respond to chats.", "wp-live-chat-support")?></li>
|
21 |
-
<li><i class="fa fa-check"></i><?= __("Slower chat delivery and reception.", "wp-live-chat-support")?></li>
|
22 |
-
<li><i class="fa fa-check"></i><?= __("Your site is your chat server.", "wp-live-chat-support")?></li>
|
23 |
-
<li><i class="fa fa-check"></i><?= __("No reports or apps", "wp-live-chat-support")?></li>
|
24 |
-
</ul>
|
25 |
-
</span>
|
26 |
-
</div>
|
27 |
-
</div>
|
28 |
-
</div>
|
29 |
-
<?php } ?>
|
30 |
<?php if ( in_array( 'mcu', explode(',',WPLC_ENABLE_CHANNELS ) ) ) { ?>
|
31 |
<div class="channel-card col-lg-4 col-md-6 col-sm-12 col-xs-12">
|
32 |
<div class="box-part text-center" data-channel="mcu"><i class="fas fa-cloud" aria-hidden="true"></i>
|
1 |
<h2 class="wplc_wizard_title">Channel Selection</h2>
|
2 |
<div class="row">
|
3 |
<div class="col-12
|
4 |
+
offset-lg-<?= (12-(4*$active_channels))/2?>
|
5 |
+
offset-md-<?= (12-(6*$active_channels))/2?>
|
6 |
+
offset-sm-<?= (12-(12*$active_channels))/2?>
|
7 |
+
offset-xs-<?= (12-(12*$active_channels))/2?>">
|
8 |
<div class="row">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
<?php if ( in_array( 'mcu', explode(',',WPLC_ENABLE_CHANNELS ) ) ) { ?>
|
10 |
<div class="channel-card col-lg-4 col-md-6 col-sm-12 col-xs-12">
|
11 |
<div class="box-part text-center" data-channel="mcu"><i class="fas fa-cloud" aria-hidden="true"></i>
|
modules/activation_wizard/wizard_partials/invite_agents.php
CHANGED
@@ -27,15 +27,11 @@
|
|
27 |
</div>
|
28 |
</div>
|
29 |
<div class="form-row">
|
30 |
-
<div class="form-group col-md-4">
|
31 |
<label class="col-form-label" for="AgentCheck">Agent</label>
|
32 |
<input type="radio" name="agentEntry[1][AgentRole]" id="agentEntry_1_AgentCheck" value="agent" checked>
|
33 |
</div>
|
34 |
-
<div class="form-group col-md-4">
|
35 |
-
<label class="col-form-label" for="ManagerCheck">Manager</label>
|
36 |
-
<input type="radio" name="agentEntry[1][AgentRole]" id="agentEntry_1_ManagerCheck" value="manager">
|
37 |
-
</div>
|
38 |
-
<div class="form-group col-md-4">
|
39 |
<label class="col-form-label" for="AdminCheck">Admin</label>
|
40 |
<input type="radio" name="agentEntry[1][AgentRole]" id="agentEntry_1_AdminCheck" value="admin">
|
41 |
</div>
|
@@ -94,15 +90,11 @@
|
|
94 |
</div>
|
95 |
</div>
|
96 |
<div class="form-row">
|
97 |
-
<div class="form-group col-md-4">
|
98 |
<label class="col-form-label" for="Temp3">Agent</label>
|
99 |
<input type="radio" disabled name="AgentRole" id="Temp3" data-array-id="AgentCheck" data-maintain-name="true" value="agent" checked>
|
100 |
</div>
|
101 |
-
<div class="form-group col-md-4">
|
102 |
-
<label class="col-form-label" for="Temp4">Manager</label>
|
103 |
-
<input type="radio" disabled name="AgentRole" id="Temp4" data-array-id="ManagerCheck" data-maintain-name="true" value="manager">
|
104 |
-
</div>
|
105 |
-
<div class="form-group col-md-4">
|
106 |
<label class="col-form-label" for="Temp5">Admin</label>
|
107 |
<input type="radio" disabled name="AgentRole" id="Temp5" data-array-id="AdminCheck" data-maintain-name="true" value="admin">
|
108 |
</div>
|
27 |
</div>
|
28 |
</div>
|
29 |
<div class="form-row">
|
30 |
+
<div style="text-align: center;" class="form-group col-md-4 offset-md-2">
|
31 |
<label class="col-form-label" for="AgentCheck">Agent</label>
|
32 |
<input type="radio" name="agentEntry[1][AgentRole]" id="agentEntry_1_AgentCheck" value="agent" checked>
|
33 |
</div>
|
34 |
+
<div style="text-align: center;" class="form-group col-md-4">
|
|
|
|
|
|
|
|
|
35 |
<label class="col-form-label" for="AdminCheck">Admin</label>
|
36 |
<input type="radio" name="agentEntry[1][AgentRole]" id="agentEntry_1_AdminCheck" value="admin">
|
37 |
</div>
|
90 |
</div>
|
91 |
</div>
|
92 |
<div class="form-row">
|
93 |
+
<div style="text-align: center;" class="form-group col-md-4 offset-md-2">
|
94 |
<label class="col-form-label" for="Temp3">Agent</label>
|
95 |
<input type="radio" disabled name="AgentRole" id="Temp3" data-array-id="AgentCheck" data-maintain-name="true" value="agent" checked>
|
96 |
</div>
|
97 |
+
<div style="text-align: center;" class="form-group col-md-4">
|
|
|
|
|
|
|
|
|
98 |
<label class="col-form-label" for="Temp5">Admin</label>
|
99 |
<input type="radio" disabled name="AgentRole" id="Temp5" data-array-id="AdminCheck" data-maintain-name="true" value="admin">
|
100 |
</div>
|
modules/agent_chat/agent_chat_page.php
CHANGED
@@ -122,7 +122,8 @@ function wplc_localize_agent_chat_js() {
|
|
122 |
"show_time" => $wplc_settings->wplc_show_time,
|
123 |
"show_name" => $wplc_settings->wplc_show_name,
|
124 |
"show_avatar" => $wplc_settings->wplc_show_avatar,
|
125 |
-
"wplc_protocol" => ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] ) ? 'https' : 'http'
|
|
|
126 |
);
|
127 |
|
128 |
if ( TCXAgentsHelper::is_agent_accepting( get_current_user_id() ) ) {
|
122 |
"show_time" => $wplc_settings->wplc_show_time,
|
123 |
"show_name" => $wplc_settings->wplc_show_name,
|
124 |
"show_avatar" => $wplc_settings->wplc_show_avatar,
|
125 |
+
"wplc_protocol" => ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] ) ? 'https' : 'http',
|
126 |
+
"wplc_not_business_hours" =>$wplc_settings->wplc_settings_enabled == 1 && !TCXUtilsHelper::wplc_check_chatbox_enabled_business_hours(),
|
127 |
);
|
128 |
|
129 |
if ( TCXAgentsHelper::is_agent_accepting( get_current_user_id() ) ) {
|
modules/agent_chat/agent_chat_style.css
CHANGED
@@ -532,6 +532,7 @@ img {
|
|
532 |
word-wrap: break-word;
|
533 |
}
|
534 |
|
|
|
535 |
#wplc_chat_offline,
|
536 |
#wplc_no_chats {
|
537 |
display: flex;
|
532 |
word-wrap: break-word;
|
533 |
}
|
534 |
|
535 |
+
#wplc_bh_chat_offline,
|
536 |
#wplc_chat_offline,
|
537 |
#wplc_no_chats {
|
538 |
display: flex;
|
modules/agent_chat/agent_chat_view.php
CHANGED
@@ -6,13 +6,6 @@
|
|
6 |
<img src="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/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plc-chat-box-notification wplc-chat-box-notification--disabled"
|
11 |
-
style="display:<?= ! $wplc_settings->wplc_settings_enabled ? 'block' : 'none' ?>">
|
12 |
-
<p><?= __( 'The Live Chat box is currently disabled on your website due to:', 'wp-livechat' ) ?>
|
13 |
-
<a href="<?= admin_url( 'admin.php?page=wplivechat-menu-settings#wplc-business-hours' ) ?>"><?= __( 'Business Hours Settings', 'wp-livechat' ) ?></a>
|
14 |
-
</p>
|
15 |
-
</div>
|
16 |
</div>
|
17 |
</div>
|
18 |
<div class="bootstrap-wplc-content" id="wplc_agent_chat">
|
@@ -159,5 +152,18 @@
|
|
159 |
</div>
|
160 |
</div>
|
161 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
</div>
|
163 |
</div>
|
6 |
<img src="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAABkAAD/4QMvaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzE0MiA3OS4xNjA5MjQsIDIwMTcvMDcvMTMtMDE6MDY6MzkgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvY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rkt0/Lg+lA1zUNAKoNC5E6fxhvlzHDEVFjOguB9gehQ+cRsCOhxV1tGUBRY8D76rAZ2UllCBVZzyPy4qtdvueJaIlj5ypB0pHT/X/AP/aAAgBAwMBPxD+zbVewK0FqkkIiEWEd6aMO4IZwAI40h+Tfb0nZa8gtkVuM1YqtufQSEepRHL/AD4K5eitKO1CSRbqCbNHfMk4vBf1wqbu+x/LB99YDTbHDvnmck1Z9gYWj/jTBsEYXBXSQNZaeTZug+vlxkbJuC0uIUSGMWYIctv6X11MjN1QXkAAdAIAAHqXkFlIXgsBxTDsYLfBiVCXAWNCOADSpeN/36Exn6gqgVpwBoUC8GI4G9X/AHaf4M69EzAZmheRime1RQX4wBGhV7IDUgF2Mji4gAQdLTawTVIUQz/xDAEAHuENFEAwkYU2wBsH+v8A/9k="
|
7 |
align="middle">
|
8 |
<h2>WP Live Chat by 3CX</h2>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
</div>
|
10 |
</div>
|
11 |
<div class="bootstrap-wplc-content" id="wplc_agent_chat">
|
152 |
</div>
|
153 |
</div>
|
154 |
</div>
|
155 |
+
<div id="wplc_bh_chat_offline" style="display:none">
|
156 |
+
<div class="card border-warning mb-3" >
|
157 |
+
<div class="card-body text-warning">
|
158 |
+
<h5 class="card-title">Out of business hours</h5>
|
159 |
+
<p class="card-text">
|
160 |
+
<?= __( 'The Live Chat box is currently disabled on your website due to:', 'wp-livechat' ) ?>
|
161 |
+
<a href="<?= admin_url( 'admin.php?page=wplivechat-menu-settings#wplc-business-hours' ) ?>"><?= __( 'Business Hours Settings', 'wp-livechat' ) ?></a>
|
162 |
+
</p>
|
163 |
+
</div>
|
164 |
+
</div>
|
165 |
+
</div>
|
166 |
+
|
167 |
+
|
168 |
</div>
|
169 |
</div>
|
modules/agent_chat/js/agent_chat.js
CHANGED
@@ -3,9 +3,7 @@ var my_chats = [];
|
|
3 |
var current_chats = {};
|
4 |
var active_chat = -1;
|
5 |
var wplc_poll_list_run = true;
|
6 |
-
var ringer_cnt = 0;
|
7 |
var ringer_count = 0;
|
8 |
-
var wplc_new_chat_ringer_dismissed = false;
|
9 |
var orig_title = document.getElementsByTagName("title")[0].innerHTML;
|
10 |
var polling_xhr = null;
|
11 |
var poll_timer = null;
|
@@ -17,7 +15,6 @@ jQuery(function () {
|
|
17 |
window.location = localization_data.chat_list_url + (jQuery(this).val() !== "0" ? "&wplc_department_view=" + jQuery(this).val() : "");
|
18 |
});
|
19 |
|
20 |
-
|
21 |
jQuery("body").on("click", "#wplc_admin_join_chat", function (event) {
|
22 |
|
23 |
jQuery("#wplc_join_chat").hide();
|
@@ -40,24 +37,19 @@ jQuery(function () {
|
|
40 |
|
41 |
jQuery("body").trigger("openChat", active_chat);
|
42 |
jQuery("#wplc_chat_messages").html("");
|
43 |
-
if(!my_chats.includes(active_chat)) {
|
44 |
jQuery("#wplc_chat_messages").hide();
|
45 |
jQuery("#wplc_join_chat").show();
|
46 |
-
}else
|
47 |
-
{
|
48 |
jQuery("body").trigger("joinChat", active_chat);
|
49 |
}
|
50 |
}
|
51 |
});
|
52 |
|
53 |
-
wplc_set_chat_status(localization_data.agent_accepts_data);
|
54 |
-
|
55 |
jQuery("body").on("changeAgentOnline", function (e, isOnline) {
|
56 |
wplc_set_chat_status(isOnline);
|
57 |
});
|
58 |
|
59 |
-
setInterval(wplc_update_time_elapsed, 1000 * 60);
|
60 |
-
|
61 |
jQuery("#wplc_assigned_only").on("change", function (e) {
|
62 |
active_filters.only_assigned = jQuery(this).prop("checked");
|
63 |
apply_chat_list_filters();
|
@@ -68,6 +60,10 @@ jQuery(function () {
|
|
68 |
apply_chat_list_filters();
|
69 |
});
|
70 |
|
|
|
|
|
|
|
|
|
71 |
//generate_date_diff_string( start_time )
|
72 |
|
73 |
});
|
@@ -93,7 +89,20 @@ function apply_chat_list_filters() {
|
|
93 |
|
94 |
function wplc_set_chat_status(isOnline) {
|
95 |
localization_data.agent_accepts_data = isOnline;
|
96 |
-
if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
wplc_set_chat_panel_ui();
|
98 |
jQuery("#wplc_chat_offline").hide();
|
99 |
wplc_setup_chat_listing();
|
@@ -112,8 +121,8 @@ function wplc_set_chat_status(isOnline) {
|
|
112 |
}
|
113 |
}
|
114 |
|
115 |
-
function wplc_set_chat_panel_ui(){
|
116 |
-
if (jQuery('[id^=wplc_chat_cont]').length==0) {
|
117 |
jQuery("#wplc_chat_panel").hide();
|
118 |
jQuery("#wplc_no_chats").show();
|
119 |
} else {
|
@@ -126,14 +135,14 @@ function wplc_set_chat_panel_ui(){
|
|
126 |
|
127 |
function wplc_setup_chat_listing() {
|
128 |
if (localization_data.channel === 'mcu') {
|
129 |
-
var pendingStatuses = [2,6];
|
130 |
jQuery("body").unbind('mcu-chat-list-add');
|
131 |
jQuery("body").unbind('mcu-chat-list-update');
|
132 |
jQuery("body").unbind('mcu-chat-list-remove');
|
133 |
jQuery("body").on('mcu-chat-list-add', function (e, data) {
|
134 |
-
var chatData ={};
|
135 |
chatData[data.chatID] = {
|
136 |
-
agent_id:data.agentID,
|
137 |
name: data.name,
|
138 |
email: data.email,
|
139 |
browser: data.browser,
|
@@ -146,15 +155,14 @@ function wplc_setup_chat_listing() {
|
|
146 |
};
|
147 |
|
148 |
wplc_add_chat_list_item(chatData);
|
149 |
-
if(pendingStatuses.includes(data.status)
|
150 |
-
{
|
151 |
wplc_notify_agent();
|
152 |
}
|
153 |
});
|
154 |
jQuery("body").on('mcu-chat-list-update', function (e, data) {
|
155 |
-
var chatData ={};
|
156 |
chatData[data.chatID] = {
|
157 |
-
agent_id:data.agentID,
|
158 |
name: data.name,
|
159 |
email: data.email,
|
160 |
browser: data.browser,
|
@@ -167,13 +175,12 @@ function wplc_setup_chat_listing() {
|
|
167 |
};
|
168 |
|
169 |
wplc_update_chat_list_item(chatData);
|
170 |
-
if(pendingStatuses.includes(data.status)
|
171 |
-
{
|
172 |
wplc_notify_agent();
|
173 |
}
|
174 |
});
|
175 |
jQuery("body").on('mcu-chat-list-remove', function (e, data) {
|
176 |
-
var chatData ={};
|
177 |
chatData[data.chatID] = data.chatID;
|
178 |
wplc_remove_chat_list_item(chatData);
|
179 |
});
|
@@ -225,17 +232,8 @@ function wplc_activate_listing_long_poll(data = null) {
|
|
225 |
return {hash: chat.hash, id: chat.id};
|
226 |
});
|
227 |
|
228 |
-
|
229 |
if (response.Data['pending'] === true) {
|
230 |
-
|
231 |
wplc_notify_agent();
|
232 |
-
wplc_pending_refresh = setInterval(function () {
|
233 |
-
|
234 |
-
wplc_notify_agent();
|
235 |
-
}, 5000);
|
236 |
-
} else {
|
237 |
-
clearInterval(wplc_pending_refresh);
|
238 |
-
ringer_cnt = 0;
|
239 |
}
|
240 |
}
|
241 |
} else {
|
@@ -282,29 +280,31 @@ function wplc_notify_agent() {
|
|
282 |
limit = parseInt(localization_data.ringer_count.value);
|
283 |
}
|
284 |
|
285 |
-
|
286 |
if (typeof localization_data.ringtone !== 'undefined') {
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
}
|
294 |
}, 3000);
|
295 |
}
|
296 |
-
} else {
|
297 |
-
wplc_new_chat_ringer_dismissed = true; //Set it to dismissed now
|
298 |
-
}
|
299 |
-
}
|
300 |
-
|
301 |
-
|
302 |
-
if (ringer_cnt <= 0) {
|
303 |
-
wplc_desktop_notification();
|
304 |
}
|
305 |
-
ringer_cnt++;
|
306 |
|
307 |
-
if (ringer_cnt > 1) {
|
308 |
clearInterval(wplc_pending_refresh);
|
309 |
wplc_title_alerts4 = setTimeout(function () {
|
310 |
document.title = orig_title;
|
@@ -312,13 +312,13 @@ function wplc_notify_agent() {
|
|
312 |
return;
|
313 |
}
|
314 |
|
315 |
-
|
316 |
wplc_title_alerts2 = setTimeout(function () {
|
317 |
document.title = "** CHAT REQUEST **";
|
318 |
}, 2000);
|
319 |
wplc_title_alerts4 = setTimeout(function () {
|
320 |
document.title = orig_title;
|
321 |
-
}, 4000)
|
322 |
|
323 |
|
324 |
}
|
@@ -421,7 +421,7 @@ function wplc_get_chat_status_element(cid, status, state) {
|
|
421 |
return result;
|
422 |
}
|
423 |
|
424 |
-
function wplc_create_chat_list_element(chat,addContainer) {
|
425 |
|
426 |
var v_agent = chat['agent_id'];
|
427 |
|
@@ -431,7 +431,7 @@ function wplc_create_chat_list_element(chat,addContainer) {
|
|
431 |
var v_country = '';
|
432 |
var v_country_image = '';
|
433 |
|
434 |
-
if (typeof chat['country'] != 'undefined' && chat['country'] !== null) {
|
435 |
v_country = chat['country']['name'];
|
436 |
v_country_image = chat['country']['image'];
|
437 |
}
|
@@ -444,8 +444,8 @@ function wplc_create_chat_list_element(chat,addContainer) {
|
|
444 |
// var v_status_class = wplc_get_chat_status_class(parseInt(v_status), parseInt(chat['state']));
|
445 |
var v_available_for_chat = wplc_is_chat_active(parseInt(v_status));
|
446 |
|
447 |
-
var avatarName = wplc_isDoubleByte(v_name)?'Visitor':v_name;
|
448 |
-
var gravatarSource = "//www.gravatar.com/avatar/" + md5(v_email) + "?s=64&d="+encodeURIComponent(localization_data.wplc_protocol+"://ui-avatars.com/api/" + avatarName + "/64/" + wplc_stringToColor(v_name) + "/fff")
|
449 |
var email_link = "";
|
450 |
if (v_email && v_email != 'no email set') {
|
451 |
email_link = "<a href='mailto:" + v_email + "'>" + v_email + "</a> "
|
@@ -461,8 +461,8 @@ function wplc_create_chat_list_element(chat,addContainer) {
|
|
461 |
|
462 |
var hide_element = (active_filters.only_assigned && v_agent != localization_data.user_id) || (active_filters.hide_browsing && v_status == 5);
|
463 |
|
464 |
-
var test_list_html = addContainer ? '<div id="wplc_chat_cont' + chat['id'] + '" style="display: ' + (hide_element ? 'none' : 'block') + ';" >':'';
|
465 |
-
|
466 |
test_list_html += '<div class="chat_people">';
|
467 |
test_list_html += ' <div class="chat_img"><img src="' + gravatarSource + '" alt="sunil"></div>';
|
468 |
test_list_html += ' <div class="chat_ib">';
|
@@ -493,24 +493,22 @@ function wplc_update_chat_list(update, obj) {
|
|
493 |
function wplc_update_chat_list_item(items) {
|
494 |
Object.keys(items).forEach(function (chatID) {
|
495 |
var current_id = parseInt(chatID);
|
496 |
-
if(items[current_id].agent_id === localization_data.user_id && !my_chats.includes(current_id)){
|
497 |
my_chats.push(current_id);
|
498 |
-
}
|
|
|
499 |
jQuery("#wplc_p_ul_" + current_id).remove();
|
500 |
var chatContainer = jQuery("#wplc_chat_cont" + current_id);
|
501 |
-
var wplc_v_html = wplc_create_chat_list_element(items[current_id],chatContainer.length===0);
|
502 |
wplc_notify_mcu_status_changes(items[current_id]);
|
503 |
-
var endedStatuses = [
|
504 |
-
if(endedStatuses.includes(items[current_id].status) && current_id == active_chat && !my_chats.includes(current_id)
|
505 |
-
{
|
506 |
wplc_change_chat_status(false);
|
507 |
}
|
508 |
|
509 |
-
if(chatContainer.length>0)
|
510 |
-
{
|
511 |
chatContainer.append(wplc_v_html);
|
512 |
-
}
|
513 |
-
else {
|
514 |
jQuery("#wplc_chat_list").append(wplc_v_html);
|
515 |
}
|
516 |
});
|
@@ -520,17 +518,16 @@ function wplc_update_chat_list_item(items) {
|
|
520 |
function wplc_add_chat_list_item(items) {
|
521 |
Object.keys(items).forEach(function (chatID) {
|
522 |
var current_id = parseInt(chatID);
|
523 |
-
if(items[current_id].agent_id ===localization_data.user_id && !my_chats.includes(current_id)){
|
524 |
my_chats.push(current_id);
|
525 |
-
}
|
|
|
526 |
|
527 |
var chatContainer = jQuery("#wplc_chat_cont" + current_id);
|
528 |
-
var wplc_v_html = wplc_create_chat_list_element(items[current_id],chatContainer.length===0);
|
529 |
-
if(chatContainer.length>0)
|
530 |
-
{
|
531 |
chatContainer.append(wplc_v_html);
|
532 |
-
}
|
533 |
-
else {
|
534 |
jQuery("#wplc_chat_list").append(wplc_v_html);
|
535 |
}
|
536 |
});
|
@@ -547,10 +544,10 @@ function wplc_remove_chat_list_item(items) {
|
|
547 |
}
|
548 |
|
549 |
function wplc_generate_date_diff_string(start_time) {
|
550 |
-
start_time = start_time.indexOf('+')<0 && start_time.indexOf('Z')<0 ?
|
551 |
var date_start = new Date(start_time);
|
552 |
var now = new Date();
|
553 |
-
var cur_time = now.getTime()
|
554 |
var time_start = date_start.getTime();
|
555 |
|
556 |
var time_elapsed = (cur_time - time_start) / 1000;
|
3 |
var current_chats = {};
|
4 |
var active_chat = -1;
|
5 |
var wplc_poll_list_run = true;
|
|
|
6 |
var ringer_count = 0;
|
|
|
7 |
var orig_title = document.getElementsByTagName("title")[0].innerHTML;
|
8 |
var polling_xhr = null;
|
9 |
var poll_timer = null;
|
15 |
window.location = localization_data.chat_list_url + (jQuery(this).val() !== "0" ? "&wplc_department_view=" + jQuery(this).val() : "");
|
16 |
});
|
17 |
|
|
|
18 |
jQuery("body").on("click", "#wplc_admin_join_chat", function (event) {
|
19 |
|
20 |
jQuery("#wplc_join_chat").hide();
|
37 |
|
38 |
jQuery("body").trigger("openChat", active_chat);
|
39 |
jQuery("#wplc_chat_messages").html("");
|
40 |
+
if (!my_chats.includes(active_chat)) {
|
41 |
jQuery("#wplc_chat_messages").hide();
|
42 |
jQuery("#wplc_join_chat").show();
|
43 |
+
} else {
|
|
|
44 |
jQuery("body").trigger("joinChat", active_chat);
|
45 |
}
|
46 |
}
|
47 |
});
|
48 |
|
|
|
|
|
49 |
jQuery("body").on("changeAgentOnline", function (e, isOnline) {
|
50 |
wplc_set_chat_status(isOnline);
|
51 |
});
|
52 |
|
|
|
|
|
53 |
jQuery("#wplc_assigned_only").on("change", function (e) {
|
54 |
active_filters.only_assigned = jQuery(this).prop("checked");
|
55 |
apply_chat_list_filters();
|
60 |
apply_chat_list_filters();
|
61 |
});
|
62 |
|
63 |
+
|
64 |
+
wplc_set_chat_status(localization_data.agent_accepts_data);
|
65 |
+
setInterval(wplc_update_time_elapsed, 1000 * 60);
|
66 |
+
|
67 |
//generate_date_diff_string( start_time )
|
68 |
|
69 |
});
|
89 |
|
90 |
function wplc_set_chat_status(isOnline) {
|
91 |
localization_data.agent_accepts_data = isOnline;
|
92 |
+
if(localization_data.wplc_not_business_hours)
|
93 |
+
{
|
94 |
+
jQuery("#wplc_no_chats").hide();
|
95 |
+
jQuery("#wplc_chat_offline").hide();
|
96 |
+
jQuery("#wplc_bh_chat_offline").show();
|
97 |
+
if (polling_xhr != null) {
|
98 |
+
polling_xhr.abort();
|
99 |
+
clearTimeout(poll_timer);
|
100 |
+
}
|
101 |
+
if (localization_data.channel === 'mcu') {
|
102 |
+
jQuery("body").trigger('mcu-close-socket');
|
103 |
+
}
|
104 |
+
}
|
105 |
+
else if (isOnline) {
|
106 |
wplc_set_chat_panel_ui();
|
107 |
jQuery("#wplc_chat_offline").hide();
|
108 |
wplc_setup_chat_listing();
|
121 |
}
|
122 |
}
|
123 |
|
124 |
+
function wplc_set_chat_panel_ui() {
|
125 |
+
if (jQuery('[id^=wplc_chat_cont]').length == 0) {
|
126 |
jQuery("#wplc_chat_panel").hide();
|
127 |
jQuery("#wplc_no_chats").show();
|
128 |
} else {
|
135 |
|
136 |
function wplc_setup_chat_listing() {
|
137 |
if (localization_data.channel === 'mcu') {
|
138 |
+
var pendingStatuses = [2, 6];
|
139 |
jQuery("body").unbind('mcu-chat-list-add');
|
140 |
jQuery("body").unbind('mcu-chat-list-update');
|
141 |
jQuery("body").unbind('mcu-chat-list-remove');
|
142 |
jQuery("body").on('mcu-chat-list-add', function (e, data) {
|
143 |
+
var chatData = {};
|
144 |
chatData[data.chatID] = {
|
145 |
+
agent_id: data.agentID,
|
146 |
name: data.name,
|
147 |
email: data.email,
|
148 |
browser: data.browser,
|
155 |
};
|
156 |
|
157 |
wplc_add_chat_list_item(chatData);
|
158 |
+
if (pendingStatuses.includes(data.status)) {
|
|
|
159 |
wplc_notify_agent();
|
160 |
}
|
161 |
});
|
162 |
jQuery("body").on('mcu-chat-list-update', function (e, data) {
|
163 |
+
var chatData = {};
|
164 |
chatData[data.chatID] = {
|
165 |
+
agent_id: data.agentID,
|
166 |
name: data.name,
|
167 |
email: data.email,
|
168 |
browser: data.browser,
|
175 |
};
|
176 |
|
177 |
wplc_update_chat_list_item(chatData);
|
178 |
+
if (pendingStatuses.includes(data.status)) {
|
|
|
179 |
wplc_notify_agent();
|
180 |
}
|
181 |
});
|
182 |
jQuery("body").on('mcu-chat-list-remove', function (e, data) {
|
183 |
+
var chatData = {};
|
184 |
chatData[data.chatID] = data.chatID;
|
185 |
wplc_remove_chat_list_item(chatData);
|
186 |
});
|
232 |
return {hash: chat.hash, id: chat.id};
|
233 |
});
|
234 |
|
|
|
235 |
if (response.Data['pending'] === true) {
|
|
|
236 |
wplc_notify_agent();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
}
|
238 |
}
|
239 |
} else {
|
280 |
limit = parseInt(localization_data.ringer_count.value);
|
281 |
}
|
282 |
|
|
|
283 |
if (typeof localization_data.ringtone !== 'undefined') {
|
284 |
+
|
285 |
+
if(wplc_pending_refresh === null) {
|
286 |
+
wplc_pending_refresh = setInterval(function () {
|
287 |
+
new Audio(localization_data.ringtone).play();
|
288 |
+
ringer_count++
|
289 |
+
if (ringer_count == 1) {
|
290 |
+
wplc_desktop_notification();
|
291 |
+
|
292 |
+
}
|
293 |
+
if (ringer_count >= limit) {
|
294 |
+
|
295 |
+
clearInterval(wplc_pending_refresh);
|
296 |
+
wplc_pending_refresh = null;
|
297 |
+
ringer_count = 0;
|
298 |
+
document.title = "** CHAT REQUEST **";
|
299 |
+
setTimeout(function () {
|
300 |
+
document.title = orig_title;
|
301 |
+
}, 4000);
|
302 |
}
|
303 |
}, 3000);
|
304 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
305 |
}
|
|
|
306 |
|
307 |
+
/*if (ringer_cnt > 1) {
|
308 |
clearInterval(wplc_pending_refresh);
|
309 |
wplc_title_alerts4 = setTimeout(function () {
|
310 |
document.title = orig_title;
|
312 |
return;
|
313 |
}
|
314 |
|
315 |
+
|
316 |
wplc_title_alerts2 = setTimeout(function () {
|
317 |
document.title = "** CHAT REQUEST **";
|
318 |
}, 2000);
|
319 |
wplc_title_alerts4 = setTimeout(function () {
|
320 |
document.title = orig_title;
|
321 |
+
}, 4000);*/
|
322 |
|
323 |
|
324 |
}
|
421 |
return result;
|
422 |
}
|
423 |
|
424 |
+
function wplc_create_chat_list_element(chat, addContainer) {
|
425 |
|
426 |
var v_agent = chat['agent_id'];
|
427 |
|
431 |
var v_country = '';
|
432 |
var v_country_image = '';
|
433 |
|
434 |
+
if (typeof chat['country'] != 'undefined' && chat['country'] !== null && typeof chat['country']['name']!== 'undefined' && chat['country']['image']!== 'undefined' ) {
|
435 |
v_country = chat['country']['name'];
|
436 |
v_country_image = chat['country']['image'];
|
437 |
}
|
444 |
// var v_status_class = wplc_get_chat_status_class(parseInt(v_status), parseInt(chat['state']));
|
445 |
var v_available_for_chat = wplc_is_chat_active(parseInt(v_status));
|
446 |
|
447 |
+
var avatarName = wplc_isDoubleByte(v_name) ? 'Visitor' : v_name;
|
448 |
+
var gravatarSource = "//www.gravatar.com/avatar/" + md5(v_email) + "?s=64&d=" + encodeURIComponent(localization_data.wplc_protocol + "://ui-avatars.com/api/" + avatarName + "/64/" + wplc_stringToColor(v_name) + "/fff")
|
449 |
var email_link = "";
|
450 |
if (v_email && v_email != 'no email set') {
|
451 |
email_link = "<a href='mailto:" + v_email + "'>" + v_email + "</a> "
|
461 |
|
462 |
var hide_element = (active_filters.only_assigned && v_agent != localization_data.user_id) || (active_filters.hide_browsing && v_status == 5);
|
463 |
|
464 |
+
var test_list_html = addContainer ? '<div id="wplc_chat_cont' + chat['id'] + '" style="display: ' + (hide_element ? 'none' : 'block') + ';" >' : '';
|
465 |
+
test_list_html += '<div class="chat_list wplc_p_cul ' + ' ' + (active_chat == chat['id'] ? 'active_chat' : '') + '" id="wplc_p_ul_' + chat['id'] + '" data-cid="' + chat['id'] + '" data-sid="' + chat['session'] + '" data-enable="' + v_available_for_chat + '" data-aid="' + v_agent + '" data-status ="' + v_status + '">';
|
466 |
test_list_html += '<div class="chat_people">';
|
467 |
test_list_html += ' <div class="chat_img"><img src="' + gravatarSource + '" alt="sunil"></div>';
|
468 |
test_list_html += ' <div class="chat_ib">';
|
493 |
function wplc_update_chat_list_item(items) {
|
494 |
Object.keys(items).forEach(function (chatID) {
|
495 |
var current_id = parseInt(chatID);
|
496 |
+
if (items[current_id].agent_id === localization_data.user_id && !my_chats.includes(current_id)) {
|
497 |
my_chats.push(current_id);
|
498 |
+
}
|
499 |
+
;
|
500 |
jQuery("#wplc_p_ul_" + current_id).remove();
|
501 |
var chatContainer = jQuery("#wplc_chat_cont" + current_id);
|
502 |
+
var wplc_v_html = wplc_create_chat_list_element(items[current_id], chatContainer.length === 0);
|
503 |
wplc_notify_mcu_status_changes(items[current_id]);
|
504 |
+
var endedStatuses = [0, 1, 13, 14, 15, 16, 4, 8, 9, 12, 3];
|
505 |
+
if (endedStatuses.includes(items[current_id].status) && current_id == active_chat && !my_chats.includes(current_id)) {
|
|
|
506 |
wplc_change_chat_status(false);
|
507 |
}
|
508 |
|
509 |
+
if (chatContainer.length > 0) {
|
|
|
510 |
chatContainer.append(wplc_v_html);
|
511 |
+
} else {
|
|
|
512 |
jQuery("#wplc_chat_list").append(wplc_v_html);
|
513 |
}
|
514 |
});
|
518 |
function wplc_add_chat_list_item(items) {
|
519 |
Object.keys(items).forEach(function (chatID) {
|
520 |
var current_id = parseInt(chatID);
|
521 |
+
if (items[current_id].agent_id === localization_data.user_id && !my_chats.includes(current_id)) {
|
522 |
my_chats.push(current_id);
|
523 |
+
}
|
524 |
+
;
|
525 |
|
526 |
var chatContainer = jQuery("#wplc_chat_cont" + current_id);
|
527 |
+
var wplc_v_html = wplc_create_chat_list_element(items[current_id], chatContainer.length === 0);
|
528 |
+
if (chatContainer.length > 0) {
|
|
|
529 |
chatContainer.append(wplc_v_html);
|
530 |
+
} else {
|
|
|
531 |
jQuery("#wplc_chat_list").append(wplc_v_html);
|
532 |
}
|
533 |
});
|
544 |
}
|
545 |
|
546 |
function wplc_generate_date_diff_string(start_time) {
|
547 |
+
start_time = start_time.indexOf('+') < 0 && start_time.indexOf('Z') < 0 ? start_time + ' +0000' : start_time;
|
548 |
var date_start = new Date(start_time);
|
549 |
var now = new Date();
|
550 |
+
var cur_time = now.getTime();
|
551 |
var time_start = date_start.getTime();
|
552 |
|
553 |
var time_elapsed = (cur_time - time_start) / 1000;
|
modules/settings/js/settings.js
CHANGED
@@ -251,7 +251,7 @@ function renderBhSchedules() {
|
|
251 |
jQuery(this).on("click", function (e) {
|
252 |
var elementToDelete = jQuery(this);
|
253 |
var indexToRemove = bh_schedules[elementToDelete.data('weekday')].findIndex(function (item) {
|
254 |
-
return item.code === elementToDelete.data('code');
|
255 |
})
|
256 |
bh_schedules[elementToDelete.data('weekday')].splice(indexToRemove, 1);
|
257 |
renderBhSchedules();
|
251 |
jQuery(this).on("click", function (e) {
|
252 |
var elementToDelete = jQuery(this);
|
253 |
var indexToRemove = bh_schedules[elementToDelete.data('weekday')].findIndex(function (item) {
|
254 |
+
return parseInt(item.code) === parseInt(elementToDelete.data('code'));
|
255 |
})
|
256 |
bh_schedules[elementToDelete.data('weekday')].splice(indexToRemove, 1);
|
257 |
renderBhSchedules();
|
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.
|
8 |
License: GPLv2
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
Text Domain: wp-live-chat-support
|
@@ -97,11 +97,12 @@ We use UI Avatars to generate user and agent avatars within the live chat enviro
|
|
97 |
We use sounds directly from notification sounds to generate audio notifications for the chat environment of WP-Live Chat by 3CX. The audio file is called directly from the site. Additionally some notification sounds have been downloaded from the site and added directly inside the plugin folder structure for local access purposes. Notification Sounds Privacy Policy: https://notificationsounds.com/privacy-policy
|
98 |
|
99 |
|
100 |
-
|
101 |
= Translations =
|
102 |
|
103 |
* English (3CX Team)
|
104 |
* Italian (3CX Team)
|
|
|
|
|
105 |
|
106 |
== Installation ==
|
107 |
|
@@ -158,6 +159,13 @@ If the live chat box still does not appear on your website, please go through th
|
|
158 |
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.
|
159 |
|
160 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
= 9.0.6 - 2020-07-27 =
|
162 |
* Fix bug which appears when visitor had multiple active tabs with active chat.
|
163 |
* Fix bug "TcxFa is not defined" on websites front end.
|
4 |
Requires at least: 5.3
|
5 |
Tested up to: 5.4.2
|
6 |
Requires PHP: 5.4
|
7 |
+
Stable tag: 9.0.8
|
8 |
License: GPLv2
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
Text Domain: wp-live-chat-support
|
97 |
We use sounds directly from notification sounds to generate audio notifications for the chat environment of WP-Live Chat by 3CX. The audio file is called directly from the site. Additionally some notification sounds have been downloaded from the site and added directly inside the plugin folder structure for local access purposes. Notification Sounds Privacy Policy: https://notificationsounds.com/privacy-policy
|
98 |
|
99 |
|
|
|
100 |
= Translations =
|
101 |
|
102 |
* English (3CX Team)
|
103 |
* Italian (3CX Team)
|
104 |
+
* Hebrew (strelok89)
|
105 |
+
* Korean (taehwilee)
|
106 |
|
107 |
== Installation ==
|
108 |
|
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 |
+
|
163 |
+
= 9.0.8 - 2020-07-28 =
|
164 |
+
* Fix bug on display business hours.
|
165 |
+
* Added message on agent's chat view when chat is offline due to business hours settings.
|
166 |
+
* Fix bug on agent's chats list with broken image link.
|
167 |
+
* Fix chat notifications ringtone and browser notification.
|
168 |
+
|
169 |
= 9.0.6 - 2020-07-27 =
|
170 |
* Fix bug which appears when visitor had multiple active tabs with active chat.
|
171 |
* Fix bug "TcxFa is not defined" on websites front end.
|
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.
|
7 |
Author: 3CX
|
8 |
Author URI: https://www.3cx.com/wp-live-chat/
|
9 |
Domain Path: /languages
|
@@ -162,6 +162,7 @@ function wplc_uninstall() {
|
|
162 |
'WPLC_V8_FIRST_TIME',
|
163 |
'WPLC_JSON_SETTINGS',
|
164 |
'WPLC_SETUP_WIZARD_RUN',
|
|
|
165 |
);
|
166 |
|
167 |
foreach ( $options as $option ) {
|
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.8
|
7 |
Author: 3CX
|
8 |
Author URI: https://www.3cx.com/wp-live-chat/
|
9 |
Domain Path: /languages
|
162 |
'WPLC_V8_FIRST_TIME',
|
163 |
'WPLC_JSON_SETTINGS',
|
164 |
'WPLC_SETUP_WIZARD_RUN',
|
165 |
+
'WPLC_CM_SESSION_CHECK'
|
166 |
);
|
167 |
|
168 |
foreach ( $options as $option ) {
|