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 ) ); } /** Gibt den Kasten aus. */ public static function render() { $checks = self::checks(); $missing = self::missing( $checks ); $warns = count( array_filter( array_column( $checks, 'status' ), function ( $status ) { return 'warn' === $status; } ) ); $icons = array( 'ok' => array( 'yes-alt', '#00a32a' ), 'warn' => array( 'warning', '#dba617' ), 'info' => array( 'info-outline', '#72aee6' ), ); ?>