Skip to content
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

Merged
merged 29 commits into from
May 29, 2024
Merged

Add/feature module #22

merged 29 commits into from
May 29, 2024

Conversation

circlecube
Copy link
Member

Proposed changes

Type of Change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • Linting and tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@circlecube circlecube self-assigned this May 7, 2024
@circlecube circlecube marked this pull request as ready for review May 13, 2024 19:34
@circlecube circlecube requested review from bradp, wpscholar and wpalani May 13, 2024 19:34
bootstrap.php Outdated Show resolved Hide resolved
Comment on lines 53 to 79
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();
}
);
}
);
Copy link
Member

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.

Copy link
Member Author

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.

@circlecube circlecube merged commit 4db06ed into main May 29, 2024
2 of 7 checks passed
@circlecube circlecube deleted the add/feature-module branch May 29, 2024 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants