WP Live Chat Support - Version 5.0.2

Version Description

  • 2015-08-05 - Medium Priority =
  • Fixed a bug that caused a fatal error with older versions of WP Live Chat Support Pro
Download this release

Release Info

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

Code changes from version 5.0.1 to 5.0.2

Files changed (2) hide show
  1. readme.txt +6 -0
  2. wp-live-chat-support.php +204 -8
readme.txt CHANGED
@@ -194,6 +194,12 @@ It is highly recommended that you upgrade to WP Live Chat Support version 4.1.4
194
 
195
  == Changelog ==
196
 
 
 
 
 
 
 
197
  = 5.0.1 - 2015-08-05 - Medium Priority =
198
  * Refactored the code so that the live chat box will show up even if there is a JS error from another plugin or theme
199
  * Live chat box styling fixes: top image padding; centered the "conneting, please be patient" message and added padding
194
 
195
  == Changelog ==
196
 
197
+ = 5.0.3 - 2015-08-05 - Medium Priority =
198
+ * Small bug fix
199
+
200
+ = 5.0.2 - 2015-08-05 - Medium Priority =
201
+ * Fixed a bug that caused a fatal error with older versions of WP Live Chat Support Pro
202
+
203
  = 5.0.1 - 2015-08-05 - Medium Priority =
204
  * Refactored the code so that the live chat box will show up even if there is a JS error from another plugin or theme
205
  * Live chat box styling fixes: top image padding; centered the "conneting, please be patient" message and added padding
wp-live-chat-support.php CHANGED
@@ -3,13 +3,19 @@
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: 5.0.1
7
  Author: WP-LiveChat
8
  Author URI: http://www.wp-livechat.com
9
  */
10
 
11
 
12
  /*
 
 
 
 
 
 
13
  * 5.0.1 - 2015-08-05 - Medium Priority
14
  * Refactored the code so that the live chat box will show up even if there is a JS error from another plugin or theme
15
  * Live chat box styling fixes: top image padding; centered the "conneting, please be patient" message and added padding
@@ -239,7 +245,7 @@ global $wplc_tblname_chats;
239
  global $wplc_tblname_msgs;
240
  $wplc_tblname_chats = $wpdb->prefix . "wplc_chat_sessions";
241
  $wplc_tblname_msgs = $wpdb->prefix . "wplc_chat_msgs";
242
- $wplc_version = "5.0.1";
243
 
244
  define('WPLC_BASIC_PLUGIN_DIR', dirname(__FILE__));
245
  define('WPLC_BASIC_PLUGIN_URL', plugins_url() . "/wp-live-chat-support/");
@@ -393,10 +399,14 @@ function wplc_load_user_js () {
393
  if (function_exists('wplc_hide_chat_when_offline')) {
394
  $wplc_hide_chat = wplc_hide_chat_when_offline();
395
  if (!$wplc_hide_chat) {
396
- wplc_push_js_to_front_pro();
 
 
397
  }
398
  } else {
399
- wplc_push_js_to_front_pro();
 
 
400
  }
401
  } else {
402
  wplc_push_js_to_front_basic();
@@ -511,6 +521,187 @@ function wplc_draw_user_box() {
511
 
512
  }
513
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
514
  function wplc_output_box() {
515
  $wplc_class = "";
516
  $wplc_settings = get_option("WPLC_SETTINGS");
@@ -1281,7 +1472,7 @@ function wplc_admin_menu_layout() {
1281
  }
1282
  $wplc_ver = str_replace('.', '', $wplc_pro_version);
1283
  $wplc_ver = intval($wplc_ver);
1284
- if ($wplc_ver <= 444) {
1285
  ?>
1286
  <div class='error below-h1'>
1287
 
@@ -1289,8 +1480,8 @@ function wplc_admin_menu_layout() {
1289
  <p><?php _e("You are using an outdated version of <strong>WP Live Chat Support Pro</strong>.", "wplivechat") ?></p>
1290
  <p>
1291
  <strong><?php _e("Please update to the latest version of WP Live Chat Support Pro", 'wplivechat'); ?>
1292
- <a href="http://wp-livechat.com/get-updated-version/" target=\"_BLANK\"> <?php _e("Version 4.4.5", "wplivechat"); ?></a>
1293
- <?php _e("to take advantage of chat window transitions and colour schemes.", "wplivechat"); ?>
1294
  </strong>
1295
  </p>
1296
  <p><?php _e("You can update your plugin <a href='./update-core.php'>here</a>, <a href='./plugins.php'>here</a> or <a href='http://wp-livechat.com/get-updated-version/' target='_BLANK'>here</a>.", "wplivechat") ?></strong></p>
@@ -1906,7 +2097,7 @@ function wplc_admin_scripts_basic() {
1906
  if (isset($_GET['page']) && $_GET['page'] == "wplivechat-menu-settings") {
1907
  wp_enqueue_script('jquery');
1908
  wp_enqueue_script('jquery-ui-core');
1909
- wp_enqueue_script('jquery-ui-tooltip');
1910
  wp_register_script('my-wplc-color', plugins_url('js/jscolor.js', __FILE__), false, '1.4.1', false);
1911
  wp_enqueue_script('my-wplc-color');
1912
  wp_enqueue_script('jquery-ui-tabs');
@@ -1952,6 +2143,11 @@ function wplc_admin_offline_messages() {
1952
  }
1953
 
1954
  function wplc_settings_page_basic() {
 
 
 
 
 
1955
  if (function_exists("wplc_register_pro_version")) {
1956
  wplc_settings_page_pro();
1957
  } else {
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: 5.0.3
7
  Author: WP-LiveChat
8
  Author URI: http://www.wp-livechat.com
9
  */
