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

Version Description

  • Fix warning caused by humanTime function
  • Fix fatal error caused by cron jobs with nested arguments
Download this release

Release Info

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

Code changes from version 1.8.23 to 1.8.24

readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate Link: https://sucuri.net/
4
  Tags: malware, security, firewall, scan, spam, virus, sucuri, protection, blacklist, detection, hardening, file integrity
5
  Requires at least: 3.6
6
  Tested up to: 5.3.2
7
- Stable tag: 1.8.23
8
 
9
  The Sucuri WordPress Security plugin is a security toolset for security integrity monitoring, malware detection and security hardening.
10
 
@@ -190,6 +190,10 @@ This version adds an option to refresh the malware scan results on demand, as we
190
 
191
  == Changelog ==
192
 
 
 
 
 
193
  = 1.8.23 =
194
  * Add Automatic Secret Keys Updater
195
  * Improve button's and link's messaging on Last Logins sections
4
  Tags: malware, security, firewall, scan, spam, virus, sucuri, protection, blacklist, detection, hardening, file integrity
5
  Requires at least: 3.6
6
  Tested up to: 5.3.2
7
+ Stable tag: 1.8.24
8
 
9
  The Sucuri WordPress Security plugin is a security toolset for security integrity monitoring, malware detection and security hardening.
10
 
190
 
191
  == Changelog ==
192
 
193
+ = 1.8.24 =
194
+ * Fix warning caused by humanTime function
195
+ * Fix fatal error caused by cron jobs with nested arguments
196
+
197
  = 1.8.23 =
198
  * Add Automatic Secret Keys Updater
199
  * Improve button's and link's messaging on Last Logins sections
src/base.lib.php CHANGED
@@ -183,6 +183,10 @@ class SucuriScan
183
  */
184
  public static function humanTime($time = 0)
185
  {
 
 
 
 
186
  $now = time();
187
 
188
  if ($time === $now) {
183
  */
184
  public static function humanTime($time = 0)
185
  {
186
+ if (!is_numeric($time)) {
187
+ return 'N/A';
188
+ }
189
+
190
  $now = time();
191
 
192
  if ($time === $now) {
src/event.lib.php CHANGED
@@ -120,7 +120,7 @@ class SucuriScanEvent extends SucuriScan
120
  'schedule' => $event['schedule'],
121
  'nextTime' => SucuriScan::datetime($timestamp),
122
  'nextTimeHuman' => SucuriScan::humanTime($timestamp),
123
- 'arguments' => SucuriScan::implode(', ', $event['args']),
124
  );
125
  }
126
  }
120
  'schedule' => $event['schedule'],
121
  'nextTime' => SucuriScan::datetime($timestamp),
122
  'nextTimeHuman' => SucuriScan::humanTime($timestamp),
123
+ 'arguments' => json_encode($event['args']),
124
  );
125
  }
126
  }
src/globals.php CHANGED
@@ -75,21 +75,9 @@ if (defined('SUCURISCAN')) {
75
  add_filter('cron_schedules', 'SucuriScanEvent::additionalSchedulesFrequencies');
76
 
77
  /**
78
- * Add cronjob hooks methods.
79
- *
80
- * This is necessary because using add_action inside the feature class/method
81
- * will not be persistent. The hooks must be declared on every page load.
82
  */
83
- foreach (SucuriScanEvent::activeSchedules() as $hook => $details) {
84
- if (substr($hook, 0, strlen('sucuriscan_')) === 'sucuriscan_') {
85
- if (!has_action($hook)) {
86
- $methodLocation = array('SucuriScanCrons', $hook);
87
- if (method_exists($methodLocation[0], $methodLocation[1])) {
88
- add_action($hook, $methodLocation);
89
- }
90
- }
91
- }
92
- }
93
 
94
  /**
95
  * List an associative array with the sub-pages of this plugin.
75
  add_filter('cron_schedules', 'SucuriScanEvent::additionalSchedulesFrequencies');
76
 
77
  /**
78
+ * Hook the sucuriscan_autoseckeyupdater cron job.
 
 
 
79
  */
80
+ add_action('sucuriscan_autoseckeyupdater', 'SucuriScanCrons::sucuriscan_autoseckeyupdater');
 
 
 
 
 
 
 
 
 
81
 
82
  /**
83
  * List an associative array with the sub-pages of this plugin.
src/settings-posthack.php CHANGED
@@ -164,8 +164,13 @@ class SucuriScanSettingsPosthack extends SucuriScanSettings
164
  } else {
165
  // Re-order selection box with the current cron frequency
166
  if (wp_next_scheduled($cronName)) {
167
- $currentCronFrequency = SucuriScanEvent::activeSchedules()[$cronName]['schedule'];
168
- $params['SecurityKeys.Schedules'] = str_replace('option value="'.$currentCronFrequency.'"', 'option value="'.$currentCronFrequency.'" selected', $params['SecurityKeys.Schedules']);
 
 
 
 
 
169
  }
170
  }
171
 
164
  } else {
165
  // Re-order selection box with the current cron frequency
166
  if (wp_next_scheduled($cronName)) {
167
+ $activeSchedules = SucuriScanEvent::activeSchedules();
168
+
169
+ if ( isset($activeSchedules[$cronName]) && isset($activeSchedules[$cronName]['schedule'])) {
170
+ $currentCronFrequency = $activeSchedules[$cronName]['schedule'];
171
+
172
+ $params['SecurityKeys.Schedules'] = str_replace('option value="'.$currentCronFrequency.'"', 'option value="'.$currentCronFrequency.'" selected', $params['SecurityKeys.Schedules']);
173
+ }
174
  }
175
  }
176
 
src/settings-scanner.php CHANGED
@@ -168,7 +168,7 @@ class SucuriScanSettingsScanner extends SucuriScanSettings
168
  'Cronjob.Schedule' => $event['schedule'],
169
  'Cronjob.NextTime' => SucuriScan::datetime($timestamp),
170
  'Cronjob.NextTimeHuman' => SucuriScan::humanTime($timestamp),
171
- 'Cronjob.Arguments' => SucuriScan::implode(', ', $event['args']),
172
  )
173
  );
174
  }
168
  'Cronjob.Schedule' => $event['schedule'],
169
  'Cronjob.NextTime' => SucuriScan::datetime($timestamp),
170
  'Cronjob.NextTimeHuman' => SucuriScan::humanTime($timestamp),
171
+ 'Cronjob.Arguments' => json_encode($event['args']),
172
  )
173
  );
174
  }
sucuri.php CHANGED
@@ -8,7 +8,7 @@
8
  * Author: Sucuri Inc.
9
  * Text Domain: sucuri-scanner
10
  * Domain Path: /lang
11
- * Version: 1.8.23
12
  *
13
  * PHP version 5
14
  *
@@ -85,7 +85,7 @@ define('SUCURISCAN', 'sucuriscan');
85
  /**
86
  * Current version of the plugin's code.
87
  */
88
- define('SUCURISCAN_VERSION', '1.8.23');
89
 
90
  /**
91
  * Defines the human readable name of the plugin.
8
  * Author: Sucuri Inc.
9
  * Text Domain: sucuri-scanner
10
  * Domain Path: /lang
11
+ * Version: 1.8.24
12
  *
13
  * PHP version 5
14
  *
85
  /**
86
  * Current version of the plugin's code.
87
  */
88
+ define('SUCURISCAN_VERSION', '1.8.24');
89
 
90
  /**
91
  * Defines the human readable name of the plugin.