is_protected_endpoint example

if ( ! function_exists( 'wp_die' ) ) {
            require_once ABSPATH . WPINC . '/functions.php';
        }

        if ( ! class_exists( 'WP_Error' ) ) {
            require_once ABSPATH . WPINC . '/class-wp-error.php';
        }

        if ( true === $handled && wp_is_recovery_mode() ) {
            $message = __( 'There has been a critical error on this website, putting it in recovery mode. Please check the Themes and Plugins screens for more details. If you just installed or updated a theme or plugin, check the relevant page for that first.' );
        } elseif ( is_protected_endpoint() && wp_recovery_mode()->is_initialized() ) {
            if ( is_multisite() ) {
                $message = __( 'There has been a critical error on this website. Please reach out to your site administrator, and inform them of this error for further assistance.' );
            } else {
                $message = __( 'There has been a critical error on this website. Please check your site admin email inbox for instructions.' );
            }
        } else {
            $message = __( 'There has been a critical error on this website.' );
        }

        $message = sprintf(
            '<p>%s</p><p><a href="%s">%s</a></p>',
            

    public function handle_error( array $error ) {

        $extension = $this->get_extension_for_error( $error );

        if ( ! $extension || $this->is_network_plugin( $extension ) ) {
            return new WP_Error( 'invalid_source', __( 'Error not caused by a plugin or theme.' ) );
        }

        if ( ! $this->is_active() ) {
            if ( ! is_protected_endpoint() ) {
                return new WP_Error( 'non_protected_endpoint', __( 'Error occurred on a non-protected endpoint.' ) );
            }

            if ( ! function_exists( 'wp_generate_password' ) ) {
                require_once ABSPATH . WPINC . '/pluggable.php';
            }

            return $this->email_service->maybe_send_recovery_mode_email( $this->get_email_rate_limit()$error$extension );
        }

        if ( ! $this->store_error( $error ) ) {
            
Home | Imprint | This part of the site doesn't use cookies.