10
 
11
 
12
  /*
13
+ * 5.0.3 - 2015-08-05 - High Priority
14
+ * Small bug fix
15
+ *
16
+ * 5.0.2 - 2015-08-05 - High Priority
17
+ * Fixed a bug that caused a fatal error
18
+ *
19
  * 5.0.1 - 2015-08-05 - Medium Priority
20
  * Refactored the code so that the live chat box will show up even if there is a JS error from another plugin or theme
21
  * Live chat box styling fixes: top image padding; centered the "conneting, please be patient" message and added padding
245
  global $wplc_tblname_msgs;
246
  $wplc_tblname_chats = $wpdb->prefix . "wplc_chat_sessions";
247
  $wplc_tblname_msgs = $wpdb->prefix . "wplc_chat_msgs";
248
+ $wplc_version = "5.0.3";
249
 
250
  define('WPLC_BASIC_PLUGIN_DIR', dirname(__FILE__));
251
  define('WPLC_BASIC_PLUGIN_URL', plugins_url() . "/wp-live-chat-support/");
399
  if (function_exists('wplc_hide_chat_when_offline')) {
400
  $wplc_hide_chat = wplc_hide_chat_when_offline();
401
  if (!$wplc_hide_chat) {
402
+ if (function_exists("wplc_push_js_to_front_pro")) {
403
+ wplc_push_js_to_front_pro();
404
+ }
405
  }
406
  } else {
407
+ if (function_exists("wplc_push_js_to_front_pro")) {
408
+ wplc_push_js_to_front_pro();
409
+ }
410
  }
411
  } else {
412
  wplc_push_js_to_front_basic();
521
 
522
  }
523
 
524
+ function wplc_output_box_ajax() {
525
+ $wplc_class = "";
526
+ $ret_msg = "";
527
+ $wplc_settings = get_option("WPLC_SETTINGS");
528
+
529
+ if ($wplc_settings["wplc_settings_enabled"] == 2) {
530
+ return;
531
+ }
532
+
533
+ if ($wplc_settings["wplc_settings_align"] == 1) {
534
+ $original_pos = "bottom_left";
535
+ //$wplc_box_align = "left:100px; bottom:0px;";
536
+ $wplc_box_align = "bottom:0px;";
537
+ } else if ($wplc_settings["wplc_settings_align"] == 2) {
538
+ $original_pos = "bottom_right";
539
+ //$wplc_box_align = "right:100px; bottom:0px;";
540
+ $wplc_box_align = "bottom:0px;";
541
+ } else if ($wplc_settings["wplc_settings_align"] == 3) {
542
+ $original_pos = "left";
543
+ // $wplc_box_align = "left:0; bottom:100px;";
544
+ $wplc_box_align = " bottom:100px;";
545
+ $wplc_class = "wplc_left";
546
+ } else if ($wplc_settings["wplc_settings_align"] == 4) {
547
+ $original_pos = "right";
548
+ // $wplc_box_align = "right:0; bottom:100px;";
549
+ $wplc_box_align = "bottom:100px;";
550
+ $wplc_class = "wplc_right";
551
+ }
552
+
553
+ if ($wplc_settings["wplc_settings_fill"]) {
554
+ $wplc_settings_fill = "#" . $wplc_settings["wplc_settings_fill"];
555
+ } else {
556
+ $wplc_settings_fill = "#ed832f";
557
+ }
558
+ if ($wplc_settings["wplc_settings_font"]) {
559
+ $wplc_settings_font = "#" . $wplc_settings["wplc_settings_font"];
560
+ } else {
561
+ $wplc_settings_font = "#FFFFFF";
562
+ }
563
+
564
+ $wplc_is_admin_logged_in = get_transient("wplc_is_admin_logged_in");
565
+ if (!function_exists("wplc_register_pro_version") && $wplc_is_admin_logged_in != 1) {
566
+ $ret_msg = "";
567
+ }
568
+
569
+ if(function_exists('wplc_pro_activate')){
570
+ if(function_exists('wplc_return_animations')){
571
+
572
+ $animations = wplc_return_animations();
573
+
574
+ isset($animations['animation']) ? $wplc_animation = $animations['animation'] : $wplc_animation = 'animation-4';
575
+ isset($animations['starting_point']) ? $wplc_starting_point = $animations['starting_point'] : $wplc_starting_point = 'display: none;';
576
+ isset($animations['box_align']) ? $wplc_box_align = $animations['box_align'] : $wplc_box_align = '';
577
+
578
+ } else {
579
+
580
+ }
581
+ } else {
582
+
583
+ $wplc_starting_point = '';
584
+ $wplc_animation = '';
585
+
586
+ if ($wplc_settings["wplc_settings_align"] == 1) {
587
+ $original_pos = "bottom_left";
588
+ $wplc_box_align = "left:100px; bottom:0px;";
589
+ } else if ($wplc_settings["wplc_settings_align"] == 2) {
590
+ $original_pos = "bottom_right";
591
+ $wplc_box_align = "right:100px; bottom:0px;";
592
+ } else if ($wplc_settings["wplc_settings_align"] == 3) {
593
+ $original_pos = "left";
594
+ $wplc_box_align = "left:0; bottom:100px;";
595
+ $wplc_class = "wplc_left";
596
+ } else if ($wplc_settings["wplc_settings_align"] == 4) {
597
+ $original_pos = "right";
598
+ $wplc_box_align = "right:0; bottom:100px;";
599
+ $wplc_class = "wplc_right";
600
+ }
601
+
602
+ }
603
+
604
+ if (isset($wplc_settings['wplc_auto_pop_up'])) { $wplc_auto_popup = $wplc_settings['wplc_auto_pop_up']; } else { $wplc_auto_popup = "" ;}
605
+ $ret_msg .= "<div id=\"wp-live-chat\" wplc_animation=\"".$wplc_animation."\" style=\"".$wplc_starting_point." ".$wplc_box_align.";\" class=\"".$wplc_class." wplc_close\" original_pos=\"".$original_pos."\" wplc-auto-pop-up=\"". $wplc_auto_popup."\" > ";
606
+
607
+ if (function_exists("wplc_register_pro_version")) {
608
+ $ret_msg .= wplc_pro_output_box_ajax();
609
+ } else {
610
+
611
+ $ret_msg .= "<div class=\"wp-live-chat-wraper\">";
612
+ $ret_msg .= "<div id=\"wp-live-chat-header\" style=\"background-color: ".$wplc_settings_fill." !important; color: ".$wplc_settings_font." !important; \">";
613
+ $ret_msg .= "<i id=\"wp-live-chat-minimize\" class=\"fa fa-minus\" style=\"display:none;\" ></i>";
614
+ ?>
615
+ <i id="wp-live-chat-close" class="fa fa-times" style="display:none;" ></i>
616
+
617
+ <div id="wp-live-chat-1" >
618
+ <div style="display:block; ">
619
+ <strong><?php _e("Questions?", "wplivechat") ?></strong> <?php _e("Chat with us", "wplivechat") ?>
620
+ </div>
621
+ </div>
622
+ </div>
623
+
624
+ <div id="wp-live-chat-2" style="display:none;">
625
+ <div id="wp-live-chat-2-info">
626
+ <strong><?php _e('Start Live Chat', 'wplivechat'); ?></strong>
627
+ </div>
628
+ <?php
629
+ $wplc_settings = get_option("WPLC_SETTINGS");
630
+
631
+ if (isset($wplc_settings['wplc_loggedin_user_info']) && $wplc_settings['wplc_loggedin_user_info'] == 1) {
632
+ $wplc_use_loggedin_user_details = 1;
633
+ } else {
634
+ $wplc_use_loggedin_user_details = 0;
635
+ }
636
+
637
+ $wplc_loggedin_user_name = "";
638
+ $wplc_loggedin_user_email = "";
639
+
640
+ if ($wplc_use_loggedin_user_details == 1) {
641
+ global $current_user;
642
+
643
+ if ($current_user->data != null) {
644
+ //Logged in. Get name and email
645
+ $wplc_loggedin_user_name = $current_user->user_nicename;
646
+ $wplc_loggedin_user_email = $current_user->user_email;
647
+ }
648
+ } else {
649
+ $wplc_loggedin_user_name = '';
650
+ $wplc_loggedin_user_email = '';
651
+ }
652
+
653
+ if (isset($wplc_settings['wplc_require_user_info']) && $wplc_settings['wplc_require_user_info'] == 1) {
654
+ $wplc_ask_user_details = 1;
655
+ } else {
656
+ $wplc_ask_user_details = 0;
657
+ }
658
+
659
+ if ($wplc_ask_user_details == 1) {
660
+ //Ask the user to enter name and email
661
+ ?>
662
+ <input type="text" name="wplc_name" id="wplc_name" value="<?php echo $wplc_loggedin_user_name; ?>" placeholder="<?php _e("Name", "wplivechat"); ?>" />
663
+ <input type="text" name="wplc_email" id="wplc_email" wplc_hide="0" value="<?php echo $wplc_loggedin_user_email; ?>" placeholder="<?php _e("Email", "wplivechat"); ?>" />
664
+ <?php
665
+ } else {
666
+ //Dont ask the user
667
+ echo '<div style="padding: 7px; text-align: center;">';
668
+ if (isset($wplc_settings['wplc_user_alternative_text'])) {
669
+ echo stripslashes($wplc_settings['wplc_user_alternative_text']);
670
+ }
671
+ echo '</div>';
672
+
673
+ $wplc_random_user_number = rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9);
674
+ //$wplc_loggedin_user_email = $wplc_random_user_number."@".$wplc_random_user_number.".com";
675
+ ?>
676
+ <input type="hidden" name="wplc_name" id="wplc_name" value="<?php if ($wplc_loggedin_user_name != '') { echo $wplc_loggedin_user_name; } else { echo 'user' . $wplc_random_user_number; } ?>" />
677
+ <input type="hidden" name="wplc_email" id="wplc_email" wplc_hide="1" value="<?php if ($wplc_loggedin_user_email != '' && $wplc_loggedin_user_email != null) { echo $wplc_loggedin_user_email; } else { echo $wplc_random_user_number . '@' . $wplc_random_user_number . '.com'; } ?>" />
678
+ <?php
679
+ }
680
+ ?>
681
+ <input id="wplc_start_chat_btn" type="button" value="<?php _e("Start Chat", "wplivechat"); ?>" style="background-color: <?php echo $wplc_settings_fill; ?> !important; color: <?php echo $wplc_settings_font; ?> !important;"/>
682
+ </div>
683
+ <div id="wp-live-chat-3" style="display:none;">
684
+ <p><?php _e("Connecting you to a sales person. Please be patient.", "wplivechat") ?></p>
685
+ </div>
686
+ <div id="wp-live-chat-react" style="display:none;">
687
+ <p><?php _e("Reactivating your previous chat...", "wplivechat") ?></p>
688
+ </div>
689
+ <div id="wp-live-chat-4" style="display:none;">
690
+ <div id="wplc_sound_update" style='height:0; width:0; display:none; border:0;'></div>
691
+ <div id="wplc_chatbox"></div>
692
+ <p style="text-align:center; font-size:11px;"><?php _e("Press ENTER to send your message", "wplivechat") ?></p>
693
+ <p>
694
+ <input type="text" name="wplc_chatmsg" id="wplc_chatmsg" value="" />
695
+ <input type="hidden" name="wplc_cid" id="wplc_cid" value="" />
696
+ <input id="wplc_send_msg" type="button" value="<?php _e("Send", "wplivechat"); ?>" style="display:none;" />
697
+ </p>
698
+ </div>
699
+ </div>
700
+ <?php } ?>
701
+ </div>
702
+ <?php
703
+ }
704
+
705
  function wplc_output_box() {
706
  $wplc_class = "";
707
  $wplc_settings = get_option("WPLC_SETTINGS");
1472
  }
1473
  $wplc_ver = str_replace('.', '', $wplc_pro_version);
1474
  $wplc_ver = intval($wplc_ver);
1475
+ if ($wplc_ver != 501) {
1476
  ?>
1477
  <div class='error below-h1'>
1478
 
1480
  <p><?php _e("You are using an outdated version of <strong>WP Live Chat Support Pro</strong>.", "wplivechat") ?></p>
1481
  <p>
1482
  <strong><?php _e("Please update to the latest version of WP Live Chat Support Pro", 'wplivechat'); ?>
1483
+ <a href="http://wp-livechat.com/get-updated-version/" target=\"_BLANK\"> <?php _e("Version 5.0.1", "wplivechat"); ?></a>
1484
+ <?php _e("to ensure everything is working correctly.", "wplivechat"); ?>
1485
  </strong>
1486
  </p>
1487
  <p><?php _e("You can update your plugin <a href='./update-core.php'>here</a>, <a href='./plugins.php'>here</a> or <a href='http://wp-livechat.com/get-updated-version/' target='_BLANK'>here</a>.", "wplivechat") ?></strong></p>
2097
  if (isset($_GET['page']) && $_GET['page'] == "wplivechat-menu-settings") {
2098
  wp_enqueue_script('jquery');
2099
  wp_enqueue_script('jquery-ui-core');
2100
+ wp_enqueue_script('jquery-ui-tooltip');
2101
  wp_register_script('my-wplc-color', plugins_url('js/jscolor.js', __FILE__), false, '1.4.1', false);
2102
  wp_enqueue_script('my-wplc-color');
2103
  wp_enqueue_script('jquery-ui-tabs');
2143
  }
2144
 
2145
  function wplc_settings_page_basic() {
2146
+
2147
+
2148
+
2149
+
2150
+
2151
  if (function_exists("wplc_register_pro_version")) {
2152
  wplc_settings_page_pro();
2153
  } else {