Files
argus-wp-defence/admin/views/vulnerabilities.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

118 lines
7.1 KiB
PHP

<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$argus_active_page = 'vulnerabilities';
include ARGUS_WPD_DIR . 'admin/views/partials/header.php';
$type_labels = array(
'core' => __( 'Core', 'argus-wordpress-defence' ),
'plugin' => __( 'Plugin', 'argus-wordpress-defence' ),
'theme' => __( 'Theme', 'argus-wordpress-defence' ),
);
$status_display = array(
Argus_Vuln_Intel::STATUS_CLEAN => array( 'icon' => '&#10003;', 'label' => __( 'No Known Vulnerabilities', 'argus-wordpress-defence' ), 'color' => 'var(--emerald)' ),
Argus_Vuln_Intel::STATUS_PENDING => array( 'icon' => '&#9888;', 'label' => __( 'Check Pending', 'argus-wordpress-defence' ), 'color' => 'var(--amber)' ),
Argus_Vuln_Intel::STATUS_UNAVAILABLE => array( 'icon' => '&#9888;', 'label' => __( 'Intelligence Temporarily Unavailable', 'argus-wordpress-defence' ), 'color' => 'var(--amber)' ),
Argus_Vuln_Intel::STATUS_VULNERABLE => array( 'icon' => '&#128308;', 'label' => __( 'Vulnerability Detected', 'argus-wordpress-defence' ), 'color' => 'var(--rose)' ),
);
$severity_labels = array(
'critical' => __( 'Critical', 'argus-wordpress-defence' ),
'high' => __( 'High', 'argus-wordpress-defence' ),
'medium' => __( 'Medium', 'argus-wordpress-defence' ),
'low' => __( 'Low', 'argus-wordpress-defence' ),
);
$date_format = 'd M Y, H:i';
$last_check_display = $vuln_status['last_check'] ? wp_date( $date_format, strtotime( $vuln_status['last_check'] . ' UTC' ) ) : '';
$next_check_display = $vuln_status['next_check'] ? wp_date( $date_format, strtotime( $vuln_status['next_check'] . ' UTC' ) ) : '';
?>
<h1 class="argus-wpd-page-title"><?php esc_html_e( 'Vulnerability Protection', 'argus-wordpress-defence' ); ?></h1>
<div class="argus-wpd-status-row">
<div class="argus-wpd-status-chip <?php echo 'active' === $vuln_status['protection'] ? 'chip-emerald' : 'chip-off'; ?>">
<span class="dot"></span>
<span class="state"><?php echo 'active' === $vuln_status['protection'] ? esc_html__( 'ACTIVE', 'argus-wordpress-defence' ) : esc_html__( 'STARTING...', 'argus-wordpress-defence' ); ?></span>
</div>
</div>
<p style="color:var(--muted);font-size:13px;margin:0 0 20px;"><?php esc_html_e( 'ARGUS checks WordPress, installed plugins and themes for known security issues.', 'argus-wordpress-defence' ); ?></p>
<div class="argus-wpd-metric-grid">
<?php foreach ( $severity_labels as $key => $label ) : ?>
<div class="argus-wpd-metric-card">
<div class="argus-wpd-metric-label"><?php echo esc_html( $label ); ?></div>
<div class="argus-wpd-metric-value" style="color:<?php echo esc_attr( array( 'critical' => 'var(--rose)', 'high' => 'var(--orange)', 'medium' => 'var(--amber)', 'low' => 'var(--cyan)' )[ $key ] ); ?>"><?php echo esc_html( number_format_i18n( $severity_counts[ $key ] ) ); ?></div>
</div>
<?php endforeach; ?>
</div>
<div class="argus-wpd-panel">
<p style="font-size:14px;color:var(--text);margin:0 0 20px;"><?php esc_html_e( 'ARGUS Defence automatically checks WordPress core, installed plugins, and themes against continuously updated vulnerability intelligence.', 'argus-wordpress-defence' ); ?></p>
<table class="widefat" style="border:none;background:transparent;">
<tbody>
<tr>
<td style="border:none;padding:10px 0;color:var(--faint);font-size:12.5px;text-transform:uppercase;letter-spacing:.04em;width:45%;"><?php esc_html_e( 'Last Vulnerability Check', 'argus-wordpress-defence' ); ?></td>
<td style="border:none;padding:10px 0;font-size:14px;color:var(--text);font-weight:600;"><?php echo $last_check_display ? esc_html( $last_check_display ) : esc_html__( 'Pending', 'argus-wordpress-defence' ); ?></td>
</tr>
<tr>
<td style="border:none;padding:10px 0;color:var(--faint);font-size:12.5px;text-transform:uppercase;letter-spacing:.04em;"><?php esc_html_e( 'Next Vulnerability Check', 'argus-wordpress-defence' ); ?></td>
<td style="border:none;padding:10px 0;font-size:14px;color:var(--text);font-weight:600;"><?php echo $next_check_display ? esc_html( $next_check_display ) : esc_html__( 'Pending', 'argus-wordpress-defence' ); ?></td>
</tr>
</tbody>
</table>
</div>
<div class="argus-wpd-panel">
<table class="widefat striped">
<thead>
<tr>
<th><?php esc_html_e( 'Type', 'argus-wordpress-defence' ); ?></th>
<th><?php esc_html_e( 'Component', 'argus-wordpress-defence' ); ?></th>
<th><?php esc_html_e( 'Installed Version', 'argus-wordpress-defence' ); ?></th>
<th><?php esc_html_e( 'Status', 'argus-wordpress-defence' ); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ( $vuln_status['components'] as $component ) : ?>
<?php $display = $status_display[ $component['status'] ] ?? $status_display[ Argus_Vuln_Intel::STATUS_PENDING ]; ?>
<tr>
<td><?php echo esc_html( $type_labels[ $component['type'] ] ?? ucfirst( $component['type'] ) ); ?></td>
<td><?php echo esc_html( $component['name'] ); ?></td>
<td><code><?php echo esc_html( $component['installed_version'] ?: '—' ); ?></code></td>
<td>
<span style="color:<?php echo esc_attr( $display['color'] ); ?>;font-weight:600;"><?php echo $display['icon']; // phpcs:ignore WordPress.Security.EscapeOutput ?> <?php echo esc_html( $display['label'] ); ?></span>
<?php if ( Argus_Vuln_Intel::STATUS_VULNERABLE === $component['status'] ) : ?>
<div style="margin-top:8px;font-size:12.5px;color:var(--faint);line-height:1.8;">
<div><?php esc_html_e( 'Severity:', 'argus-wordpress-defence' ); ?> <strong style="color:var(--text);"><?php echo esc_html( $severity_labels[ $component['severity'] ] ?? ucfirst( (string) $component['severity'] ) ); ?></strong></div>
<?php if ( $component['fixed_in'] ) : ?>
<div><?php esc_html_e( 'Safe Version:', 'argus-wordpress-defence' ); ?> <strong style="color:var(--text);"><?php echo esc_html( $component['fixed_in'] ); ?></strong></div>
<div><?php esc_html_e( 'Recommended Action:', 'argus-wordpress-defence' ); ?> <strong style="color:var(--text);"><?php echo esc_html( sprintf( __( 'Update to %s', 'argus-wordpress-defence' ), $component['fixed_in'] ) ); ?></strong></div>
<?php else : ?>
<div><?php esc_html_e( 'Recommended Action:', 'argus-wordpress-defence' ); ?> <strong style="color:var(--text);"><?php esc_html_e( 'Deactivate the affected component until a fix is available', 'argus-wordpress-defence' ); ?></strong></div>
<?php endif; ?>
</div>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php
$page = $components_page;
$total_pages = $components_total_pages;
$base_url = remove_query_arg( 'paged' );
include ARGUS_WPD_DIR . 'admin/views/partials/pagination.php';
?>
</div>
<p style="color:var(--muted);font-size:13px;margin:0 0 24px;"><?php esc_html_e( 'A detected vulnerability with a remediation action also appears as a finding on the', 'argus-wordpress-defence' ); ?> <a href="<?php echo esc_url( admin_url( 'admin.php?page=argus-wpd-findings' ) ); ?>" style="color:var(--cyan);font-weight:600;text-decoration:none"><?php esc_html_e( 'Findings page', 'argus-wordpress-defence' ); ?></a>.</p>
<?php include ARGUS_WPD_DIR . 'admin/views/partials/footer.php'; ?>