WP Live Chat Support - Version 4.4.3

Version Description

  • 2015-07-16 - Low Priority =
  • Bug Fix: Ajax URL undefined in some versions of WordPress
  • Improvement: Warning messages limited to the Settings page only
Download this release

Release Info

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

Code changes from version 4.4.2 to 4.4.3

Files changed (6) hide show
  1. ajax_new.php +7 -1
  2. css/chat-style.css +4 -0
  3. functions.php +2 -2
  4. js/wplc_u.js +1 -1
  5. readme.txt +5 -0
  6. wp-live-chat-support.php +35 -26
ajax_new.php CHANGED
@@ -11,9 +11,15 @@ add_action('wp_ajax_wplc_user_minimize_chat', 'wplc_init_ajax_callback');
11
  add_action('wp_ajax_wplc_user_maximize_chat', 'wplc_init_ajax_callback');
12
  add_action('wp_ajax_wplc_user_send_msg', 'wplc_init_ajax_callback');
13
  add_action('wp_ajax_wplc_start_chat', 'wplc_init_ajax_callback');
 
 
 
 
 
 
14
 
15
  function wplc_init_ajax_callback() {
16
-
17
  $check = check_ajax_referer( 'wplc', 'security' );
18
 
19
  if ($check == 1) {
11
  add_action('wp_ajax_wplc_user_maximize_chat', 'wplc_init_ajax_callback');
12
  add_action('wp_ajax_wplc_user_send_msg', 'wplc_init_ajax_callback');
13
  add_action('wp_ajax_wplc_start_chat', 'wplc_init_ajax_callback');
14
+ add_action('wp_ajax_nopriv_wplc_start_chat', 'wplc_init_ajax_callback');
15
+ add_action('wp_ajax_nopriv_wplc_call_to_server_visitor', 'wplc_init_ajax_callback');
16
+ add_action('wp_ajax_nopriv_wplc_user_close_chat', 'wplc_init_ajax_callback');
17
+ add_action('wp_ajax_nopriv_wplc_user_minimize_chat', 'wplc_init_ajax_callback');
18
+ add_action('wp_ajax_nopriv_wplc_user_maximize_chat', 'wplc_init_ajax_callback');
19
+ add_action('wp_ajax_nopriv_wplc_user_send_msg', 'wplc_init_ajax_callback');
20
 
21
  function wplc_init_ajax_callback() {
22
+ @ob_start();
23
  $check = check_ajax_referer( 'wplc', 'security' );
24
 
25
  if ($check == 1) {
css/chat-style.css CHANGED
@@ -356,4 +356,8 @@
356
  .admin_visitor_advanced_info{
357
  width: 93%;
358
  }
 
 
 
 
359
  }
356
  .admin_visitor_advanced_info{
357
  width: 93%;
358
  }
359
+ }
360
+
361
+ .wplc_admin_dashboard_container p {
362
+ padding: 0 5px;
363
  }
functions.php CHANGED
@@ -361,7 +361,7 @@ function wplc_return_user_chat_messages($cid) {
361
  $id = $result->id;
362
  $from = $result->from;
363
 
364
- $msg = stripslashes($result->msg);
365
  //$timestamp = strtotime($result->timestamp);
366
  //$timeshow = date("H:i",$timestamp);
367
  if($result->originates == 1){
@@ -578,7 +578,7 @@ function wplc_return_admin_chat_messages($cid) {
578
  $id = $result->id;
579
  $from = $result->from;
580
  wplc_mark_as_read_admin_chat_messages($id);
581
- $msg = stripslashes($result->msg);
582
  //$timestamp = strtotime($result->timestamp);
583
  //$timeshow = date("H:i",$timestamp);
584
  $image = "";
361
  $id = $result->id;
362
  $from = $result->from;
363
 
364
+ $msg = $result->msg;
365
  //$timestamp = strtotime($result->timestamp);
366
  //$timeshow = date("H:i",$timestamp);
367
  if($result->originates == 1){
578
  $id = $result->id;
579
  $from = $result->from;
580
  wplc_mark_as_read_admin_chat_messages($id);
581
+ $msg = $result->msg;
582
  //$timestamp = strtotime($result->timestamp);
583
  //$timeshow = date("H:i",$timestamp);
584
  $image = "";
js/wplc_u.js CHANGED
@@ -69,7 +69,7 @@ jQuery(document).ready(function() {
69
  success: function(response) {
70
 
71
  if(response){
72
- // console.log(response);
73
  response = JSON.parse(response);
74
  // console.log(response);
75
  // set vars and cookies
69
  success: function(response) {
70
 
71
  if(response){
72
+ console.log(response);
73
  response = JSON.parse(response);
74
  // console.log(response);
75
  // set vars and cookies
readme.txt CHANGED
@@ -183,6 +183,11 @@ It is highly recommended that you upgrade to WP Live Chat Support version 4.1.4
183
 
184
  == Changelog ==
185
 
 
 
 
 
 
186
  = 4.4.2 - 2015-07-13 - Low Priority =
187
  * Improvement: Gravatar images will load on sites using SSL without any issues
188
  * Improvement: Hungarian live chat translation file name fixed
183
 
184
  == Changelog ==
185
 
186
+ = 4.4.3 - 2015-07-16 - Low Priority =
187
+ * Bug Fix: Ajax URL undefined in some versions of WordPress
188
+ * Improvement: Warning messages limited to the Settings page only
189
+
190
+
191
  = 4.4.2 - 2015-07-13 - Low Priority =
192
  * Improvement: Gravatar images will load on sites using SSL without any issues
193
  * Improvement: Hungarian live chat translation file name fixed
wp-live-chat-support.php CHANGED
@@ -3,13 +3,18 @@
3
  Plugin Name: WP Live Chat Support
4
  Plugin URI: http://www.wp-livechat.com
5
  Description: The easiest to use website live chat plugin. Let your visitors chat with you and increase sales conversion rates with WP Live Chat Support. No third party connection required!
6
- Version: 4.4.2
7
  Author: WP-LiveChat
8
  Author URI: http://www.wp-livechat.com
9
  */
10
 
11
 
12
- /* 4.4.2 - 2015-07-13 - Low Priority
 
 
 
 
 
13
  * Improvement: Gravatar images will load on sites using SSL without any issues
14
  * Improvement: Hungarian live chat translation file name fixed
15
  * Improvement: Styling improvements on the live chat dashboard
@@ -217,18 +222,21 @@ global $wplc_tblname_chats;
217
  global $wplc_tblname_msgs;
218
  $wplc_tblname_chats = $wpdb->prefix . "wplc_chat_sessions";
219
  $wplc_tblname_msgs = $wpdb->prefix . "wplc_chat_msgs";
220
- $wplc_version = "4.4.02";
221
 
222
  define('WPLC_BASIC_PLUGIN_DIR', dirname(__FILE__));
223
  define('WPLC_BASIC_PLUGIN_URL', plugins_url() . "/wp-live-chat-support/");
224
  global $wplc_basic_plugin_url;
225
  $wplc_basic_plugin_url = get_option('siteurl') . "/wp-content/plugins/wp-live-chat-support/";
226
 
 
 
 
227
 
228
-
229
- require_once (plugin_dir_path(__FILE__) . "ajax_new.php");
230
  require_once (plugin_dir_path(__FILE__) . "functions.php");
 
231
  add_action('wp_ajax_wplc_admin_set_transient', 'wplc_action_callback');
 
232
  add_action('init', 'wplc_version_control');
233
 
234
  add_action('wp_footer', 'wplc_display_box');
@@ -253,8 +261,6 @@ add_action('admin_head', 'wplc_superadmin_javascript');
253
  register_activation_hook(__FILE__, 'wplc_activate');
254
 
255
 
256
-
257
-
258
  function wplc_basic_check() {
259
  // check if basic exists if pro is installed
260
  }
@@ -347,6 +353,7 @@ function wplc_user_top_js() {
347
  <script type="text/javascript">
348
  <?php if (!function_exists("wplc_register_pro_version")) { ?>
349
  /* var wplc_ajaxurl = '<?php echo plugins_url('/ajax.php', __FILE__); ?>'; */
 
350
  var wplc_ajaxurl = ajaxurl;
351
  <?php } ?>
352
  var wplc_nonce = '<?php echo $ajax_nonce; ?>';
@@ -1435,7 +1442,7 @@ function wplc_add_user_stylesheet() {
1435
  }
1436
 
1437
  function wplc_add_admin_stylesheet() {
1438
- if (isset($_GET['page']) && ($_GET['page'] == 'wplivechat-menu' || $_GET['page'] == 'wplivechat-menu-settings' || $_GET['page'] == 'wplivechat-menu-offline-messages')) {
1439
  wp_register_style('wplc-admin-style', plugins_url('/css/jquery-ui.css', __FILE__));
1440
  wp_enqueue_style('wplc-admin-style');
1441
  wp_register_style('wplc-chat-style', plugins_url('/css/chat-style.css', __FILE__));
@@ -1639,24 +1646,26 @@ function wplc_get_home_path() {
1639
  }
1640
 
1641
  /* Error Checks */
1642
- if(is_admin()){
1643
- $wplc_error_count = 0;
1644
- $wplc_admin_warnings = "<div class='error'>";
1645
- if(!function_exists('set_time_limit')){
1646
- $wplc_admin_warnings .= "
1647
- <p>".__("WPLC: set_time_limit() is not enabled on this server. You may experience issues while using WP Live Chat Support as a result of this. Please get in contact your host to get this function enabled.", "wplivechat")."</p>
1648
- ";
1649
- $wplc_error_count++;
1650
- }
1651
- if(ini_get('safe_mode')){
1652
- $wplc_admin_warnings .= "
1653
- <p>".__("WPLC: Safe mode is enabled on this server. You may experience issues while using WP Live Chat Support as a result of this. Please contact your host to get safe mode disabled.", "wplivechat")."</p>
1654
- ";
1655
- $wplc_error_count++;
1656
- }
1657
- $wplc_admin_warnings .= "</div>";
1658
- if($wplc_error_count > 0){
1659
- echo $wplc_admin_warnings;
 
 
1660
  }
1661
  }
1662
 
3
  Plugin Name: WP Live Chat Support
4
  Plugin URI: http://www.wp-livechat.com
5
  Description: The easiest to use website live chat plugin. Let your visitors chat with you and increase sales conversion rates with WP Live Chat Support. No third party connection required!
6
+ Version: 4.4.3
7
  Author: WP-LiveChat
8
  Author URI: http://www.wp-livechat.com
9
  */
10
 
11
 
12
+ /* 4.4.3 - 2015-07-16 - Low Priority
13
+ * Bug Fix: Ajax URL undefined in some versions of WordPress
14
+ * Improvement: Warning messages limited to the Settings page only
15
+ *
16
+ *
17
+ * 4.4.2 - 2015-07-13 - Low Priority
18
  * Improvement: Gravatar images will load on sites using SSL without any issues
19
  * Improvement: Hungarian live chat translation file name fixed
20
  * Improvement: Styling improvements on the live chat dashboard
222
  global $wplc_tblname_msgs;
223
  $wplc_tblname_chats = $wpdb->prefix . "wplc_chat_sessions";
224
  $wplc_tblname_msgs = $wpdb->prefix . "wplc_chat_msgs";
225
+ $wplc_version = "4.4.03";
226
 
227
  define('WPLC_BASIC_PLUGIN_DIR', dirname(__FILE__));
228
  define('WPLC_BASIC_PLUGIN_URL', plugins_url() . "/wp-live-chat-support/");
229
  global $wplc_basic_plugin_url;
230
  $wplc_basic_plugin_url = get_option('siteurl') . "/wp-content/plugins/wp-live-chat-support/";
231
 
232
+ if(!function_exists('wplc_pro_activate')){
233
+ require_once (plugin_dir_path(__FILE__) . "ajax_new.php");
234
+ }
235
 
 
 
236
  require_once (plugin_dir_path(__FILE__) . "functions.php");
237
+
238
  add_action('wp_ajax_wplc_admin_set_transient', 'wplc_action_callback');
239
+
240
  add_action('init', 'wplc_version_control');
241
 
242
  add_action('wp_footer', 'wplc_display_box');
261
  register_activation_hook(__FILE__, 'wplc_activate');
262
 
263
 
 
 
264
  function wplc_basic_check() {
265
  // check if basic exists if pro is installed
266
  }
353
  <script type="text/javascript">
354
  <?php if (!function_exists("wplc_register_pro_version")) { ?>
355
  /* var wplc_ajaxurl = '<?php echo plugins_url('/ajax.php', __FILE__); ?>'; */
356
+ var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';
357
  var wplc_ajaxurl = ajaxurl;
358
  <?php } ?>
359
  var wplc_nonce = '<?php echo $ajax_nonce; ?>';
1442
  }
1443
 
1444
  function wplc_add_admin_stylesheet() {
1445
+ if (isset($_GET['page']) && ($_GET['page'] == 'wplivechat-menu' || $_GET['page'] == 'wplivechat-menu-settings' || $_GET['page'] == 'wplivechat-menu-offline-messages' || $_GET['page'] == 'wplivechat-menu-history')) {
1446
  wp_register_style('wplc-admin-style', plugins_url('/css/jquery-ui.css', __FILE__));
1447
  wp_enqueue_style('wplc-admin-style');
1448
  wp_register_style('wplc-chat-style', plugins_url('/css/chat-style.css', __FILE__));
1646
  }
1647
 
1648
  /* Error Checks */
1649
+ if(isset($_GET['page']) && $_GET['page'] == 'wplivechat-menu-settings'){
1650
+ if(is_admin()){
1651
+ $wplc_error_count = 0;
1652
+ $wplc_admin_warnings = "<div class='error'>";
1653
+ if(!function_exists('set_time_limit')){
1654
+ $wplc_admin_warnings .= "
1655
+ <p>".__("WPLC: set_time_limit() is not enabled on this server. You may experience issues while using WP Live Chat Support as a result of this. Please get in contact your host to get this function enabled.", "wplivechat")."</p>
1656
+ ";
1657
+ $wplc_error_count++;
1658
+ }
1659
+ if(ini_get('safe_mode')){
1660
+ $wplc_admin_warnings .= "
1661
+ <p>".__("WPLC: Safe mode is enabled on this server. You may experience issues while using WP Live Chat Support as a result of this. Please contact your host to get safe mode disabled.", "wplivechat")."</p>
1662
+ ";
1663
+ $wplc_error_count++;
1664
+ }
1665
+ $wplc_admin_warnings .= "</div>";
1666
+ if($wplc_error_count > 0){
1667
+ echo $wplc_admin_warnings;
1668
+ }
1669
  }
1670
  }
1671