admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('aegis_run_scan') ]); } }); add_action('wp_ajax_aegis_run_scan', function () { check_ajax_referer('aegis_run_scan'); $results = aegis_shield_run_scan(); ob_start(); echo '
' . sprintf( /* translators: %d is the number of PHP files scanned. */ esc_html__('%d PHP files scanned.', 'aegis-shield'), esc_html($results['scanned_files']) ) . '
'; if (!empty($results['suspicious_matches'])) { echo '' . esc_html($m['snippet']) . '' . esc_html__('No suspicious code found.', 'aegis-shield') . '
'; } if (!empty($results['integrity_issues'])) { echo '
Your journey to a more secure WordPress site starts here. By clicking the scan button below, Aegis Shield will perform an initial baseline scan of your entire site.
This scan helps us understand the current state of your files, and it forms the foundation for all future integrity checks.
Letβs lock things down and keep the bad guys out β one scan at a time.
Welcome back! You're just one click away from making sure your site is still clean and secure.
This scan checks your site for any file changes or suspicious activity by comparing against your most recent scan.
Stay proactive β run scans regularly for maximum peace of mind.
' . esc_html__('Blocked IP list updated successfully.', 'aegis-shield') . '
' . esc_html__('IP blocked successfully.', 'aegis-shield') . '
' . esc_html__('IP unblocked successfully.', 'aegis-shield') . '
' . esc_html__('Log entry deleted.', 'aegis-shield') . '
| ' . esc_html__('IP Address', 'aegis-shield') . ' | ' . esc_html__('Action', 'aegis-shield') . ' |
|---|---|
| ' . esc_html($ip) . ' | ' . esc_html__('Unblock', 'aegis-shield') . ' |
' . esc_html__('No IP addresses are currently blocked.', 'aegis-shield') . '
'; } echo '| ' . esc_html__('Time', 'aegis-shield') . ' | ' . esc_html__('Username', 'aegis-shield') . ' | ' . esc_html__('IP Address', 'aegis-shield') . ' | ' . esc_html__('Action', 'aegis-shield') . ' |
|---|---|---|---|
| ' . esc_html($log['time']) . ' | '; echo '' . esc_html($log['username']) . ' | '; echo '' . esc_html($log['ip']) . ' | '; echo ''; if (!in_array($log['ip'], $blocked, true)) { $block_url = wp_nonce_url(admin_url('admin.php?page=aegis-shield&tab=ips&block_ip=' . urlencode($log['ip'])), 'aegis_shield_block_ip'); echo '' . esc_html__('Block', 'aegis-shield') . ' '; } else { echo '' . esc_html__('Blocked', 'aegis-shield') . ' '; } $delete_url = wp_nonce_url(admin_url('admin.php?page=aegis-shield&tab=ips&delete_log=' . $index), 'aegis_shield_delete_log'); echo '' . esc_html__('Delete', 'aegis-shield') . ''; echo ' |
' . esc_html__('No failed login attempts recorded yet.', 'aegis-shield') . '
'; } break; case 'cron': if (isset($_POST['save_cron_settings']) && check_admin_referer('aegis_shield_cron_settings')) { $enabled = isset($_POST['enable_cron']) ? '1' : '0'; $frequency = 'weekly'; // Default if (isset($_POST['cron_frequency'])) { $raw_frequency = sanitize_text_field(wp_unslash($_POST['cron_frequency'])); $allowed_frequencies = ['daily', 'weekly', 'monthly', 'manual']; if (in_array($raw_frequency, $allowed_frequencies, true)) { $frequency = $raw_frequency; } } update_option('aegis_shield_cron_enabled', $enabled); update_option('aegis_shield_cron_frequency', $frequency); wp_clear_scheduled_hook('aegis_shield_cron_scan'); if ($enabled === '1') { wp_schedule_event(time(), $frequency, 'aegis_shield_cron_scan'); } echo '' . esc_html__('Cron settings saved.', 'aegis-shield') . '
Get access to advanced scan history, suspicious code insights, premium support, and more β all backed by our expert security team.