wp-rocket icon indicating copy to clipboard operation
wp-rocket copied to clipboard

Dynamic Lists: Frontend part (5/5)

Open remyperona opened this issue 3 years ago • 0 comments

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 method get_inline_exclusions(), which uses the get_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() and get_move_after_inline_scripts() methods to use the dynamic lists

DelayJS\Settings

  • Replace the $defaults property by a new method get_defaults_inclusions(), which uses the get_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

remyperona avatar Mar 22 '21 21:03 remyperona