# wp_start_scraping_edited_file_errors()

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

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

## Сигнатура

```php
wp_start_scraping_edited_file_errors()
```

## Описание

Начинает сбор ошибок отредактированного файла.

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

Файл: `wp-includes/load.php:1846`

```php
function wp_start_scraping_edited_file_errors() {
	if ( ! isset( $_REQUEST['wp_scrape_key'] ) || ! isset( $_REQUEST['wp_scrape_nonce'] ) ) {
		return;
	}

	$key   = substr( sanitize_key( wp_unslash( $_REQUEST['wp_scrape_key'] ) ), 0, 32 );
	$nonce = wp_unslash( $_REQUEST['wp_scrape_nonce'] );
	if ( empty( $key ) || empty( $nonce ) ) {
		return;
	}

	$transient = get_transient( 'scrape_key_' . $key );
	if ( false === $transient ) {
		return;
	}

	if ( $transient !== $nonce ) {
		if ( ! headers_sent() ) {
			header( 'X-Robots-Tag: noindex' );
			nocache_headers();
		}
		echo "###### wp_scraping_result_start:$key ######";
		echo wp_json_encode(
			array(
				'code'    => 'scrape_nonce_failure',
				'message' => __( 'Scrape key check failed. Please try again.' ),
			)
		);
		echo "###### wp_scraping_result_end:$key ######";
		die();
	}

	if ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) {
		define( 'WP_SANDBOX_SCRAPING', true );
	}

	register_shutdown_function( 'wp_finalize_scraping_edited_file_errors', $key );
}
```

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

- 4.9.0 — Introduced.

## Связанные

Использует: [`nocache_headers`](https://chugunov.pro/api-wordpress/functions/nocache_headers/), [`get_transient`](https://chugunov.pro/api-wordpress/functions/get_transient/), [`wp_json_encode`](https://chugunov.pro/api-wordpress/functions/wp_json_encode/), [`__`](https://chugunov.pro/api-wordpress/functions/__/), [`wp_unslash`](https://chugunov.pro/api-wordpress/functions/wp_unslash/), [`sanitize_key`](https://chugunov.pro/api-wordpress/functions/sanitize_key/).

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