[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/ -> class-wp-recovery-mode.php (summary)

Error Protection API: WP_Recovery_Mode class

File Size: 470 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 wp-includes/pluggable.php

Defines 1 class

WP_Recovery_Mode:: (16 methods):
  __construct()
  initialize()
  is_active()
  get_session_id()
  is_initialized()
  handle_error()
  exit_recovery_mode()
  handle_exit_recovery_mode()
  clean_expired_keys()
  handle_cookie()
  get_email_rate_limit()
  get_link_ttl()
  get_extension_for_error()
  is_network_plugin()
  store_error()
  redirect_protected()


Class: WP_Recovery_Mode  - X-Ref

Core class used to implement Recovery Mode.

__construct()   X-Ref
WP_Recovery_Mode constructor.

since: 5.2.0

initialize()   X-Ref
Initialize recovery mode for the current request.

since: 5.2.0

is_active()   X-Ref
Checks whether recovery mode is active.

This will not change after recovery mode has been initialized. {@see WP_Recovery_Mode::run()}.

since: 5.2.0
return: bool True if recovery mode is active, false otherwise.

get_session_id()   X-Ref
Gets the recovery mode session ID.

since: 5.2.0
return: string The session ID if recovery mode is active, empty string otherwise.

is_initialized()   X-Ref
Checks whether recovery mode has been initialized.

Recovery mode should not be used until this point. Initialization happens immediately before loading plugins.

since: 5.2.0
return: bool

handle_error( array $error )   X-Ref
Handles a fatal error occurring.

The calling API should immediately die() after calling this function.

since: 5.2.0
param: array $error Error details from `error_get_last()`.
return: true|WP_Error True if the error was handled and headers have already been sent.

exit_recovery_mode()   X-Ref
Ends the current recovery mode session.

since: 5.2.0
return: bool True on success, false on failure.

handle_exit_recovery_mode()   X-Ref
Handles a request to exit Recovery Mode.

since: 5.2.0

clean_expired_keys()   X-Ref
Cleans any recovery mode keys that have expired according to the link TTL.

Executes on a daily cron schedule.

since: 5.2.0

handle_cookie()   X-Ref
Handles checking for the recovery mode cookie and validating it.

since: 5.2.0

get_email_rate_limit()   X-Ref
Gets the rate limit between sending new recovery mode email links.

since: 5.2.0
return: int Rate limit in seconds.

get_link_ttl()   X-Ref
Gets the number of seconds the recovery mode link is valid for.

since: 5.2.0
return: int Interval in seconds.

get_extension_for_error( $error )   X-Ref
Gets the extension that the error occurred in.

since: 5.2.0
param: array $error Error details from `error_get_last()`.
return: array|false {

is_network_plugin( $extension )   X-Ref
Checks whether the given extension a network activated plugin.

since: 5.2.0
param: array $extension Extension data.
return: bool True if network plugin, false otherwise.

store_error( $error )   X-Ref
Stores the given error so that the extension causing it is paused.

since: 5.2.0
param: array $error Error details from `error_get_last()`.
return: bool True if the error was stored successfully, false otherwise.

redirect_protected()   X-Ref
Redirects the current request to allow recovering multiple errors in one go.

The redirection will only happen when on a protected endpoint.

It must be ensured that this method is only called when an error actually occurred and will not occur on the
next request again. Otherwise it will create a redirect loop.

since: 5.2.0



Generated: Tue Nov 12 01:00:02 2024 Cross-referenced by PHPXref 0.7.1