Change experiment initialization method from register() to init() #159
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Refactors the experiment lifecycle method from
register()toinit()across the entire codebase to better reflect its purpose of initializing experiments.Closes #145
Why?
The term "register" was misleading as it suggested the experiments were being registered into a system, when in reality this method is called after registration to initialize the experiment's hooks and functionality. The method
init()more accurately describes what the method does - it initializes the experiment by setting up WordPress hooks, filters, and actions when the experiment is enabled and loaded.This improves code clarity and aligns the method naming with its actual behavior in the experiment lifecycle:
Experiment_Registry::register()Experiment::init()when they're loadedHow?
Experimentinterface to declareinit()instead ofregister()Abstract_Experimentabstract class to declareabstract public function init()Experiment_Loader::initialize_experiments()to callinit()Testing Instructions
npm run test:phpTesting Instructions for Keyboard
Not applicable - this is an internal refactoring with no UI changes.