Sucuri Security – Auditing, Malware Scanner and Security Hardening - Version 1.4.2

Version Description

  • Fixing a few PHP warnings.
Download this release

Release Info

Developer yorman
Plugin Icon 128x128 Sucuri Security – Auditing, Malware Scanner and Security Hardening
Version 1.4.2
Comparing to
See all releases

Code changes from version 1.4.1 to 1.4.2

Files changed (2) hide show
  1. readme.txt +3 -1
  2. sucuri.php +14 -26
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: dd@sucuri.net, dremeda
3
  Donate Link: http://sitecheck.sucuri.net
4
  Tags: malware, security, scan, spam, virus, sucuri, WordPress,
5
  Requires at least:3.2
6
- Stable tag:1.4.1
7
  Tested up to: 3.6
8
 
9
  The Sucuri Security - SiteCheck Malware Scanner plugin enables you to scan your WordPress site using Sucuri SiteCheck and verify the integrity of your core files right in your dashboard. It also includes post-hack options to help you reset passwords and secret keys in case it has been already hacked.
@@ -67,6 +67,8 @@ the compromise on your site).
67
 
68
  == Changelog ==
69
 
 
 
70
 
71
  = 1.4.1 =
72
  * Small bug fixes.
3
  Donate Link: http://sitecheck.sucuri.net
4
  Tags: malware, security, scan, spam, virus, sucuri, WordPress,
5
  Requires at least:3.2
6
+ Stable tag:1.4.2
7
  Tested up to: 3.6
8
 
9
  The Sucuri Security - SiteCheck Malware Scanner plugin enables you to scan your WordPress site using Sucuri SiteCheck and verify the integrity of your core files right in your dashboard. It also includes post-hack options to help you reset passwords and secret keys in case it has been already hacked.
67
 
68
  == Changelog ==
69
 
70
+ = 1.4.2 =
71
+ * Fixing a few PHP warnings.
72
 
73
  = 1.4.1 =
74
  * Small bug fixes.
sucuri.php CHANGED
@@ -7,7 +7,7 @@ Description: The <a href="http://sucuri.net">Sucuri Security</a> - SiteCheck Mal
7
  You can also scan your site at <a href="http://sitecheck.sucuri.net">SiteCheck.Sucuri.net</a>.
8
 
9
  Author: Sucuri Security
10
- Version: 1.4.1
11
  Author URI: http://sucuri.net
12
  */
13
 
@@ -18,7 +18,7 @@ if(!function_exists('add_action'))
18
  }
19
 
20
  define('SUCURISCAN','sucuriscan');
21
- define('SUCURISCAN_VERSION','1.4.1');
22
  define( 'SUCURI_URL',plugin_dir_url( __FILE__ ));
23
  define('SUCURISCAN_PLUGIN_FOLDER', 'sucuri-scanner');
24
  /* Sucuri Free/Paid Plugin will use the same tablename, check: sucuriscan_lastlogins_table_exists() */
@@ -616,24 +616,23 @@ function sucuriscan_lastlogins_page()
616
  echo sucuriscan_get_template('sucuri-wp-lastlogins.html.tpl', $template_variables);
617
  }
618
 
619
- function sucuriscan_set_flashdata($key='', $value='')
620
- {
621
- /* Use wp-sucuri_ to give compatibility between Sucuri Free/Paid Plugin */
622
- $session_name = "wp-sucuri_{$key}";
623
- $expire = time() + 60*5;
624
- $value = base64_encode($value);
625
- @setcookie($session_name, $value, $expire, SITECOOKIEPATH.'wp-admin');
626
  }
 
627
 
628
  function sucuriscan_get_flashdata()
629
  {
630
- /* Use wp-sucuri_ to give compatibility between Sucuri Free/Paid Plugin */
631
- foreach($_COOKIE as $key=>$value){
632
- if( preg_match('/^(wp\-sucuri_.*)$/', $key) ){
633
- $value = base64_decode($value);
634
- sucuriscan_admin_notice('updated', $value);
635
- @setcookie($key, NULL, time()-3600); // Take care with "Cannot modify header" error.
636
  }
 
 
 
637
  }
638
  }
639
  add_action('admin_init', 'sucuriscan_get_flashdata');
@@ -689,15 +688,6 @@ function sucuriscan_set_lastlogin($user_login='')
689
  $current_user = get_user_by('login', $user_login);
690
  $remote_addr = sucuriscan_get_remoteaddr();
691
 
692
- $lastlogin_message = 'Last user login at <strong>'.date('Y/M/d H:i:s').'</strong>';
693
- $lastlogin_message .= chr(32).'from <strong>'.$remote_addr.' - '.gethostbyaddr($remote_addr).'</strong>';
694
- if( isset($_SERVER['GEOIP_REGION']) && isset($_SERVER['GEOIP_CITY']) ){
695
- $lastlogin_message .= chr(32)."{$_SERVER['GEOIP_CITY']}/{$_SERVER['GEOIP_REGION']}";
696
- }
697
- $lastlogin_message .= chr(32).'(<a href="'.site_url('wp-admin/admin.php?page=sucuriscan_lastlogins').'">View Last-Logins</a>)';
698
-
699
- sucuriscan_set_flashdata('lastlogin', $lastlogin_message);
700
-
701
  $wpdb->insert($table_name, array(
702
  'user_id'=>$current_user->ID,
703
  'user_login'=>$current_user->user_login,
@@ -732,5 +722,3 @@ function sucuriscan_get_logins($limit=10, $user_id=0)
732
 
733
  return FALSE;
734
  }
735
-
736
- ?>
7
  You can also scan your site at <a href="http://sitecheck.sucuri.net">SiteCheck.Sucuri.net</a>.
8
 
9
  Author: Sucuri Security
10
+ Version: 1.4.2
11
  Author URI: http://sucuri.net
12
  */
13
 
18
  }
19
 
20
  define('SUCURISCAN','sucuriscan');
21
+ define('SUCURISCAN_VERSION','1.4.2');
22
  define( 'SUCURI_URL',plugin_dir_url( __FILE__ ));
23
  define('SUCURISCAN_PLUGIN_FOLDER', 'sucuri-scanner');
24
  /* Sucuri Free/Paid Plugin will use the same tablename, check: sucuriscan_lastlogins_table_exists() */
616
  echo sucuriscan_get_template('sucuri-wp-lastlogins.html.tpl', $template_variables);
617
  }
618
 
619
+ function sucuri_login_redirect($redirect_to, $request, $user){
620
+ return admin_url('?sucuri_lastlogin_message=1');
 
 
 
 
 
621
  }
622
+ add_filter('login_redirect', 'sucuri_login_redirect');
623
 
624
  function sucuriscan_get_flashdata()
625
  {
626
+ if( isset($_GET['sucuri_lastlogin_message']) ){
627
+ $remote_addr = sucuriscan_get_remoteaddr();
628
+ $lastlogin_message = 'Last user login at <strong>'.date('Y/M/d H:i:s').'</strong>';
629
+ $lastlogin_message .= chr(32).'from <strong>'.$remote_addr.' - '.gethostbyaddr($remote_addr).'</strong>';
630
+ if( isset($_SERVER['GEOIP_REGION']) && isset($_SERVER['GEOIP_CITY']) ){
631
+ $lastlogin_message .= chr(32)."{$_SERVER['GEOIP_CITY']}/{$_SERVER['GEOIP_REGION']}";
632
  }
633
+ $lastlogin_message .= chr(32).'(<a href="'.site_url('wp-admin/admin.php?page=sucuriscan_lastlogins').'">View Last-Logins</a>)';
634
+
635
+ sucuriscan_admin_notice('updated', $lastlogin_message);
636
  }
637
  }
638
  add_action('admin_init', 'sucuriscan_get_flashdata');
688
  $current_user = get_user_by('login', $user_login);
689
  $remote_addr = sucuriscan_get_remoteaddr();
690
 
 
 
 
 
 
 
 
 
 
691
  $wpdb->insert($table_name, array(
692
  'user_id'=>$current_user->ID,
693
  'user_login'=>$current_user->user_login,
722
 
723
  return FALSE;
724
  }