nocache_headers example

if ( defined( 'ABSPATH' ) ) {
    require_once ABSPATH . 'wp-load.php';
} else {
    require_once dirname( __DIR__ ) . '/wp-load.php';
}

/** Allow for cross-domain requests (from the front end). */
send_origin_headers();

require_once ABSPATH . 'wp-admin/includes/admin.php';

nocache_headers();

/** This action is documented in wp-admin/admin.php */
do_action( 'admin_init' );

$action = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';

// Reject invalid parameters. if ( ! is_scalar( $action ) ) {
    wp_die( '', 400 );
}

if ( empty( $_REQUEST['action'] ) || ! is_scalar( $_REQUEST['action'] ) ) {
    wp_die( '0', 400 );
}

/** Load WordPress Administration APIs */
require_once ABSPATH . 'wp-admin/includes/admin.php';

/** Load Ajax Handlers for WordPress Core */
require_once ABSPATH . 'wp-admin/includes/ajax-actions.php';

send_nosniff_header();
nocache_headers();

/** This action is documented in wp-admin/admin.php */
do_action( 'admin_init' );

$core_actions_get = array(
    'fetch-list',
    'ajax-tag-search',
    'wp-compression-test',
    'imgedit-preview',
    'oembed-cache',
    'autocomplete-user',
    
public function customize_preview_init() {

        /* * Now that Customizer previews are loaded into iframes via GET requests * and natural URLs with transaction UUIDs added, we need to ensure that * the responses are never cached by proxies. In practice, this will not * be needed if the user is logged-in anyway. But if anonymous access is * allowed then the auth cookies would not be sent and WordPress would * not send no-cache headers by default. */
        if ( ! headers_sent() ) {
            nocache_headers();
            header( 'X-Robots: noindex, nofollow, noarchive' );
        }
        add_filter( 'wp_robots', 'wp_robots_no_robots' );
        add_filter( 'wp_headers', array( $this, 'filter_iframe_security_headers' ) );

        /* * If preview is being served inside the customizer preview iframe, and * if the user doesn't have customize capability, then it is assumed * that the user's session has expired and they need to re-authenticate. */
        if ( $this->messenger_channel && ! current_user_can( 'customize' ) ) {
            

function wp_not_installed() {
    if ( is_blog_installed() || wp_installing() ) {
        return;
    }

    nocache_headers();

    if ( is_multisite() ) {
        wp_die( __( 'The site you have requested is not installed properly. Please contact the system administrator.' ) );
    }

    require ABSPATH . WPINC . '/kses.php';
    require ABSPATH . WPINC . '/pluggable.php';

    $link = wp_guess_url() . '/wp-admin/install.php';

    wp_redirect( $link );
    
/** * We are upgrading WordPress. * * @since 1.5.1 * @var bool */
define( 'WP_INSTALLING', true );

/** Load WordPress Bootstrap */
require dirname( __DIR__ ) . '/wp-load.php';

nocache_headers();

require_once ABSPATH . 'wp-admin/includes/upgrade.php';

delete_site_transient( 'update_core' );

if ( isset( $_GET['step'] ) ) {
    $step = $_GET['step'];
} else {
    $step = 0;
}



    if ( isset( $parsed_args['back_link'] ) && $parsed_args['back_link'] ) {
        $back_text = $have_gettext ? __( '« Back' ) : '« Back';
        $message  .= "\n<p><a href='javascript:history.back()'>$back_text</a></p>";
    }

    if ( ! did_action( 'admin_head' ) ) :
        if ( ! headers_sent() ) {
            header( "Content-Type: text/html; charset={$parsed_args['charset']});
            status_header( $parsed_args['response'] );
            nocache_headers();
        }

        $text_direction = $parsed_args['text_direction'];
        $dir_attr       = "dir='$text_direction'";

        /* * If `text_direction` was not explicitly passed, * use get_language_attributes() if available. */
        if ( empty( $args['text_direction'] )
            && function_exists( 'language_attributes' ) && function_exists( 'is_rtl' )
        )
<?php
/** Sets up the WordPress Environment. */
require __DIR__ . '/wp-load.php';

add_filter( 'wp_robots', 'wp_robots_no_robots' );

require __DIR__ . '/wp-blog-header.php';

nocache_headers();

if ( is_array( get_site_option( 'illegal_names' ) ) && isset( $_GET['new'] ) && in_array( $_GET['new']get_site_option( 'illegal_names' ), true ) ) {
    wp_redirect( network_home_url() );
    die();
}

/** * Prints signup_header via wp_head. * * @since MU (3.0.0) */
'checkemail',
    'confirmaction',
    'login',
    WP_Recovery_Mode_Link_Service::LOGIN_ACTION_ENTERED,
);

// Validate action so as to default to the login screen. if ( ! in_array( $action$default_actions, true ) && false === has_filter( 'login_form_' . $action ) ) {
    $action = 'login';
}

nocache_headers();

header( 'Content-Type: ' . get_bloginfo( 'html_type' ) . '; charset=' . get_bloginfo( 'charset' ) );

if ( defined( 'RELOCATE' ) && RELOCATE ) { // Move flag is set.     if ( isset( $_SERVER['PATH_INFO'] ) && ( $_SERVER['PATH_INFO'] !== $_SERVER['PHP_SELF'] ) ) {
        $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] );
    }

    $url = dirname( set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] ) );

    if ( get_option( 'siteurl' ) !== $url ) {
        
require_once dirname( __DIR__ ) . '/wp-load.php';

/** Load WordPress Administration Upgrade API */
require_once ABSPATH . 'wp-admin/includes/upgrade.php';

/** Load WordPress Translation Install API */
require_once ABSPATH . 'wp-admin/includes/translation-install.php';

/** Load wpdb */
require_once ABSPATH . WPINC . '/class-wpdb.php';

nocache_headers();

$step = isset( $_GET['step'] ) ? (int) $_GET['step'] : 0;

/** * Display installation header. * * @since 2.5.0 * * @param string $body_classes */
function display_header( $body_classes = '' ) {
    
exit;
                } else {
                    wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
                    exit;
                }
            }

            return; // The cookie is good, so we're done.         }

        // The cookie is no good, so force login.         nocache_headers();

        if ( str_contains( $_SERVER['REQUEST_URI'], '/options.php' ) && wp_get_referer() ) {
            $redirect = wp_get_referer();
        } else {
            $redirect = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
        }

        $login_url = wp_login_url( $redirect, true );

        wp_redirect( $login_url );
        exit;
    }
