WP_Recovery_Mode
- Since
- 5.2.0
- Source
wp-includes/class-wp-recovery-mode.php:14
Core class used to implement Recovery Mode.
Compatibility
- WordPress
- since 5.2.0
- 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).
Hooks and filters fired · 2
Every hook that fires from inside WP_Recovery_Mode, in the order it appears in the class, grouped by the method that fires it.
Properties · 7
$cookie_serviceWP_Recovery_Mode_Cookie_Serviceprivate- Service to handle cookies.
$key_serviceWP_Recovery_Mode_Key_Serviceprivate- Service to generate a recovery mode key.
$link_serviceWP_Recovery_Mode_Link_Serviceprivate- Service to generate and validate recovery mode links.
$email_serviceWP_Recovery_Mode_Email_Serviceprivate- Service to handle sending an email with a recovery mode link.
$is_initializedboolprivate- Is recovery mode initialized.
$is_activeboolprivate- Is recovery mode active in this session.
$session_idstringprivate- Get an ID representing the current recovery mode session.
Methods · 16
- __construct()WP_Recovery_Mode constructor.
- initialize()Initialize recovery mode for the current request.
- is_active()Checks whether recovery mode is active.
- get_session_id()Gets the recovery mode session ID.
- is_initialized()Checks whether recovery mode has been initialized.
- handle_error()Handles a fatal error occurring.
- exit_recovery_mode()Ends the current recovery mode session.
- handle_exit_recovery_mode()Handles a request to exit Recovery Mode.
- clean_expired_keys()Cleans any recovery mode keys that have expired according to the link TTL.
- handle_cookie()Handles checking for the recovery mode cookie and validating it.
- get_email_rate_limit()Gets the rate limit between sending new recovery mode email links.
- get_link_ttl()Gets the number of seconds the recovery mode link is valid for.
- get_extension_for_error()Gets the extension that the error occurred in.
- is_network_plugin()Checks whether the given extension a network activated plugin.
- store_error()Stores the given error so that the extension causing it is paused.
- redirect_protected()Redirects the current request to allow recovering multiple errors in one go.
Source code
#[AllowDynamicProperties]class WP_Recovery_Mode { const EXIT_ACTION = 'exit_recovery_mode'; /** * Service to handle cookies. * * @since 5.2.0 * @var WP_Recovery_Mode_Cookie_Service */ private $cookie_service; /** * Service to generate a recovery mode key. * * @since 5.2.0 * @var WP_Recovery_Mode_Key_Service */ private $key_service; /** * Service to generate and validate recovery mode links. * * @since 5.2.0 * @var WP_Recovery_Mode_Link_Service */ private $link_service; /** * Service to handle sending an email with a recovery mode link. * * @since 5.2.0 * @var WP_Recovery_Mode_Email_Service */ private $email_service; /** * Is recovery mode initialized. * * @since 5.2.0 * @var bool */ private $is_initialized = false; /** * Is recovery mode active in this session. * * @since 5.2.0 * @var bool */ private $is_active = false; /** * Get an ID representing the current recovery mode session. * * @since 5.2.0 * @var string */ private $session_id = ''; /** * WP_Recovery_Mode constructor. * * @since 5.2.0 */ public function __construct() { $this->cookie_service = new WP_Recovery_Mode_Cookie_Service(); $this->key_service = new WP_Recovery_Mode_Key_Service(); $this->link_service = new WP_Recovery_Mode_Link_Service( $this->cookie_service, $this->key_service ); $this->email_service = new WP_Recovery_Mode_Email_Service( $this->link_service ); } /** * Initialize recovery mode for the current request. * * @since 5.2.0 */ public function initialize() { $this->is_initialized = true;Changelog
Introduced in 5.2.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/class-wp-recovery-mode.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.