Files
argus-wp-defence/admin/views/audit-log.php
T
root df0f2fccb8 ARGUS WordPress Defence 1.0.0 — first production release
Automatic WordPress security: local firewall, malware and file-integrity
scanning, vulnerability protection, quarantine, scheduled backups, an
optional page cache, and automatic global threat intelligence.

See README.md for installation, update, and uninstall instructions.
2026-08-09 13:40:16 +00:00

83 lines
3.7 KiB
PHP

<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$argus_active_page = 'audit-log';
include ARGUS_WPD_DIR . 'admin/views/partials/header.php';
$severity_colors = array(
'critical' => 'var(--rose)',
'high' => 'var(--orange)',
'medium' => 'var(--amber)',
'low' => 'var(--cyan)',
'info' => 'var(--faint)',
);
?>
<h1 class="argus-wpd-page-title"><?php esc_html_e( 'Audit Log', 'argus-wordpress-defence' ); ?></h1>
<p style="color:var(--muted);font-size:13px;margin:0 0 24px;"><?php esc_html_e( 'Every event ARGUS has recorded -- system-detected and administrator-initiated.', 'argus-wordpress-defence' ); ?></p>
<form method="get" class="argus-wpd-inline-form" style="margin-bottom:16px;">
<input type="hidden" name="page" value="argus-wpd-audit-log" />
<input type="text" name="s" value="<?php echo esc_attr( $search ); ?>" placeholder="<?php esc_attr_e( 'Search events…', 'argus-wordpress-defence' ); ?>" />
<select name="severity">
<option value=""><?php esc_html_e( 'All Severities', 'argus-wordpress-defence' ); ?></option>
<?php foreach ( array( 'critical', 'high', 'medium', 'low', 'info' ) as $sev ) : ?>
<option value="<?php echo esc_attr( $sev ); ?>" <?php selected( $severity, $sev ); ?>><?php echo esc_html( ucfirst( $sev ) ); ?></option>
<?php endforeach; ?>
</select>
<select name="type">
<option value=""><?php esc_html_e( 'All Types', 'argus-wordpress-defence' ); ?></option>
<?php foreach ( $event_types as $t ) : ?>
<option value="<?php echo esc_attr( $t ); ?>" <?php selected( $type, $t ); ?>><?php echo esc_html( ucwords( str_replace( '_', ' ', $t ) ) ); ?></option>
<?php endforeach; ?>
</select>
<select name="range">
<option value=""><?php esc_html_e( 'All Time', 'argus-wordpress-defence' ); ?></option>
<option value="24h" <?php selected( $range, '24h' ); ?>><?php esc_html_e( 'Last 24 Hours', 'argus-wordpress-defence' ); ?></option>
<option value="7d" <?php selected( $range, '7d' ); ?>><?php esc_html_e( 'Last 7 Days', 'argus-wordpress-defence' ); ?></option>
<option value="30d" <?php selected( $range, '30d' ); ?>><?php esc_html_e( 'Last 30 Days', 'argus-wordpress-defence' ); ?></option>
</select>
<button type="submit" class="button"><?php esc_html_e( 'Filter', 'argus-wordpress-defence' ); ?></button>
<?php if ( $search || $severity || $type || $range ) : ?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=argus-wpd-audit-log' ) ); ?>" class="button"><?php esc_html_e( 'Clear', 'argus-wordpress-defence' ); ?></a>
<?php endif; ?>
</form>
<div class="argus-wpd-panel">
<?php if ( empty( $events ) ) : ?>
<p class="argus-wpd-empty"><?php esc_html_e( 'No events recorded yet.', 'argus-wordpress-defence' ); ?></p>
<?php else : ?>
<table class="widefat striped">
<thead>
<tr>
<th><?php esc_html_e( 'Time', 'argus-wordpress-defence' ); ?></th>
<th><?php esc_html_e( 'Actor', 'argus-wordpress-defence' ); ?></th>
<th><?php esc_html_e( 'Event', 'argus-wordpress-defence' ); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ( $events as $event ) : ?>
<?php $actor = $event->payload['actor'] ?? __( 'ARGUS', 'argus-wordpress-defence' ); ?>
<tr>
<td><?php echo esc_html( human_time_diff( strtotime( $event->created_at . ' UTC' ) ) ); ?> <?php esc_html_e( 'ago', 'argus-wordpress-defence' ); ?></td>
<td><code><?php echo esc_html( $actor ); ?></code></td>
<td>
<span style="color:<?php echo esc_attr( $severity_colors[ $event->severity ] ?? 'var(--muted)' ); ?>">&#9679;</span>
<?php echo esc_html( $event->summary ); ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
<?php
$base_url = remove_query_arg( 'paged' );
include ARGUS_WPD_DIR . 'admin/views/partials/pagination.php';
include ARGUS_WPD_DIR . 'admin/views/partials/footer.php';
?>