is_active example

/** * Determines whether WordPress is in Recovery Mode. * * In this mode, plugins or themes that cause WSODs will be paused. * * @since 5.2.0 * * @return bool */
function wp_is_recovery_mode() {
    return wp_recovery_mode()->is_active();
}

/** * Determines whether we are currently on an endpoint that should be protected against WSODs. * * @since 5.2.0 * * @global string $pagenow The filename of the current screen. * * @return bool True if the current endpoint should be protected. */
return function_exists( 'get_option' );
    }

    /** * Get the option name for storing paused extensions. * * @since 5.2.0 * * @return string */
    protected function get_option_name() {
        if ( ! wp_recovery_mode()->is_active() ) {
            return '';
        }

        $session_id = wp_recovery_mode()->get_session_id();
        if ( empty( $session_id ) ) {
            return '';
        }

        return "{$session_id}_paused_extensions";
    }
}

    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 );
        }

        
Home | Imprint | This part of the site doesn't use cookies.