wp-rocket
wp-rocket copied to clipboard
Dynamic Lists: Frontend part (5/5)
Sub-task for epic #3602
Update the frontend classes to use the dynamic lists instead of the hardcoded values
All classes will need to implement the trait created in sub-task #3699
DeferJS
- Replace the private property
inline_exclusions
by a methodget_inline_exclusions()
, which uses theget_lists()
method from the trait to get the lists and return the one corresponding to this exclusion type - Update the
get_excluded()
method to do the same
rocket_get_ignored_parameters()
We can't use the trait for this function, so a different approach can be to use the DynamicLists\Subscriber
to hook on rocket_cache_ignored_parameters
, add a callback method get_cache_ignored_parameters()
with a low priority, and remove the hardcoded value from the function. The function would end up being a wrapper for the filter.
Minify/Combine JS
- Update the
get_excluded_files()
,get_excluded_inline_content()
andget_move_after_inline_scripts()
methods to use the dynamic lists
DelayJS\Settings
- Replace the
$defaults
property by a new methodget_defaults_inclusions()
, which uses theget_lists()
method from the trait to get the lists and return the one corresponding to this inclusion type
Automated tests
- Create and update unit/integration tests to reflect the changes