Hello @terrim,
The “siteground-optimizer-assets” folder contains all the minified and combined JS/CSS scripts of your website. The actual scripts, however, are generated by your application. In other words, the issue at hand is not a direct result of the Speed Optimizer plugin, but the “frontend-inspector-2290.min.js” script which is generated by the Yoast SEO plugin.
What I can recommend is to make sure that you have the latest version of the Yoast plugin installed on your website. You may also try to re-install the plugin to ensure that all of the core files are in place and none of them are corrupted.
Since you have mentioned that the issue disappears when you disable the Speed Optimizer, you may try to exclude the affected script from JavaScript combination:
https://eu.siteground.com/tutorials/wordpress/speed-optimizer/frontend-optimization/#Combine_CSS_and_JS_files
However, it is likely that the underlying issue with the script will remain, so if updating/re-installing the Yoast plugin does not resolve the issue you may consider reaching out to the plugin’s vendors for more information.
Kind Regards,
Preslav Kenanov
Hey @terrim,
Many issues can be solved by deactivating the Speed Optimizer (SO) setting that is causing the issue (vs deactivating completely the plugin). Did you try that?
Also, you can try the following:
- Disable CSS, JS, and HTML minification.
- Exclude the affected JS file (frontend-inspector-2290.min.js) from both combination and deferral using the exclusion dropdowns.
- If the affected JS file does not appear in the exclusions dropdown list, use the appropriate SO JS combine and defer exclusions filter (i.e., code snippet) to exclude it. Namely,
add_filter( 'sgo_javascript_combine_exclude', 'js_combine_exclude' );
function js_combine_exclude( $exclude_list ) {
$exclude_list[] = 'script-handle';
return $exclude_list;
}
and
add_filter( 'sgo_js_async_exclude', 'js_async_exclude' );
function js_async_exclude( $exclude_list ) {
$exclude_list[] = 'script-handle';
return $exclude_list;
}
Where the ‘script-handle‘ of the affected JS file can be obtained by temporarily using the following code snippet and performing a page souce inspection (i.e., “View page source”) of your affected website page.
add_filter( 'script_loader_tag', 'cameronjonesweb_add_script_handle', 10, 3 );
function cameronjonesweb_add_script_handle( $tag, $handle, $src ) {
return str_replace( '<script', sprintf(
'<script data-handle="%1$s"',
esc_attr( $handle )
), $tag );
}
Hope this helps a bit. Best wishes!