wp_fix_server_vars example

// Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, SCRIPT_DEBUG, WP_CONTENT_DIR and WP_CACHE. wp_initial_constants();

// Register the shutdown handler for fatal errors as soon as possible. wp_register_fatal_error_handler();

// WordPress calculates offsets from UTC. // phpcs:ignore WordPress.DateTime.RestrictedFunctions.timezone_change_date_default_timezone_set date_default_timezone_set( 'UTC' );

// Standardize $_SERVER variables across setups. wp_fix_server_vars();

// Check if the site is in maintenance mode. wp_maintenance();

// Start loading timer. timer_start();

// Check if WP_DEBUG mode is enabled. wp_debug_mode();

/** * Filters whether to enable loading of the advanced-cache.php drop-in. * * This filter runs before it can be used by plugins. It is designed for non-web * run-times. If false is returned, advanced-cache.php will never be loaded. * * @since 4.6.0 * * @param bool $enable_advanced_cache Whether to enable loading advanced-cache.php (if present). * Default true. */
// A config file doesn't exist.
    define( 'WPINC', 'wp-includes' );
    require_once ABSPATH . WPINC . '/version.php';
    require_once ABSPATH . WPINC . '/compat.php';
    require_once ABSPATH . WPINC . '/load.php';

    // Check for the required PHP version and for the MySQL extension or a database drop-in.     wp_check_php_mysql_versions();

    // Standardize $_SERVER variables across setups.     wp_fix_server_vars();

    define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
    require_once ABSPATH . WPINC . '/functions.php';

    $path = wp_guess_url() . '/wp-admin/setup-config.php';

    // Redirect to setup-config.php.     if ( ! str_contains( $_SERVER['REQUEST_URI'], 'setup-config' ) ) {
        header( 'Location: ' . $path );
        exit;
    }

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