/** * Schedule the activity report cron job. */ public static function scheduleCronJob() { self::clearCronJobs(); if (!wfConfig::get('email_summary_enabled', 1)) { return; } if (is_main_site()) { list(, $end_time) = wfActivityReport::getReportDateRange(); wp_schedule_single_event($end_time, 'wordfence_email_activity_report'); } }
/** * Returns list of firewall activity up to $limit number of entries. * * @param int $limit Max events to return in results * @return array */ public function getRecentFirewallActivity($limit = 300, &$remainder) { $dateRange = wfActivityReport::getReportDateRange(); $recent_firewall_activity = new wfRecentFirewallActivity(null, max(604800, $dateRange[1] - $dateRange[0])); $recent_firewall_activity->run(); return $recent_firewall_activity->mostRecentActivity($limit, $remainder); }