Name. */ const SUITE = array( '360-orbit-login-guard' => '360 Orbit Login Guard', '360-orbit-header-security' => '360 Orbit Header Security', '360-orbit-security-digest' => '360 Orbit Security Digest', ); /** * Pruefpunkte aller aktiven Security-Plugins. * * Jeder Punkt: array( 'plugin' => Slug, 'label' => Text, 'status' => * 'ok'|'warn'|'info', 'hint' => Text, 'url' => Link zur Einstellung ). * * @return array */ public static function checks() { $checks = array(); foreach ( (array) apply_filters( 'wp360_security_checks', array() ) as $check ) { if ( ! is_array( $check ) || empty( $check['label'] ) || empty( $check['plugin'] ) ) { continue; } $checks[] = array( 'plugin' => (string) $check['plugin'], 'label' => (string) $check['label'], 'status' => in_array( $check['status'] ?? '', array( 'ok', 'warn', 'info' ), true ) ? $check['status'] : 'info', 'hint' => (string) ( $check['hint'] ?? '' ), 'url' => (string) ( $check['url'] ?? '' ), ); } return $checks; } /** Slugs der Suite, die keine Pruefpunkte melden (nicht aktiv). */ public static function missing( array $checks ) { $present = array_unique( array_column( $checks, 'plugin' ) ); return array_values( array_diff( array_keys( self::SUITE ), $present ) ); } /** * Reihenfolge nach Dringlichkeit: nicht erfuellte Punkte (warn), dann * offene Hinweise (info), dann fehlende Plugins. Erfuellte Punkte stehen * zugeklappt darunter und erscheinen erst auf Klick. * * @param array $checks Pruefpunkte. * @return array{warn:array,info:array,ok:array} */ public static function grouped( array $checks ) { $groups = array( 'warn' => array(), 'info' => array(), 'ok' => array(), ); foreach ( $checks as $check ) { $groups[ $check['status'] ][] = $check; } return $groups; } /** * Meldet den Kasten fuer die Uebersicht „360 WP Orbit“ (und optional das * WordPress-Dashboard) an. Alle drei Plugins melden dieselbe Kennung. * * @param array $panels Kaesten. * @return array */ public static function register_panel( $panels ) { $panels['security'] = array( 'title' => self::text( 'title' ), 'render' => array( __CLASS__, 'render' ), 'priority' => 10, ); return $panels; } /** Gibt den Inhalt des Kastens aus (Titel und Rahmen setzt die Uebersicht). */ public static function render() { $checks = self::checks(); $missing = self::missing( $checks ); $groups = self::grouped( $checks ); $warns = count( $groups['warn'] ); $icons = array( 'ok' => array( 'yes-alt', '#00a32a' ), 'warn' => array( 'warning', '#dba617' ), 'info' => array( 'info-outline', '#72aee6' ), ); ?>

$icons Symbol und Farbe je Status. */ private static function render_item( array $check, array $icons ) { ?>