[ label, description, css class ]. The values * come from the live REST response ("summary"), refreshed every 15 seconds. */ public static function cards() { $levels = Risk::levels(); $cards = [ /* translators: %d: seconds */ 'active' => [ __( 'Active now', 'netdesign-session-guard' ), sprintf( __( 'Users active on the site in the last %d seconds.', 'netdesign-session-guard' ), (int) Settings::get( 'active_window' ) ) ], 'weak_today' => [ __( 'Weak today', 'netdesign-session-guard' ), $levels[ Risk::WEAK ][2], 'is-weak' ], 'medium_today' => [ __( 'Medium today', 'netdesign-session-guard' ), $levels[ Risk::MEDIUM ][2], 'is-medium' ], 'strong_today' => [ __( 'Strong and above today', 'netdesign-session-guard' ), $levels[ Risk::STRONG ][2] ?: $levels[ Risk::VERY_STRONG ][2], 'is-strong' ], ]; // A level that can't happen with the current data (no description) has no card. if ( '' === $levels[ Risk::MEDIUM ][2] ) { unset( $cards['medium_today'] ); } /** * Cards at the top of the Live screen (Session Guard Pro adds "Playing now"). * * @param array $cards key => [ label, description, css class ] */ return (array) apply_filters( 'ndsg_live_cards', $cards ); } public function render() { $enforcing = Enforcer::enforcing(); ?>