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.
99 lines
4.1 KiB
PHP
99 lines
4.1 KiB
PHP
<?php
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit;
|
|
}
|
|
|
|
$argus_active_page = 'findings';
|
|
include ARGUS_WPD_DIR . 'admin/views/partials/header.php';
|
|
|
|
$view_labels = array(
|
|
'active' => __( 'Active', 'argus-wordpress-defence' ),
|
|
'needs_attention' => __( 'Needs Attention', 'argus-wordpress-defence' ),
|
|
'resolved' => __( 'Resolved', 'argus-wordpress-defence' ),
|
|
'accepted' => __( 'Accepted', 'argus-wordpress-defence' ),
|
|
);
|
|
|
|
$donut_data = array();
|
|
foreach ( $view_labels as $key => $label ) {
|
|
if ( ( $view_counts[ $key ] ?? 0 ) > 0 ) {
|
|
$donut_data[ $label ] = $view_counts[ $key ];
|
|
}
|
|
}
|
|
?>
|
|
|
|
<h1 class="argus-wpd-page-title"><?php esc_html_e( 'Findings', 'argus-wordpress-defence' ); ?></h1>
|
|
<p style="color:var(--muted);font-size:13px;margin:0 0 20px;"><?php esc_html_e( 'Everything ARGUS has found, organized by what still needs your attention.', 'argus-wordpress-defence' ); ?></p>
|
|
|
|
<?php if ( ! empty( $action_result ) ) : ?>
|
|
<div class="notice <?php echo $action_result['success'] ? 'notice-success' : 'notice-error'; ?>" style="padding:14px 18px;margin:0 0 20px;">
|
|
<p style="margin:0"><?php echo esc_html( $action_result['message'] ); ?></p>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?php if ( ! empty( $findings_notice ) ) : ?>
|
|
<div class="notice notice-success" style="padding:14px 18px;margin:0 0 20px;">
|
|
<p style="margin:0"><?php echo esc_html( $findings_notice ); ?></p>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?php if ( ! empty( $donut_data ) ) : ?>
|
|
<div class="argus-wpd-panel">
|
|
<h2><?php esc_html_e( 'Finding Status', 'argus-wordpress-defence' ); ?></h2>
|
|
<div class="argus-wpd-donut-row">
|
|
<?php echo Argus_Charts::donut( $donut_data ); // phpcs:ignore WordPress.Security.EscapeOutput ?>
|
|
<?php echo Argus_Charts::legend( $donut_data ); // phpcs:ignore WordPress.Security.EscapeOutput ?>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<div class="argus-wpd-range-tabs" style="margin-bottom:20px;flex-wrap:wrap;">
|
|
<?php foreach ( $view_labels as $key => $label ) : ?>
|
|
<a href="<?php echo esc_url( admin_url( 'admin.php?page=argus-wpd-findings&view=' . $key ) ); ?>" class="<?php echo $key === $view ? 'active' : ''; ?>"><?php echo esc_html( $label ); ?> (<?php echo esc_html( number_format_i18n( $view_counts[ $key ] ?? 0 ) ); ?>)</a>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
|
|
<div class="argus-wpd-panel">
|
|
<div style="display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;margin-bottom:16px;">
|
|
<h2 style="margin:0"><?php echo esc_html( $view_labels[ $view ] ); ?></h2>
|
|
<?php if ( in_array( $view, array( 'active', 'needs_attention' ), true ) && ! empty( $findings ) ) : ?>
|
|
<form method="post" onsubmit="return confirm('<?php echo esc_js( __( 'Mark every currently open finding as resolved? This does not undo anything ARGUS already did -- it only clears them from your review queue.', 'argus-wordpress-defence' ) ); ?>')">
|
|
<?php wp_nonce_field( 'argus_wpd_resolve_all_open', 'argus_wpd_resolve_all_nonce' ); ?>
|
|
<button type="submit" class="button"><?php esc_html_e( 'Resolve All Open', 'argus-wordpress-defence' ); ?></button>
|
|
</form>
|
|
<?php endif; ?>
|
|
</div>
|
|
<?php if ( empty( $findings ) ) : ?>
|
|
<p class="argus-wpd-empty">
|
|
<?php
|
|
switch ( $view ) {
|
|
case 'needs_attention':
|
|
esc_html_e( 'Nothing needs your attention right now.', 'argus-wordpress-defence' );
|
|
break;
|
|
case 'resolved':
|
|
esc_html_e( 'No resolved findings yet.', 'argus-wordpress-defence' );
|
|
break;
|
|
case 'accepted':
|
|
esc_html_e( 'No accepted-risk findings yet.', 'argus-wordpress-defence' );
|
|
break;
|
|
default:
|
|
esc_html_e( 'No active findings -- your site is clear.', 'argus-wordpress-defence' );
|
|
}
|
|
?>
|
|
</p>
|
|
<?php else : ?>
|
|
<div class="argus-wpd-finding-list">
|
|
<?php foreach ( $findings as $finding ) : ?>
|
|
<?php $argus_compact = false; include ARGUS_WPD_DIR . 'admin/views/partials/finding-card.php'; ?>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<?php
|
|
$base_url = remove_query_arg( array( 'finding', 'paged' ) );
|
|
$argus_page_param = 'paged';
|
|
include ARGUS_WPD_DIR . 'admin/views/partials/pagination.php';
|
|
include ARGUS_WPD_DIR . 'admin/views/partials/footer.php';
|
|
?>
|