Version Description
= 8.1.x = 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.
Download this release
Release Info
Developer | WP-LiveChat |
Plugin | WP Live Chat Support |
Version | 8.1.7 |
Comparing to | |
See all releases |
Code changes from version 8.1.6 to 8.1.7
- changelog.txt +7 -0
- config.php +1 -1
- functions.php +68 -76
- js/wplc_history.js +8 -0
- js/wplc_node.js +4 -6
- js/wplc_pro_features.js +1 -1
- js/wplc_u_pro.js +7 -8
- modules/advanced_features.php +6 -0
- readme.txt +6 -4
- wp-live-chat-support.php +23 -16
changelog.txt
CHANGED
@@ -1,3 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
= 8.1.6 - 2020-01-16 =
|
2 |
* Bugfix: more optimizations to avoid lots of 403 errors when PHP session expires
|
3 |
* Bugfix: custom style color picker adds an extra # breaking color code
|
1 |
+
= 8.1.7 - 2020-02-05 =
|
2 |
+
* Bugfix: added some missing translation strings
|
3 |
+
* Bugfix: HTML email body in auto responder not parsed correctly
|
4 |
+
* Improvement: added "Debug mode", extra logs added to PHP error log
|
5 |
+
* Improvement: reduced ajax requests footprint, removing unneeded fields
|
6 |
+
* Improvement: added confirmation for history delete
|
7 |
+
|
8 |
= 8.1.6 - 2020-01-16 =
|
9 |
* Bugfix: more optimizations to avoid lots of 403 errors when PHP session expires
|
10 |
* Bugfix: custom style color picker adds an extra # breaking color code
|
config.php
CHANGED
@@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
7 |
exit;
|
8 |
}
|
9 |
|
10 |
-
define('WPLC_PLUGIN_VERSION', "8.1.
|
11 |
define('WPLC_PLUGIN_DIR', dirname(__FILE__));
|
12 |
define('WPLC_PLUGIN_URL', plugins_url( '/', __FILE__ ) );
|
13 |
define('WPLC_PLUGIN', plugin_basename( __FILE__ ) );
|
7 |
exit;
|
8 |
}
|
9 |
|
10 |
+
define('WPLC_PLUGIN_VERSION', "8.1.7");
|
11 |
define('WPLC_PLUGIN_DIR', dirname(__FILE__));
|
12 |
define('WPLC_PLUGIN_URL', plugins_url( '/', __FILE__ ) );
|
13 |
define('WPLC_PLUGIN', plugin_basename( __FILE__ ) );
|
functions.php
CHANGED
@@ -283,7 +283,11 @@ function wplc_return_chat_id_by_rel_or_id($rel) {
|
|
283 |
}
|
284 |
}
|
285 |
}
|
286 |
-
|
|
|
|
|
|
|
|
|
287 |
return 0;
|
288 |
}
|
289 |
|
@@ -992,72 +996,54 @@ function wplc_return_status($status) {
|
|
992 |
add_filter("wplc_filter_mail_body","wplc_filter_control_mail_body",10,2);
|
993 |
function wplc_filter_control_mail_body($header,$msg) {
|
994 |
$primary_bg_color = apply_filters("wplc_mailer_bg_color", "#0596d4"); //Default orange
|
995 |
-
$body = '
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
<table id="" border="0" cellpadding="0" cellspacing="0" width="100%" style="font-family: sans-serif;">
|
1004 |
-
<tbody>
|
1005 |
-
<tr>
|
1006 |
-
<td width="100%" style="padding: 30px 20px 100px 20px;">
|
1007 |
-
<table cellpadding="0" cellspacing="0" class="" width="100%" style="border-collapse: separate;">
|
1008 |
-
<tbody>
|
1009 |
-
<tr>
|
1010 |
-
<td style="padding-bottom: 20px;">
|
1011 |
-
|
1012 |
-
<p>'.$header.'</p>
|
1013 |
-
<hr>
|
1014 |
-
</td>
|
1015 |
-
</tr>
|
1016 |
-
</tbody>
|
1017 |
-
</table>
|
1018 |
-
|
1019 |
-
<table id="" cellpadding="0" cellspacing="0" class="" width="100%" style="border-collapse: separate; font-size: 14px;">
|
1020 |
<tbody>
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
</
|
1026 |
-
</
|
1027 |
-
</
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
</
|
1055 |
-
</
|
1056 |
-
|
1057 |
-
|
1058 |
}
|
1059 |
|
1060 |
-
|
1061 |
add_filter("wplc_mailer_bg_color","wplc_fitler_mailer_bg_color",10,1);
|
1062 |
function wplc_fitler_mailer_bg_color($default_color) {
|
1063 |
$wplc_settings = wplc_get_options();
|
@@ -1697,7 +1683,10 @@ function wplc_return_chat_rel_by_id($cid) {
|
|
1697 |
}
|
1698 |
}
|
1699 |
}
|
1700 |
-
|
|
|
|
|
|
|
1701 |
return null;
|
1702 |
}
|
1703 |
|
@@ -1705,7 +1694,7 @@ function wplc_all_avatars() {
|
|
1705 |
$users = wplc_get_agent_users();
|
1706 |
$avatars = array();
|
1707 |
foreach ($users as $user) {
|
1708 |
-
$avatars[$user->
|
1709 |
}
|
1710 |
return $avatars;
|
1711 |
}
|
@@ -1714,15 +1703,15 @@ function wplc_get_avatar($id) {
|
|
1714 |
$wplc_settings = wplc_get_options();
|
1715 |
$user = get_user_by( 'id', $id );
|
1716 |
if ($wplc_settings['wplc_avatar_source'] == 'gravatar') {
|
1717 |
-
return '//www.gravatar.com/avatar/' . md5( strtolower( trim( $user->
|
1718 |
} elseif ($wplc_settings['wplc_avatar_source'] == 'wp_avatar') {
|
1719 |
if (function_exists('get_wp_user_avatar')) {
|
1720 |
return get_wp_user_avatar_src($id);
|
1721 |
} else {
|
1722 |
-
return '//www.gravatar.com/avatar/' . md5( strtolower( trim( $user->
|
1723 |
}
|
1724 |
} else {
|
1725 |
-
return '//www.gravatar.com/avatar/' . md5( strtolower( trim( $user->
|
1726 |
}
|
1727 |
}
|
1728 |
|
@@ -3811,7 +3800,7 @@ function return_statistics_mrg(){
|
|
3811 |
foreach( $agent_totals as $key => $val ){
|
3812 |
$user = get_user_by( 'id', intval( $key ) );
|
3813 |
if( $user ){
|
3814 |
-
$display_name = $user->
|
3815 |
} else {
|
3816 |
$display_name = '';
|
3817 |
}
|
@@ -3905,7 +3894,7 @@ function wplc_filter_control_admin_from_mrg($content, $cid, $chat_data = false)
|
|
3905 |
if ($wplc_settings['wplc_use_wp_name']) {
|
3906 |
$user_object = get_user_by("id", $chat_data->agent_id);
|
3907 |
if (is_object($user_object)) {
|
3908 |
-
$content = $user_object->
|
3909 |
}
|
3910 |
}
|
3911 |
}
|
@@ -3951,8 +3940,7 @@ function wplc_auto_responder_activate_mrg(){
|
|
3951 |
$wplc_data['wplc_ar_from_name'] = get_bloginfo( 'name' );
|
3952 |
$wplc_data['wplc_ar_from_email'] = get_bloginfo( 'admin_email' );
|
3953 |
$wplc_data['wplc_ar_subject'] = __("Thank you for inquiry. We will get back to you shortly", 'wp-live-chat-support');
|
3954 |
-
$wplc_data['wplc_ar_body'] = "
|
3955 |
-
<p>Hi {wplc-user-name}</p>
|
3956 |
<p>Thank you for getting in touch with us.</p>
|
3957 |
<p>Your email has been received. We will get back to you shortly.</p>
|
3958 |
";
|
@@ -4009,7 +3997,7 @@ function wplc_offline_message_autoresponder_mrg( $data ){
|
|
4009 |
if (!empty($wplc_ar_from_name) && !empty($wplc_ar_from_email)) {
|
4010 |
$headers[] = 'Reply-To: '.$wplc_ar_from_name.' <'.$wplc_ar_from_email.'>';
|
4011 |
}
|
4012 |
-
$overbody = apply_filters("wplc_filter_mail_body",$wplc_ar_subject, htmlspecialchars_decode(
|
4013 |
if (!wp_mail($wplc_user_email, $wplc_ar_subject, $overbody, $headers)) {
|
4014 |
$error = date("Y-m-d H:i:s") . " WP-Mail Failed to send \n";
|
4015 |
error_log($error);
|
@@ -4030,7 +4018,7 @@ function wplc_auto_responder_settings_mrg(){
|
|
4030 |
if (isset($_POST['wplc_ar_from_name'])) { $wplc_data['wplc_ar_from_name'] = stripslashes(sanitize_text_field($_POST['wplc_ar_from_name'])); }
|
4031 |
if (isset($_POST['wplc_ar_from_email'])) { $wplc_data['wplc_ar_from_email'] = filter_var(sanitize_text_field($_POST['wplc_ar_from_email']), FILTER_SANITIZE_EMAIL); }
|
4032 |
if (isset($_POST['wplc_ar_subject'])) { $wplc_data['wplc_ar_subject'] = stripslashes(sanitize_text_field($_POST['wplc_ar_subject'])); }
|
4033 |
-
if (isset($_POST['wplc_ar_body'])) { $wplc_data['wplc_ar_body'] = stripslashes(
|
4034 |
|
4035 |
update_option( "WPLC_AUTO_RESPONDER_SETTINGS", $wplc_data );
|
4036 |
|
@@ -4884,9 +4872,13 @@ function wplc_internal_get_all_agents_users_online() {
|
|
4884 |
$agents = array();
|
4885 |
}
|
4886 |
foreach($agents as $agent) {
|
|
|
|
|
|
|
|
|
4887 |
$check = get_user_meta($agent->ID, "wplc_chat_agent_online");
|
4888 |
if ($check && $check[0] && time()-$check[0]<120) {
|
4889 |
-
$result[]=$
|
4890 |
} else {
|
4891 |
delete_user_meta($agent->ID, "wplc_chat_agent_online"); // force offline
|
4892 |
}
|
283 |
}
|
284 |
}
|
285 |
}
|
286 |
+
|
287 |
+
$wplc_settings = wplc_get_options();
|
288 |
+
if ($wplc_settings['wplc_debug_mode']) {
|
289 |
+
error_log('wplc_return_chat_id_by_rel_or_id cannot find rel='.$rel);
|
290 |
+
}
|
291 |
return 0;
|
292 |
}
|
293 |
|
996 |
add_filter("wplc_filter_mail_body","wplc_filter_control_mail_body",10,2);
|
997 |
function wplc_filter_control_mail_body($header,$msg) {
|
998 |
$primary_bg_color = apply_filters("wplc_mailer_bg_color", "#0596d4"); //Default orange
|
999 |
+
$body = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
1000 |
+
<html>
|
1001 |
+
<body>
|
1002 |
+
<table id="" border="0" cellpadding="0" cellspacing="0" width="100%" style="font-family: sans-serif;">
|
1003 |
+
<tbody>
|
1004 |
+
<tr>
|
1005 |
+
<td width="100%" style="padding: 30px 20px 100px 20px;">
|
1006 |
+
<table cellpadding="0" cellspacing="0" class="" width="100%" style="border-collapse: separate;">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1007 |
<tbody>
|
1008 |
+
<tr>
|
1009 |
+
<td style="padding-bottom: 20px;">
|
1010 |
+
<p>'.$header.'</p>
|
1011 |
+
<hr>
|
1012 |
+
</td>
|
1013 |
+
</tr>
|
1014 |
+
</tbody>
|
1015 |
+
</table>
|
1016 |
+
<table id="" cellpadding="0" cellspacing="0" class="" width="100%" style="border-collapse: separate; font-size: 14px;">
|
1017 |
+
<tbody>
|
1018 |
+
<tr>
|
1019 |
+
<td class="sortable-list ui-sortable">'.nl2br($msg).'</td>
|
1020 |
+
</tr>
|
1021 |
+
</tbody>
|
1022 |
+
</table>
|
1023 |
+
<table cellpadding="0" cellspacing="0" class="" width="100%" style="border-collapse: separate; max-width:100%;">
|
1024 |
+
<tbody>
|
1025 |
+
<tr>
|
1026 |
+
<td style="padding-top:20px;">
|
1027 |
+
<table border="0" cellpadding="0" cellspacing="0" class="" width="100%">
|
1028 |
+
<tbody>
|
1029 |
+
<tr>
|
1030 |
+
<td id=""><p>'.site_url().'</p></td>
|
1031 |
+
</tr>
|
1032 |
+
</tbody>
|
1033 |
+
</table>
|
1034 |
+
</td>
|
1035 |
+
</tr>
|
1036 |
+
</tbody>
|
1037 |
+
</table>
|
1038 |
+
</td>
|
1039 |
+
</tr>
|
1040 |
+
</tbody>
|
1041 |
+
</table>
|
1042 |
+
</body>
|
1043 |
+
</html>';
|
1044 |
+
return $body;
|
1045 |
}
|
1046 |
|
|
|
1047 |
add_filter("wplc_mailer_bg_color","wplc_fitler_mailer_bg_color",10,1);
|
1048 |
function wplc_fitler_mailer_bg_color($default_color) {
|
1049 |
$wplc_settings = wplc_get_options();
|
1683 |
}
|
1684 |
}
|
1685 |
}
|
1686 |
+
$wplc_settings = wplc_get_options();
|
1687 |
+
if ($wplc_settings['wplc_debug_mode']) {
|
1688 |
+
error_log('wplc_return_chat_rel_by_id cannot find rel for id='.$cid);
|
1689 |
+
}
|
1690 |
return null;
|
1691 |
}
|
1692 |
|
1694 |
$users = wplc_get_agent_users();
|
1695 |
$avatars = array();
|
1696 |
foreach ($users as $user) {
|
1697 |
+
$avatars[$user->ID] = wplc_get_avatar($user->ID);
|
1698 |
}
|
1699 |
return $avatars;
|
1700 |
}
|
1703 |
$wplc_settings = wplc_get_options();
|
1704 |
$user = get_user_by( 'id', $id );
|
1705 |
if ($wplc_settings['wplc_avatar_source'] == 'gravatar') {
|
1706 |
+
return '//www.gravatar.com/avatar/' . md5( strtolower( trim( $user->user_email ) ) );
|
1707 |
} elseif ($wplc_settings['wplc_avatar_source'] == 'wp_avatar') {
|
1708 |
if (function_exists('get_wp_user_avatar')) {
|
1709 |
return get_wp_user_avatar_src($id);
|
1710 |
} else {
|
1711 |
+
return '//www.gravatar.com/avatar/' . md5( strtolower( trim( $user->user_email ) ) );
|
1712 |
}
|
1713 |
} else {
|
1714 |
+
return '//www.gravatar.com/avatar/' . md5( strtolower( trim( $user->user_email ) ) );
|
1715 |
}
|
1716 |
}
|
1717 |
|
3800 |
foreach( $agent_totals as $key => $val ){
|
3801 |
$user = get_user_by( 'id', intval( $key ) );
|
3802 |
if( $user ){
|
3803 |
+
$display_name = $user->display_name;
|
3804 |
} else {
|
3805 |
$display_name = '';
|
3806 |
}
|
3894 |
if ($wplc_settings['wplc_use_wp_name']) {
|
3895 |
$user_object = get_user_by("id", $chat_data->agent_id);
|
3896 |
if (is_object($user_object)) {
|
3897 |
+
$content = $user_object->display_name;
|
3898 |
}
|
3899 |
}
|
3900 |
}
|
3940 |
$wplc_data['wplc_ar_from_name'] = get_bloginfo( 'name' );
|
3941 |
$wplc_data['wplc_ar_from_email'] = get_bloginfo( 'admin_email' );
|
3942 |
$wplc_data['wplc_ar_subject'] = __("Thank you for inquiry. We will get back to you shortly", 'wp-live-chat-support');
|
3943 |
+
$wplc_data['wplc_ar_body'] = "<p>Hi {wplc-user-name}</p>
|
|
|
3944 |
<p>Thank you for getting in touch with us.</p>
|
3945 |
<p>Your email has been received. We will get back to you shortly.</p>
|
3946 |
";
|
3997 |
if (!empty($wplc_ar_from_name) && !empty($wplc_ar_from_email)) {
|
3998 |
$headers[] = 'Reply-To: '.$wplc_ar_from_name.' <'.$wplc_ar_from_email.'>';
|
3999 |
}
|
4000 |
+
$overbody = apply_filters("wplc_filter_mail_body",$wplc_ar_subject, htmlspecialchars_decode($wplc_ar_body));
|
4001 |
if (!wp_mail($wplc_user_email, $wplc_ar_subject, $overbody, $headers)) {
|
4002 |
$error = date("Y-m-d H:i:s") . " WP-Mail Failed to send \n";
|
4003 |
error_log($error);
|
4018 |
if (isset($_POST['wplc_ar_from_name'])) { $wplc_data['wplc_ar_from_name'] = stripslashes(sanitize_text_field($_POST['wplc_ar_from_name'])); }
|
4019 |
if (isset($_POST['wplc_ar_from_email'])) { $wplc_data['wplc_ar_from_email'] = filter_var(sanitize_text_field($_POST['wplc_ar_from_email']), FILTER_SANITIZE_EMAIL); }
|
4020 |
if (isset($_POST['wplc_ar_subject'])) { $wplc_data['wplc_ar_subject'] = stripslashes(sanitize_text_field($_POST['wplc_ar_subject'])); }
|
4021 |
+
if (isset($_POST['wplc_ar_body'])) { $wplc_data['wplc_ar_body'] = wp_kses_post(stripslashes($_POST['wplc_ar_body'])); }
|
4022 |
|
4023 |
update_option( "WPLC_AUTO_RESPONDER_SETTINGS", $wplc_data );
|
4024 |
|
4872 |
$agents = array();
|
4873 |
}
|
4874 |
foreach($agents as $agent) {
|
4875 |
+
$nagent=(object) array();
|
4876 |
+
$nagent->ID=$agent->ID;
|
4877 |
+
$nagent->display_name=$agent->display_name;
|
4878 |
+
$nagent->user_email=$agent->user_email;
|
4879 |
$check = get_user_meta($agent->ID, "wplc_chat_agent_online");
|
4880 |
if ($check && $check[0] && time()-$check[0]<120) {
|
4881 |
+
$result[]=$nagent;
|
4882 |
} else {
|
4883 |
delete_user_meta($agent->ID, "wplc_chat_agent_online"); // force offline
|
4884 |
}
|
js/wplc_history.js
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function($) {
|
2 |
+
|
3 |
+
jQuery("#wplc-delete-chat-history").click(function(e) {
|
4 |
+
e.preventDefault();
|
5 |
+
return confirm(tcx_messages.historydeleteconfirm);
|
6 |
+
});
|
7 |
+
|
8 |
+
});
|
js/wplc_node.js
CHANGED
@@ -353,9 +353,8 @@ jQuery(document).on('wplc_sockets_ready', function() {
|
|
353 |
// End user's session
|
354 |
var sdata = { cid: wplc_cid };
|
355 |
wplc_rest_api('end_session', sdata, 12000, null);
|
356 |
-
|
357 |
jQuery("#tcx_chat_ended").show();
|
358 |
-
tcx_end_chat_div_create();
|
359 |
//$("#wplc_user_message_div").hide();
|
360 |
|
361 |
if (typeof user_heartbeat !== "undefined") {
|
@@ -1404,14 +1403,13 @@ function tcxConfirmDelivery(msgID, msgObject) {
|
|
1404 |
/**
|
1405 |
* Create the end chat div, which holds the restart chat button
|
1406 |
*/
|
1407 |
-
function tcx_end_chat_div_create() {
|
1408 |
jQuery('<a/>', {
|
1409 |
'class': 'tcx_restart_chat',
|
1410 |
href: "javascript:void(0);",
|
1411 |
-
title:
|
1412 |
-
html:
|
1413 |
}).appendTo('#tcx_chat_ended');
|
1414 |
-
|
1415 |
}
|
1416 |
|
1417 |
/**
|
353 |
// End user's session
|
354 |
var sdata = { cid: wplc_cid };
|
355 |
wplc_rest_api('end_session', sdata, 12000, null);
|
|
|
356 |
jQuery("#tcx_chat_ended").show();
|
357 |
+
tcx_end_chat_div_create(wplc_strings.restart_chat, wplc_strings.restart_chat);
|
358 |
//$("#wplc_user_message_div").hide();
|
359 |
|
360 |
if (typeof user_heartbeat !== "undefined") {
|
1403 |
/**
|
1404 |
* Create the end chat div, which holds the restart chat button
|
1405 |
*/
|
1406 |
+
function tcx_end_chat_div_create(title, html) {
|
1407 |
jQuery('<a/>', {
|
1408 |
'class': 'tcx_restart_chat',
|
1409 |
href: "javascript:void(0);",
|
1410 |
+
title: title,
|
1411 |
+
html: html
|
1412 |
}).appendTo('#tcx_chat_ended');
|
|
|
1413 |
}
|
1414 |
|
1415 |
/**
|
js/wplc_pro_features.js
CHANGED
@@ -200,7 +200,7 @@ function wplcShareFile(fileToUpload, failedID, successID, uploadingID, originalI
|
|
200 |
jQuery(failedID).hide();
|
201 |
if (fileToUpload.name.match(new RegExp('^.*\\.(' + config.allowed_upload_extensions + ')$','i'))) {
|
202 |
// Files allowed - continue
|
203 |
-
if (fileToUpload.size <
|
204 |
jQuery.ajax({
|
205 |
url : wplc_ajaxurl_site,
|
206 |
type : 'POST',
|
200 |
jQuery(failedID).hide();
|
201 |
if (fileToUpload.name.match(new RegExp('^.*\\.(' + config.allowed_upload_extensions + ')$','i'))) {
|
202 |
// Files allowed - continue
|
203 |
+
if (fileToUpload.size < 4*1024*1024) { //Max size of 4MB
|
204 |
jQuery.ajax({
|
205 |
url : wplc_ajaxurl_site,
|
206 |
type : 'POST',
|
js/wplc_u_pro.js
CHANGED
@@ -534,13 +534,12 @@ jQuery(function() {
|
|
534 |
var wplc_name = jQuery("#wplc_name").val().replace(/(<([^>]+)>)/ig, "");
|
535 |
var wplc_email = jQuery("#wplc_email").val().replace(/(<([^>]+)>)/ig, "");
|
536 |
|
537 |
-
|
538 |
if (jQuery("#wplc_email").attr('wplc_hide') !== "1") {
|
539 |
-
if (wplc_name.length <= 0) { alert(
|
540 |
-
if (wplc_email.length <= 0) { alert(
|
541 |
var testEmail = /^[A-Z0-9._%+-]+@([A-Z0-9-]+\.)+[A-Z]{2,4}$/i;
|
542 |
if (!testEmail.test(wplc_email)) {
|
543 |
-
alert(
|
544 |
return false;
|
545 |
}
|
546 |
}
|
@@ -597,14 +596,14 @@ jQuery(function() {
|
|
597 |
var wplc_domain = jQuery("#wplc_domain_offline").val();
|
598 |
var ip_address = jQuery("#wplc_ip_address").val();
|
599 |
|
600 |
-
if (wplc_name.length <= 0) { alert(
|
601 |
-
if (wplc_email.length <= 0) { alert(
|
602 |
var testEmail = /^[A-Z0-9._%+-]+@([A-Z0-9-]+\.)+[A-Z]{2,4}$/i;
|
603 |
if (!testEmail.test(wplc_email)) {
|
604 |
-
alert(
|
605 |
return false;
|
606 |
}
|
607 |
-
if (wplc_msg.length <= 0) { alert(
|
608 |
// jQuery("#wp-live-chat-2-info").hide();
|
609 |
jQuery("#wplc_message_div").html(wplc_offline_msg);
|
610 |
|
534 |
var wplc_name = jQuery("#wplc_name").val().replace(/(<([^>]+)>)/ig, "");
|
535 |
var wplc_email = jQuery("#wplc_email").val().replace(/(<([^>]+)>)/ig, "");
|
536 |
|
|
|
537 |
if (jQuery("#wplc_email").attr('wplc_hide') !== "1") {
|
538 |
+
if (wplc_name.length <= 0) { alert(wplc_error_messages.please_enter_name); return false; }
|
539 |
+
if (wplc_email.length <= 0) { alert(wplc_error_messages.please_enter_email); return false; }
|
540 |
var testEmail = /^[A-Z0-9._%+-]+@([A-Z0-9-]+\.)+[A-Z]{2,4}$/i;
|
541 |
if (!testEmail.test(wplc_email)) {
|
542 |
+
alert(wplc_error_messages.please_enter_valid_email);
|
543 |
return false;
|
544 |
}
|
545 |
}
|
596 |
var wplc_domain = jQuery("#wplc_domain_offline").val();
|
597 |
var ip_address = jQuery("#wplc_ip_address").val();
|
598 |
|
599 |
+
if (wplc_name.length <= 0) { alert(wplc_error_messages.please_enter_name); return false; }
|
600 |
+
if (wplc_email.length <= 0) { alert(wplc_error_messages.please_enter_email); return false; }
|
601 |
var testEmail = /^[A-Z0-9._%+-]+@([A-Z0-9-]+\.)+[A-Z]{2,4}$/i;
|
602 |
if (!testEmail.test(wplc_email)) {
|
603 |
+
alert(wplc_error_messages.please_enter_valid_email);
|
604 |
return false;
|
605 |
}
|
606 |
+
if (wplc_msg.length <= 0) { alert(wplc_error_messages.empty_message); return false; }
|
607 |
// jQuery("#wp-live-chat-2-info").hide();
|
608 |
jQuery("#wplc_message_div").html(wplc_offline_msg);
|
609 |
|
modules/advanced_features.php
CHANGED
@@ -84,6 +84,12 @@ function wplc_beta_settings_tab_content() {
|
|
84 |
<input type="number" value="<?php echo intval($wplc_settings['wplc_new_chat_ringer_count']); ?>" id="wplc_new_chat_ringer_count" name="wplc_new_chat_ringer_count">
|
85 |
</td>
|
86 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
</tbody>
|
88 |
</table>
|
89 |
<script>
|
84 |
<input type="number" value="<?php echo intval($wplc_settings['wplc_new_chat_ringer_count']); ?>" id="wplc_new_chat_ringer_count" name="wplc_new_chat_ringer_count">
|
85 |
</td>
|
86 |
</tr>
|
87 |
+
<td width="250" valign="top">
|
88 |
+
<label for="wplc_debug_mode"><?php _e("Enable debug logs",'wp-live-chat-support'); ?> <i class="fa fa-question-circle wplc_light_grey wplc_settings_tooltip" title="<?php _e('This option enables debug logs. If you are experencing issues with the plugin, enabling this might add more details to PHP logs, useful for plugin developers.', 'wp-live-chat-support'); ?>"></i></label>
|
89 |
+
</td>
|
90 |
+
<td valign="top">
|
91 |
+
<input type="checkbox" value="1" name="wplc_debug_mode" <?php if ($wplc_settings['wplc_debug_mode']) { echo "checked"; } ?>>
|
92 |
+
</td>
|
93 |
</tbody>
|
94 |
</table>
|
95 |
<script>
|
readme.txt
CHANGED
@@ -184,7 +184,9 @@ Huge update with over 300 changes that include: Bugfixes, Vulnerability Fixes &
|
|
184 |
|
185 |
== Changelog ==
|
186 |
|
187 |
-
= 8.1.
|
188 |
-
* Bugfix:
|
189 |
-
* Bugfix:
|
190 |
-
* Improvement:
|
|
|
|
184 |
|
185 |
== Changelog ==
|
186 |
|
187 |
+
= 8.1.7 - 2020-02-05 =
|
188 |
+
* Bugfix: added some missing translation strings
|
189 |
+
* Bugfix: HTML email body in auto responder not parsed correctly
|
190 |
+
* Improvement: added "Debug mode", extra logs added to PHP error log
|
191 |
+
* Improvement: reduced ajax requests footprint, removing unneeded fields
|
192 |
+
* Improvement: added confirmation for history delete
|
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: 8.1.
|
7 |
Author: 3CX
|
8 |
Author URI: https://www.3cx.com/wp-live-chat/
|
9 |
Domain Path: /languages
|
@@ -90,6 +90,7 @@ function wplc_set_defaults() {
|
|
90 |
'wplc_chatbox_height' => 70,
|
91 |
'wplc_chatbox_absolute_height' => 400,
|
92 |
'wplc_close_btn_text' => __("close", 'wp-live-chat-support'),
|
|
|
93 |
'wplc_default_department' => -1,
|
94 |
'wplc_delay_between_loops' => 500,
|
95 |
'wplc_delete_db_on_uninstall' => true,
|
@@ -876,6 +877,9 @@ function wplc_push_js_to_front() {
|
|
876 |
}
|
877 |
wp_register_script('wplc-user-node-node-primary', plugins_url('/js/wplc_node.js', __FILE__),array('jquery', 'wplc-server-script', 'wplc-user-script'), WPLC_PLUGIN_VERSION, true);
|
878 |
wp_enqueue_script('wplc-user-node-node-primary');
|
|
|
|
|
|
|
879 |
} else {
|
880 |
/* not using the node server, load traditional event handler JS */
|
881 |
wp_register_script('wplc-user-events-script', plugins_url('/js/wplc_u_events.js', __FILE__),array('jquery', 'wplc-server-script'), WPLC_PLUGIN_VERSION, true);
|
@@ -1896,7 +1900,7 @@ function wplc_superadmin_javascript() {
|
|
1896 |
}
|
1897 |
|
1898 |
if (isset($_GET['page']) && $_GET['page'] == "wplivechat-menu-offline-messages") {
|
1899 |
-
wplc_admin_output_js();
|
1900 |
}
|
1901 |
} else {
|
1902 |
do_action("wplc_hook_superadmin_head");
|
@@ -3033,7 +3037,7 @@ function wplc_hook_control_chat_history() {
|
|
3033 |
", $limit, $offset)
|
3034 |
);
|
3035 |
echo "<form method=\"post\" >
|
3036 |
-
<input type=\"submit\" value=\"".__('Delete History', 'wp-live-chat-support')."\" class='button' name=\"wplc-delete-chat-history\" /><br /><br />
|
3037 |
</form>
|
3038 |
|
3039 |
<table class=\"wp-list-table wplc_list_table widefat fixed \" cellspacing=\"0\">
|
@@ -3462,7 +3466,8 @@ function wplc_head() {
|
|
3462 |
$wplc_data['wplc_default_department'] = wplc_force_int($_POST, 'wplc_default_department', $wplc_settings);
|
3463 |
$wplc_data['wplc_allow_department_selection'] = wplc_force_bool($_POST, 'wplc_allow_department_selection');
|
3464 |
$wplc_data['wplc_pro_cta_anim'] = wplc_force_bool($_POST, 'wplc_pro_cta_anim');
|
3465 |
-
|
|
|
3466 |
$wplc_data['wplc_chat_name'] = stripslashes(sanitize_text_field(wplc_force_string($_POST, 'wplc_chat_name', $wplc_settings)));
|
3467 |
$wplc_data['wplc_use_wp_name'] = wplc_force_bool($_POST, 'wplc_use_wp_name');
|
3468 |
|
@@ -4175,19 +4180,21 @@ add_action( "admin_enqueue_scripts", "wplc_custom_scripts_scripts" );
|
|
4175 |
* Loads the Ace.js editor for the custom scripts
|
4176 |
* @return void
|
4177 |
*/
|
4178 |
-
function wplc_custom_scripts_scripts(){
|
4179 |
-
|
4180 |
-
|
4181 |
-
|
4182 |
-
|
4183 |
-
} else if ( $_GET['page'] === 'wplivechat-menu-dashboard' || $_GET['page'] === 'wplivechat-menu' ) {
|
4184 |
wplc_register_common_node();
|
4185 |
-
|
4186 |
-
|
4187 |
-
|
4188 |
-
|
4189 |
-
|
4190 |
-
|
|
|
|
|
|
|
4191 |
}
|
4192 |
|
4193 |
add_filter( "wplc_offline_message_subject_filter", "wplc_change_offline_message", 10, 1 );
|
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: 8.1.7
|
7 |
Author: 3CX
|
8 |
Author URI: https://www.3cx.com/wp-live-chat/
|
9 |
Domain Path: /languages
|
90 |
'wplc_chatbox_height' => 70,
|
91 |
'wplc_chatbox_absolute_height' => 400,
|
92 |
'wplc_close_btn_text' => __("close", 'wp-live-chat-support'),
|
93 |
+
'wplc_debug_mode' => false,
|
94 |
'wplc_default_department' => -1,
|
95 |
'wplc_delay_between_loops' => 500,
|
96 |
'wplc_delete_db_on_uninstall' => true,
|
877 |
}
|
878 |
wp_register_script('wplc-user-node-node-primary', plugins_url('/js/wplc_node.js', __FILE__),array('jquery', 'wplc-server-script', 'wplc-user-script'), WPLC_PLUGIN_VERSION, true);
|
879 |
wp_enqueue_script('wplc-user-node-node-primary');
|
880 |
+
wp_localize_script('wplc-user-node-node-primary', 'wplc_strings', array(
|
881 |
+
'restart_chat' => __('Restart Chat', 'wp-live-chat-support')
|
882 |
+
));
|
883 |
} else {
|
884 |
/* not using the node server, load traditional event handler JS */
|
885 |
wp_register_script('wplc-user-events-script', plugins_url('/js/wplc_u_events.js', __FILE__),array('jquery', 'wplc-server-script'), WPLC_PLUGIN_VERSION, true);
|
1900 |
}
|
1901 |
|
1902 |
if (isset($_GET['page']) && $_GET['page'] == "wplivechat-menu-offline-messages") {
|
1903 |
+
//wplc_admin_output_js();
|
1904 |
}
|
1905 |
} else {
|
1906 |
do_action("wplc_hook_superadmin_head");
|
3037 |
", $limit, $offset)
|
3038 |
);
|
3039 |
echo "<form method=\"post\" >
|
3040 |
+
<input type=\"submit\" value=\"".__('Delete History', 'wp-live-chat-support')."\" class='button' id=\"wplc-delete-chat-history\" name=\"wplc-delete-chat-history\" /><br /><br />
|
3041 |
</form>
|
3042 |
|
3043 |
<table class=\"wp-list-table wplc_list_table widefat fixed \" cellspacing=\"0\">
|
3466 |
$wplc_data['wplc_default_department'] = wplc_force_int($_POST, 'wplc_default_department', $wplc_settings);
|
3467 |
$wplc_data['wplc_allow_department_selection'] = wplc_force_bool($_POST, 'wplc_allow_department_selection');
|
3468 |
$wplc_data['wplc_pro_cta_anim'] = wplc_force_bool($_POST, 'wplc_pro_cta_anim');
|
3469 |
+
$wplc_data['wplc_debug_mode'] = wplc_force_bool($_POST, 'wplc_debug_mode');
|
3470 |
+
|
3471 |
$wplc_data['wplc_chat_name'] = stripslashes(sanitize_text_field(wplc_force_string($_POST, 'wplc_chat_name', $wplc_settings)));
|
3472 |
$wplc_data['wplc_use_wp_name'] = wplc_force_bool($_POST, 'wplc_use_wp_name');
|
3473 |
|
4180 |
* Loads the Ace.js editor for the custom scripts
|
4181 |
* @return void
|
4182 |
*/
|
4183 |
+
function wplc_custom_scripts_scripts() {
|
4184 |
+
if (isset( $_GET['page'])) {
|
4185 |
+
if ($_GET['page'] == 'wplivechat-menu-settings') {
|
4186 |
+
wp_enqueue_script( "wplc-custom-script-tab-ace", WPLC_PLUGIN_URL.'js/vendor/ace/ace.js', array('jquery'),WPLC_PLUGIN_VERSION );
|
4187 |
+
} else if ($_GET['page'] == 'wplivechat-menu-dashboard' || $_GET['page'] == 'wplivechat-menu') {
|
|
|
4188 |
wplc_register_common_node();
|
4189 |
+
wp_enqueue_script( 'wplc-custom-script-dashboard', WPLC_PLUGIN_URL.'js/wplc_dashboard.js', array('jquery'), WPLC_PLUGIN_VERSION, true );
|
4190 |
+
wp_localize_script('wplc-custom-script-dashboard', 'nifty_api_key', wplc_node_server_token_get());
|
4191 |
+
} else if ($_GET['page'] == 'wplivechat-menu-history') {
|
4192 |
+
wp_enqueue_script( 'wplc-custom-script-history', WPLC_PLUGIN_URL.'js/wplc_history.js', array('jquery'), WPLC_PLUGIN_VERSION, true );
|
4193 |
+
wp_localize_script('wplc-custom-script-history', 'tcx_messages', array(
|
4194 |
+
'historydeleteconfirm'=>__('Do you really want to delete all chats?', 'wp-live-chat-support')
|
4195 |
+
));
|
4196 |
+
}
|
4197 |
+
}
|
4198 |
}
|
4199 |
|
4200 |
add_filter( "wplc_offline_message_subject_filter", "wplc_change_offline_message", 10, 1 );
|