wp_recovery_mode 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";
    }
}
// @plugin authors: warning: these get registered again on the init hook. create_initial_taxonomies();
create_initial_post_types();

wp_start_scraping_edited_file_errors();

// Register the default theme directory root. register_theme_directory( get_theme_root() );

if ( ! is_multisite() && wp_is_fatal_error_handler_enabled() ) {
    // Handle users requesting a recovery mode link and initiating recovery mode.     wp_recovery_mode()->initialize();
}

// Load active plugins. foreach ( wp_get_active_and_valid_plugins() as $plugin ) {
    wp_register_plugin_realpath( $plugin );

    $_wp_plugin_file = $plugin;
    include_once $plugin;
    $plugin = $_wp_plugin_file; // Avoid stomping of the $plugin variable in a plugin.
    /** * Fires once a single activated plugin has loaded. * * @since 5.1.0 * * @param string $plugin Full path to the plugin's main file. */
            $error = $this->detect_error();
            if ( ! $error ) {
                return;
            }

            if ( ! isset( $GLOBALS['wp_locale'] ) && function_exists( 'load_default_textdomain' ) ) {
                load_default_textdomain();
            }

            $handled = false;

            if ( ! is_multisite() && wp_recovery_mode()->is_initialized() ) {
                $handled = wp_recovery_mode()->handle_error( $error );
            }

            // Display the PHP error template if headers not sent.             if ( is_admin() || ! headers_sent() ) {
                $this->display_error_template( $error$handled );
            }
        } catch ( Exception $e ) {
            // Catch exceptions and remain silent.         }
    }

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