diff --git a/includes/PerformanceFeature.php b/includes/PerformanceFeature.php index d7ad3a5..8461198 100644 --- a/includes/PerformanceFeature.php +++ b/includes/PerformanceFeature.php @@ -15,75 +15,69 @@ /** * Child class for a feature - * + * * Child classes should define a name property as the feature name for all API calls. This name will be used in the registry. * Child class naming convention is {FeatureName}Feature. */ class PerformanceFeature extends \NewfoldLabs\WP\Module\Features\Feature { - /** - * The feature name. - * - * @var string - */ - protected $name = 'performance'; + /** + * The feature name. + * + * @var string + */ + protected $name = 'performance'; /** * The feature value. Defaults to on. * * @var boolean */ - protected $value = true; // default to on + protected $value = true; // default to on - /** - * Initialize performance feature. - */ - public function initialize() { - if ( function_exists( 'add_action' ) ) { - - // Register module - add_action( - 'plugins_loaded', - function () { - new Performance( getContainer() ); - } - ); + /** + * Initialize performance feature. + */ + public function initialize() { + if ( function_exists( 'add_action' ) ) { - // Container Hooks - add_action( - 'newfold_container_set', - function ( Container $container ) { + // Register module + add_action( + 'plugins_loaded', + function () { + new Performance( getContainer() ); + } + ); - register_activation_hook( - $container->plugin()->file, - function () use ( $container ) { - - Skip404::onActivation(); - File::onActivation(); - Browser::onActivation(); - - // Add headers to .htaccess - $responseHeaderManager = new ResponseHeaderManager(); - $responseHeaderManager->addHeader( 'X-Newfold-Cache-Level', absint( getCacheLevel() ) ); - - } - ); - - register_deactivation_hook( - $container->plugin()->file, - function () use ( $container ) { - - Skip404::onDeactivation(); - File::onDeactivation(); - Browser::onDeactivation(); - - // Remove all headers from .htaccess - $responseHeaderManager = new ResponseHeaderManager(); - $responseHeaderManager->removeAllHeaders(); - } - ); - } - ); - } - } + // Container Hooks + add_action( + 'newfold_container_set', + function ( Container $container ) { + register_activation_hook( + $container->plugin()->file, + function () use ( $container ) { + Skip404::onActivation(); + File::onActivation(); + Browser::onActivation(); + // Add headers to .htaccess + $responseHeaderManager = new ResponseHeaderManager(); + $responseHeaderManager->addHeader( 'X-Newfold-Cache-Level', absint( getCacheLevel() ) ); + + } + ); + register_deactivation_hook( + $container->plugin()->file, + function () use ( $container ) { + Skip404::onDeactivation(); + File::onDeactivation(); + Browser::onDeactivation(); + // Remove all headers from .htaccess + $responseHeaderManager = new ResponseHeaderManager(); + $responseHeaderManager->removeAllHeaders(); + } + ); + } + ); + } + } }