@@ -8,6 +8,7 @@ class WPRDiagnoserOptions
88{
99 private $ option_pre_filter_prefix = 'pre_get_rocket_option_ ' ;
1010 private $ option_post_filter_prefix = 'get_rocket_option_ ' ;
11+ private $ post_meta_options = ['remove_unused_css ' , 'delay_js ' , 'defer_all_js ' , 'async_css ' , 'lazyload ' , 'lazyload_iframes ' , 'lazyload_css_bg_img ' , 'minify_css ' , 'minify_js ' , 'cdn ' ];
1112 /**
1213 * Contains the list of WP Rocket options and their related filters and options to be processed
1314 *
@@ -56,7 +57,8 @@ class WPRDiagnoserOptions
5657 'delay_js ' => [
5758 'name ' => 'Delay JavaScript Execution ' ,
5859 'get_rocket_option ' => [
59- 'delay_js_exclusions ' , 'delay_js_exclusions_selected_exclusions '
60+ 'delay_js_exclusions ' ,
61+ 'delay_js_exclusions_selected_exclusions '
6062 ],
6163 'filters ' => [
6264 ['rocket_delay_js_exclusions ' , []]
@@ -210,13 +212,14 @@ public function fill_options(string $option_name, array $option_list)
210212 }
211213 private function fill_rocket_post_meta_options ()
212214 {
213- $ result = [];
215+ $ excluded_options = [];
214216 foreach ($ this ->options as $ option_name => $ value ) {
215- if (isset ($ value ['is_post_option ' ]) && $ value ['is_post_option ' ]) {
216- $ result [$ option_name ] = (bool ) is_rocket_post_excluded_option ($ option_name );
217+ if (in_array ($ option_name , $ this ->post_meta_options , true )) {
218+ $ is_excluded = (bool ) is_rocket_post_excluded_option ($ option_name );
219+ if ($ is_excluded ) $ excluded_options [] = $ option_name ;
217220 }
218221 }
219- $ this ->result ['post_meta_excluded_options ' ] = $ result ;
222+ $ this ->result ['post_meta_excluded_options ' ] = $ excluded_options ;
220223 }
221224 public function get_list ()
222225 {
0 commit comments