-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
69ba5be
commit f95d7ce
Showing
1 changed file
with
24 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,46 @@ | ||
<?php | ||
|
||
/** | ||
* W3 Total Cache advanced cache module | ||
* File: advanced-cache.php | ||
* | ||
* W3 Total Cache advanced cache module. | ||
* | ||
* @package W3TC | ||
*/ | ||
if ( !defined( 'ABSPATH' ) ) { | ||
die(); | ||
} | ||
|
||
defined( 'ABSPATH' ) || die(); | ||
|
||
global $w3tc_start_microtime; | ||
$w3tc_start_microtime = microtime( true ); | ||
|
||
/** | ||
* Abort W3TC loading if WordPress is upgrading | ||
* Abort W3TC loading if WordPress is upgrading. | ||
*/ | ||
if ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) | ||
if ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) { | ||
return; | ||
} | ||
|
||
if ( !defined( 'W3TC_IN_MINIFY' ) ) { | ||
if ( !defined( 'W3TC_DIR' ) ) { | ||
if ( ! defined( 'W3TC_IN_MINIFY' ) ) { | ||
if ( ! defined( 'W3TC_DIR' ) ) { | ||
define( 'W3TC_DIR', ( defined( 'WP_PLUGIN_DIR' ) ? WP_PLUGIN_DIR : WP_CONTENT_DIR . '/plugins' ) . '/w3-total-cache' ); | ||
} | ||
|
||
if ( !@is_dir( W3TC_DIR ) || !file_exists( W3TC_DIR . '/w3-total-cache-api.php' ) ) { | ||
if ( defined( 'WP_ADMIN' ) ) { // lets don't show error on front end | ||
echo sprintf( '<strong>W3 Total Cache Error:</strong> some files appear to be missing or out of place. Please re-install plugin or remove <strong>%s</strong>. <br />', __FILE__ ); | ||
if ( ! @is_dir( W3TC_DIR ) || ! file_exists( W3TC_DIR . '/w3-total-cache-api.php' ) ) { | ||
if ( defined( 'WP_ADMIN' ) ) { | ||
// Only display errors in wp-admin. | ||
printf( '<strong>W3 Total Cache Error:</strong> some files appear to be missing or out of place. Please re-install plugin or remove <strong>%s</strong>. <br />', __FILE__ ); | ||
} | ||
} else { | ||
require_once W3TC_DIR . '/w3-total-cache-api.php'; | ||
|
||
$w3tc_redirect = \W3TC\Dispatcher::component( 'Mobile_Redirect' ); | ||
$w3tc_redirect->process(); | ||
if ( class_exists( '\W3TC\Dispatcher' ) ) { | ||
$w3tc_redirect = \W3TC\Dispatcher::component( 'Mobile_Redirect' ); | ||
$w3tc_redirect->process(); | ||
|
||
$w3tc_config = \W3TC\Dispatcher::config(); | ||
if ( $w3tc_config->get_boolean( 'pgcache.enabled' ) ) { | ||
$o = \W3TC\Dispatcher::component( 'PgCache_ContentGrabber' ); | ||
$o->process(); | ||
$w3tc_config = \W3TC\Dispatcher::config(); | ||
if ( $w3tc_config->get_boolean( 'pgcache.enabled' ) ) { | ||
$o = \W3TC\Dispatcher::component( 'PgCache_ContentGrabber' ); | ||
$o->process(); | ||
} | ||
} | ||
} | ||
} |