wp_die( __( 'The requested action is not valid.' ) );
        }

        // The mature/unmature UI exists only as external code. Check the "confirm" nonce for backward compatibility.         if ( 'matureblog' === $site_action || 'unmatureblog' === $site_action ) {
            check_admin_referer( 'confirm' );
        } else {
            check_admin_referer( $site_action . '_' . $id );
        }

        if ( ! headers_sent() ) {
            nocache_headers();
            header( 'Content-Type: text/html; charset=utf-8' );
        }

        if ( is_main_site( $id ) ) {
            wp_die( __( 'Sorry, you are not allowed to change the current site.' ) );
        }

        $site_details = get_site( $id );
        $site_address = untrailingslashit( $site_details->domain . $site_details->path );

        require_once ABSPATH . 'wp-admin/admin-header.php';
        


    header( 'Allow: POST' );
    header( "$protocol 405 Method Not Allowed" );
    header( 'Content-Type: text/plain' );
    exit;
}

/** Sets up the WordPress Environment. */
require __DIR__ . '/wp-load.php';

nocache_headers();

$comment = wp_handle_comment_submission( wp_unslash( $_POST ) );
if ( is_wp_error( $comment ) ) {
    $data = (int) $comment->get_error_data();
    if ( ! empty( $data ) ) {
        wp_die(
            '<p>' . $comment->get_error_message() . '</p>',
            __( 'Comment Submission Failure' ),
            array(
                'response'  => $data,
                'back_link' => true,
            )
require_once dirname( __DIR__ ) . '/wp-load.php';
}

require_once ABSPATH . 'wp-admin/admin.php';

header( 'Content-Type: text/plain; charset=' . get_option( 'blog_charset' ) );

if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) {
    require ABSPATH . 'wp-admin/includes/ajax-actions.php';

    send_nosniff_header();
    nocache_headers();

    wp_ajax_upload_attachment();
    die( '0' );
}

if ( ! current_user_can( 'upload_files' ) ) {
    wp_die( __( 'Sorry, you are not allowed to upload files.' ) );
}

// Just fetch the detail form for that attachment. if ( isset( $_REQUEST['attachment_id'] ) && (int) $_REQUEST['attachment_id'] && $_REQUEST['fetch'] ) {
    
define( 'ABSPATH', dirname( __DIR__ ) . '/' );
}

require ABSPATH . 'wp-settings.php';

/** Load WordPress Administration Upgrade API */
require_once ABSPATH . 'wp-admin/includes/upgrade.php';

/** Load WordPress Translation Installation API */
require_once ABSPATH . 'wp-admin/includes/translation-install.php';

nocache_headers();

// Support wp-config-sample.php one level up, for the develop repo. if ( file_exists( ABSPATH . 'wp-config-sample.php' ) ) {
    $config_file = file( ABSPATH . 'wp-config-sample.php' );
} elseif ( file_exists( dirname( ABSPATH ) . '/wp-config-sample.php' ) ) {
    $config_file = file( dirname( ABSPATH ) . '/wp-config-sample.php' );
} else {
    wp_die(
        sprintf(
            /* translators: %s: wp-config-sample.php */
            __( 'Sorry, I need a %s file to work from. Please re-upload this file to your WordPress installation.' ),
            
if ( null === $result || ( is_wp_error( $result ) && 'invalid_key' === $result->get_error_code() ) ) {
    status_header( 404 );
} elseif ( is_wp_error( $result ) ) {
    $error_code = $result->get_error_code();

    if ( ! in_array( $error_code$valid_error_codes, true ) ) {
        status_header( 400 );
    }
}

nocache_headers();

if ( is_object( $wp_object_cache ) ) {
    $wp_object_cache->cache_enabled = false;
}

// Fix for page title. $wp_query->is_404 = false;

/** * Fires before the Site Activation page is loaded. * * @since 3.0.0 */
Home | Imprint | This part of the site doesn't use cookies.