-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add/feature module #22
Conversation
includes/PerformanceFeature.php
Outdated
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(); | ||
} | ||
); | ||
} | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, I don't think we'll want to conditionally run activation/deactivation hooks. I also don't think that these would run early enough if they are registered in an action hook callback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've got these hooks integrated better and moved into the PerformanceFeatureHooks class.
also incorporate them to feature enable and disable hooks
it has been moved to a standalone module
Proposed changes
Type of Change
Checklist
Further comments