Skip to content

Instantly share code, notes, and snippets.

@sebastianmoran-mainwp
Created August 10, 2019 03:28
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save sebastianmoran-mainwp/10dbb6f8ccb4569904c2de193d49fa1e to your computer and use it in GitHub Desktop.
Hummingbird plugin created advanced-cache.php dropin file.
<?php
/**
* Hummingbird Advanced Tools module
*
* @package Hummingbird
*/
if ( ! defined( 'ABSPATH' ) ) {
die();
}
/**
* Load necessary modules for caching.
*/
if ( ! class_exists( 'WP_Hummingbird_Module_Page_Cache' ) ) {
if ( is_dir( WP_CONTENT_DIR . '/plugins/wp-hummingbird/' ) ) {
$path = WP_CONTENT_DIR . '/plugins/wp-hummingbird/';
} else {
$path = WP_CONTENT_DIR . '/plugins/hummingbird-performance/';
}
include_once $path . 'core/class-utils.php';
include_once $path . 'core/class-abstract-module.php';
include_once $path . 'core/modules/class-module-page-cache.php';
if ( ! method_exists( 'WP_Hummingbird_Module_Page_Cache', 'serve_cache' ) ) {
return;
}
define( 'WPHB_ADVANCED_CACHE', true );
WP_Hummingbird_Module_Page_Cache::serve_cache();
}