0 ? [get_home_url($blog_id, '/'), get_admin_url($blog_id, 'admin-ajax.php')] : [home_url('/'), admin_url('admin-ajax.php')]; foreach ($urls as $url) { $response = wp_remote_get(add_query_arg('relay-check', (string) time(), $url), [ 'timeout' => 15, 'redirection' => 3, 'sslverify' => false, 'headers' => ['Cache-Control' => 'no-cache'], ]); if (is_wp_error($response)) { $unknown = $url . ': ' . $response->get_error_message(); continue; } $code = (int) wp_remote_retrieve_response_code($response); $body = (string) wp_remote_retrieve_body($response); if ($code >= 500 || stripos($body, 'There has been a critical error on this website') !== false) { /* translators: 1: URL, 2: HTTP status code */ return ['status' => self::BROKEN, 'detail' => sprintf(__('%1$s answered HTTP %2$d', 'siterelay'), $url, $code)]; } } return $unknown === '' ? ['status' => self::OK, 'detail' => ''] : ['status' => self::UNKNOWN, 'detail' => $unknown]; } }