From a85e586439937496a3ebb337863fe8620dad54b5 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 14 May 2024 11:24:13 -0400 Subject: [PATCH] tabs --- includes/PerformanceFeature.php | 108 +++++++++++++++----------------- 1 file changed, 51 insertions(+), 57 deletions(-) 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(); + } + ); + } + ); + } + } }