wp_start_scraping_edited_file_errors()
- Since
- 4.9.0
- Source
wp-includes/load.php:1815
Compatibility
- WordPress
- since 4.9.0
- PHP
- 7.4–8.6-dev
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.
Performance profile
How much work a call to wp_start_scraping_edited_file_errors() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.
- Cost class
- Moderate
- Scaling
- Constant
- Instructions
- 4–72
- Plugin surface
- None
- Called by
- 0
Reads stored settings via get_option(), cached per request but not free on a cold cache.
No loop in the body: the same number of instructions runs whatever you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 75.
Nothing here hands control to plugin code.
Nothing in core calls this; the cost is only what you spend yourself.
What it touches
- transienttransient
get_transient()called directly - hookthird-party callbacks
apply_filters()one call below wp_start_scraping_edited_file_errors() - cacheobject cache
wp_cache_get()one call below wp_start_scraping_edited_file_errors() - optionoption read or write
get_option()one call below wp_start_scraping_edited_file_errors()
Further down the call graph this can also reach serialize and query. Those are the worst case, several calls deep and usually down an error path, not what a normal call pays.
What one call costs · 6 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost wp_start_scraping_edited_file_errors() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
!isset($value) | 4–7 | none |
isset($value) | 27–29 | wp_unslash(), sanitize_key(), wp_unslash() |
isset($value) && !empty($key) && !empty($nonce) && $transient === false | 36 | wp_unslash(), sanitize_key(), wp_unslash(), get_transient() |
isset($value) && !empty($key) && !empty($nonce) | 44–45 | wp_unslash(), sanitize_key(), wp_unslash(), get_transient(), register_shutdown_function() |
isset($value) && !empty($key) && !empty($nonce) && $transient !== false && headers_sent() | 66–67 | wp_unslash(), sanitize_key(), wp_unslash(), get_transient(), headers_sent(), __(), scrape_nonce_failure(), exit(), register_shutdown_function() |
isset($value) && !empty($key) && !empty($nonce) && $transient !== false && !headers_sent() | 71–72 | wp_unslash(), sanitize_key(), wp_unslash(), get_transient(), headers_sent(), header(), nocache_headers(), __(), scrape_nonce_failure(), exit(), register_shutdown_function() |
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 75 | 4–72 | 8 | |
| 8.5 | 75 | 4–72 | 8 | |
| 8.4 | 75 | 4–72 | 8 | 3 fewer instructions than PHP 8.3 |
| 8.3 | 78 | 4–67 | 8 | |
| 8.2 | 78 | 4–67 | 8 | |
| 8.1 | 78 | 4–67 | 8 | |
| 7.4 | 78 | 4–67 | 8 |
An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.
Uses · 6
- sanitize_key()Sanitizes a string key.
- wp_unslash()Removes slashes from a string or recursively removes slashes from strings within an array.
- get_transient()Retrieves the value of a transient.
- nocache_headers()Sets the HTTP headers to prevent caching for the different browsers.
- wp_json_encode()Encodes a variable into JSON, with some confidence checks.
- __()Retrieves the translation of $text.
Source code
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 );}Changelog
Introduced in 4.9.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.7.7 tag, from
src/wp-includes/load.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.