<?php
/**
 * File: header.php
 *
 * Header for popup windows.
 *
 * @package W3TC
 *
 * phpcs:disable WordPress.WP.EnqueuedResources,WordPress.WP.GlobalVariablesOverride
 */

namespace W3TC;

defined( 'ABSPATH' ) || exit;
if ( ! defined( 'W3TC' ) ) {
	die();
}

if ( ! isset( $w3tc_title ) ) {
	$w3tc_title = 'Untitled';
}

if ( ! isset( $w3tc_errors ) ) {
	$w3tc_errors = array();
}

if ( ! isset( $w3tc_notes ) ) {
	$w3tc_notes = array();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php do_action( 'admin_xml_ns' ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound ?> <?php language_attributes(); ?>>
	<head>
		<link rel="stylesheet" type="text/css" href="<?php echo esc_url( plugins_url( 'pub/css/popup.css?ver=' . W3TC_VERSION, W3TC_FILE ) ); ?>" />
		<script type="text/javascript" src="<?php echo esc_url( site_url( 'wp-includes/js/jquery/jquery.js?ver=' . W3TC_VERSION ) ); ?>"></script>
		<script type="text/javascript" src="<?php echo esc_url( plugins_url( 'pub/js/metadata.js?ver=' . W3TC_VERSION, W3TC_FILE ) ); ?>"></script>
		<script type="text/javascript" src="<?php echo esc_url( plugins_url( 'pub/js/popup.js?ver=' . W3TC_VERSION, W3TC_FILE ) ); ?>"></script>
		<title><?php echo esc_html( $w3tc_title ); ?> - W3 Total Cache</title>
		<meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php echo esc_attr( get_option( 'blog_charset' ) ); ?>" />
	</head>
	<body>
		<div id="content">
			<h1><?php echo esc_html( $w3tc_title ); ?></h1>

			<?php if ( count( $w3tc_errors ) ) : ?>
				<div class="error">
					<?php foreach ( $w3tc_errors as $error ) : ?>
						<p><?php echo esc_html( $error ); ?></p>
					<?php endforeach; ?>
				</div>
			<?php endif; ?>

			<?php if ( count( $w3tc_notes ) ) : ?>
				<div class="updated">
					<?php foreach ( $w3tc_notes as $w3tc_note ) : ?>
						<p><?php echo esc_html( $w3tc_note ); ?></p>
					<?php endforeach; ?>
				</div>
			<?php endif; ?>
