time(), 'expires_at' => time() + 1800, 'reason' => 'manual', ), 1800 ); Security_Events_Entity::log_event( Security_Events_Entity::EVENT_INCIDENT, Security_Events_Entity::SEVERITY_HIGH, '', 'Manual lockdown activated by admin', array( 'activated_at' => time(), 'duration' => 1800, ) ); \add_settings_error( 'advan_security', 'lockdown_activated', \__( 'Lockdown has been activated for 30 minutes.', '0-day-analytics' ), 'warning' ); } } /** * Render the security dashboard page. * * @return void * * @since 5.2.0 */ public static function render(): void { if ( ! \current_user_can( 'manage_options' ) ) { \wp_die( \esc_html__( 'You do not have sufficient permissions to access this page.', '0-day-analytics' ) ); } \wp_enqueue_style( 'media-views' ); ?> modify( '-6 days' )->format( 'Y-m-d' ); $end = $now->format( 'Y-m-d' ); $summary = Security_Events_Entity::get_event_summary( $start, $end ); $total_events = 0; $critical_events = 0; $blocked_count = 0; $incident_count = 0; foreach ( $summary as $row ) { $total_events += (int) $row['total']; if ( Security_Events_Entity::SEVERITY_CRITICAL === $row['severity'] ) { $critical_events += (int) $row['total']; } if ( Security_Events_Entity::EVENT_BLOCKED === $row['event_type'] ) { $blocked_count += (int) $row['total']; } if ( Security_Events_Entity::EVENT_INCIDENT === $row['event_type'] ) { $incident_count += (int) $row['total']; } } // Create and prepare the list table. $list_table = new Security_List(); $list_table->prepare_items(); ?>


⚠ —
', \esc_attr( $page ) ); printf( '', \esc_attr( (string) $paged ) ); echo '
'; $list_table->search_box( \__( 'Search Events', '0-day-analytics' ), 'security-events-find' ); echo '
'; $list_table->display(); ?>