# wp_check_browser_version()

URL: https://chugunov.pro/api-wordpress/functions/wp_check_browser_version/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 3.2.0.

## Сигнатура

```php
wp_check_browser_version(): array|false
```

## Описание

Проверяет, нужно ли пользователю обновить браузер.

## Возвращаемое значение

`array|false`

## Исходный код

Файл: `wp-admin/includes/dashboard.php:1819`

```php
function wp_check_browser_version() {
	if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
		return false;
	}

	$key = md5( $_SERVER['HTTP_USER_AGENT'] );

	$response = get_site_transient( 'browser_' . $key );

	if ( false === $response ) {
		$url     = 'https://api.wordpress.org/core/browse-happy/1.1/';
		$options = array(
			'body'       => array( 'useragent' => $_SERVER['HTTP_USER_AGENT'] ),
			'user-agent' => 'WordPress/' . wp_get_wp_version() . '; ' . home_url( '/' ),
		);

		if ( wp_http_supports( array( 'ssl' ) ) ) {
			$url = set_url_scheme( $url, 'https' );
		}

		$response = wp_remote_post( $url, $options );

		if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
			return false;
		}

		/**
		 * Response should be an array with:
		 *  'platform' - string - A user-friendly platform name, if it can be determined
		 *  'name' - string - A user-friendly browser name
		 *  'version' - string - The version of the browser the user is using
		 *  'current_version' - string - The most recent version of the browser
		 *  'upgrade' - boolean - Whether the browser needs an upgrade
		 *  'insecure' - boolean - Whether the browser is deemed insecure
		 *  'update_url' - string - The url to visit to upgrade
		 *  'img_src' - string - An image representing the browser
		 *  'img_src_ssl' - string - An image (over SSL) representing the browser
		 */
		$response = json_decode( wp_remote_retrieve_body( $response ), true );

		if ( ! is_array( $response ) ) {
			return false;
		}

		set_site_transient( 'browser_' . $key, $response, WEEK_IN_SECONDS );
	}

	return $response;
}
```

## История изменений

- 3.2.0 — Introduced.

## Связанные

Использует: [`wp_get_wp_version`](https://chugunov.pro/api-wordpress/functions/wp_get_wp_version/), [`set_url_scheme`](https://chugunov.pro/api-wordpress/functions/set_url_scheme/), [`wp_http_supports`](https://chugunov.pro/api-wordpress/functions/wp_http_supports/), [`wp_remote_post`](https://chugunov.pro/api-wordpress/functions/wp_remote_post/), [`wp_remote_retrieve_response_code`](https://chugunov.pro/api-wordpress/functions/wp_remote_retrieve_response_code/), [`wp_remote_retrieve_body`](https://chugunov.pro/api-wordpress/functions/wp_remote_retrieve_body/), [`set_site_transient`](https://chugunov.pro/api-wordpress/functions/set_site_transient/), [`home_url`](https://chugunov.pro/api-wordpress/functions/home_url/), [`get_site_transient`](https://chugunov.pro/api-wordpress/functions/get_site_transient/), [`is_wp_error`](https://chugunov.pro/api-wordpress/functions/is_wp_error/).
Используется в: [`dashboard_browser_nag_class`](https://chugunov.pro/api-wordpress/functions/dashboard_browser_nag_class/), [`wp_dashboard_browser_nag`](https://chugunov.pro/api-wordpress/functions/wp_dashboard_browser_nag/), [`wp_dashboard_setup`](https://chugunov.pro/api-wordpress/functions/wp_dashboard_setup/).

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/wp_check_browser_version/
