*/ public static function info( Connection $connection ): array { global $wp_version; $settings = Settings::all(); $check = Installation_Check::last(); $error = State::get( 'last_api_error' ); $meta = Connection::stored_metadata(); return array( 'plugin' => STAND_CHAT_VERSION, 'wordpress' => $wp_version, 'php' => PHP_VERSION, 'multisite' => is_multisite(), 'environment' => Environment::type(), 'stand' => Service_Urls::get( 'environment' ), 'homeDomain' => Environment::home_domain(), 'siteId' => $settings['site_id'], 'chatEnabled' => $settings['chat_enabled'], 'consent' => $settings['consent']['mode'], 'loader' => $settings['loader'], 'connection' => $connection->is_connected() ? ( $connection->needs_reconnect() ? 'reconnect needed' : 'OK ยท tokens stored encrypted (not shown)' ) : 'not connected', 'client' => Connection::client_id(), 'endsAt' => (string) ( $meta['expires_at'] ?? '' ), 'role' => (string) ( $meta['role'] ?? '' ), 'lastCheck' => $check ? array( 'status' => (string) $check['status'], 'url' => (string) $check['url'], 'at' => gmdate( 'c', (int) $check['checkedAt'] ), ) : null, 'lastApiError' => is_array( $error ) ? array( 'code' => (string) $error['code'], 'call' => (string) $error['call'], 'status' => (int) $error['status'], 'at' => gmdate( 'c', (int) $error['at'] ), ) : null, 'optimizers' => array_map( static function ( $optimizer ) { return $optimizer['name']; }, Optimizers::detected() ), 'theme' => wp_get_theme()->get( 'Name' ), 'blockTheme' => wp_is_block_theme(), ); } }