-
Notifications
You must be signed in to change notification settings - Fork 86
/
BrowserCache_Page.php
66 lines (59 loc) · 3.28 KB
/
BrowserCache_Page.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/**
* File: BrowserCache_Page.php
*
* @package W3TC
*/
namespace W3TC;
/**
* Class BrowserCache_Environment
*
* phpcs:disable PSR2.Classes.PropertyDeclaration.Underscore
* phpcs:disable PSR2.Methods.MethodDeclaration.Underscore
*/
class BrowserCache_Page extends Base_Page_Settings {
/**
* Page
*
* @var string
*/
protected $_page = 'w3tc_browsercache';
/**
* Quick reference AJAX
*
* @return void
*/
public static function w3tc_ajax() {
add_action( 'w3tc_ajax_browsercache_quick_reference', array( '\W3TC\BrowserCache_Page', 'w3tc_ajax_browsercache_quick_reference' ) );
}
/**
* Quick reference include
*
* @return void
*/
public static function w3tc_ajax_browsercache_quick_reference() {
include W3TC_DIR . '/BrowserCache_Page_View_QuickReference.php';
exit();
}
/**
* View browser cache options
*
* @return void
*/
public function view() {
$browsercache_enabled = $this->_config->get_boolean( 'browsercache.enabled' );
$browsercache_last_modified = ( $this->_config->get_boolean( 'browsercache.cssjs.last_modified' ) && $this->_config->get_boolean( 'browsercache.html.last_modified' ) && $this->_config->get_boolean( 'browsercache.other.last_modified' ) );
$browsercache_expires = ( $this->_config->get_boolean( 'browsercache.cssjs.expires' ) && $this->_config->get_boolean( 'browsercache.html.expires' ) && $this->_config->get_boolean( 'browsercache.other.expires' ) );
$browsercache_cache_control = ( $this->_config->get_boolean( 'browsercache.cssjs.cache.control' ) && $this->_config->get_boolean( 'browsercache.html.cache.control' ) && $this->_config->get_boolean( 'browsercache.other.cache.control' ) );
$browsercache_etag = ( $this->_config->get_boolean( 'browsercache.cssjs.etag' ) && $this->_config->get_boolean( 'browsercache.html.etag' ) && $this->_config->get_boolean( 'browsercache.other.etag' ) );
$browsercache_w3tc = ( $this->_config->get_boolean( 'browsercache.cssjs.w3tc' ) && $this->_config->get_boolean( 'browsercache.html.w3tc' ) && $this->_config->get_boolean( 'browsercache.other.w3tc' ) );
$browsercache_compression = ( $this->_config->get_boolean( 'browsercache.cssjs.compression' ) && $this->_config->get_boolean( 'browsercache.html.compression' ) && $this->_config->get_boolean( 'browsercache.other.compression' ) );
$browsercache_brotli = ( $this->_config->get_boolean( 'browsercache.cssjs.brotli' ) && $this->_config->get_boolean( 'browsercache.html.brotli' ) && $this->_config->get_boolean( 'browsercache.other.brotli' ) );
$browsercache_replace = ( $this->_config->get_boolean( 'browsercache.cssjs.replace' ) && $this->_config->get_boolean( 'browsercache.other.replace' ) );
$browsercache_querystring = ( $this->_config->get_boolean( 'browsercache.cssjs.querystring' ) && $this->_config->get_boolean( 'browsercache.other.querystring' ) );
$browsercache_update_media_qs = ( $this->_config->get_boolean( 'browsercache.cssjs.replace' ) || $this->_config->get_boolean( 'browsercache.other.replace' ) );
$browsercache_nocookies = ( $this->_config->get_boolean( 'browsercache.cssjs.nocookies' ) && $this->_config->get_boolean( 'browsercache.other.nocookies' ) );
$is_nginx = Util_Environment::is_nginx();
include W3TC_INC_DIR . '/options/browsercache.php';
}
}