File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ public function __construct() {
5959 add_filter ( 'rocket_exclude_js ' , [ $ this , 'exclude_plausible_js ' ] );
6060 add_filter ( 'rocket_minify_excluded_external_js ' , [ $ this , 'exclude_plausible_js ' ] );
6161 add_filter ( 'rocket_delay_js_exclusions ' , [ $ this , 'exclude_plausible_inline_js ' ] );
62+ add_filter ( 'rocket_delay_js_exclusions ' , [ $ this , 'exclude_by_proxy_endpoint ' ] );
6263 add_filter ( 'rocket_exclude_defer_js ' , [ $ this , 'exclude_plausible_js_by_relative_url ' ] );
6364 }
6465 }
@@ -126,6 +127,20 @@ public function exclude_plausible_js_by_relative_url( $excluded_js ) {
126127 return $ excluded_js ;
127128 }
128129
130+ /**
131+ * Dear WP Rocket/SG Optimizer/Etc. don't minify/combine/delay our API endpoint, please.
132+ *
133+ * @param $excluded_js
134+ *
135+ * @return mixed
136+ * @throws Exception
137+ */
138+ public function exclude_by_proxy_endpoint ( $ excluded_js ) {
139+ $ excluded_js [] = Helpers::get_rest_endpoint ( false );
140+
141+ return $ excluded_js ;
142+ }
143+
129144 /**
130145 * Dear WP Rocket/SG Optimizer/Etc., don't minify/combine/delay our external JS, please.
131146 *
You can’t perform that action at this time.
0 commit comments