Thread Starter
Pete
(@capitaldigital)
I have turned off the Defer Render-blocking Javascript on SG Optimizer and the form now works. IS there a way around this so I can have it turned back on?
Thanks
Hi @capitaldigital
I hope you are doing good today.
In SG Optimizer settings can you exclude those files from “Defer Render-blocking” and see if this helps?
/wp-content/plugins/forminator/assets/js/library/jquery.validate.min.js
/wp-content/plugins/forminator/assets/forminator-ui/js/forminator-form.min.js
/wp-content/plugins/forminator/build/front/front.multi.min.js
/wp-content/plugins/forminator/assets/js/library/intlTelInput.min.js
Kind Regards,
Kris
Thread Starter
Pete
(@capitaldigital)
Thanks, there’s a dropdown but I don’t have any of those files as options.
Hi @capitaldigital
Usually, you need to type the file name like Forminator-form.min.js in the SG settings, but I made a test and it seems the plugin is not able to see the files.
Forminator uses the WordPress default functions to render the JS and CSS, so I suggest contacting plugin support.
A workaround is using a filter available on their description page https://wordpress.org/plugins/sg-cachepress/#description
<?php
add_filter( 'sgo_css_combine_exclude', 'css_combine_exclude' );
function css_combine_exclude( $exclude_list ) {
// Add the style handle to exclude list.
$exclude_list[] = 'forminator-icons';
$exclude_list[] = 'forminator-utilities';
$exclude_list[] = 'forminator-grid-default';
$exclude_list[] = 'forminator-forms-default-base';
$exclude_list[] = 'forminator-forms-default-select2';
$exclude_list[] = 'forminator-forms-default-full';
return $exclude_list;
}
add_filter( 'sgo_css_minify_exclude', 'css_minify_exclude' );
function css_minify_exclude( $exclude_list ) {
// Add the style handle to exclude list.
$exclude_list[] = 'forminator-intlTelInput';
$exclude_list[] = 'forminator-inputmask';
$exclude_list[] = 'forminator-inputmask';
$exclude_list[] = 'forminator-inputmask-binding';
$exclude_list[] = 'forminator-ui';
return $exclude_list;
}
please, give a try the above code using mu-plugin: https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins
Best Regards
Patrick Freitas
Hello @capitaldigital ,
We haven’t heard from you for several days now, so it looks like you don’t have any more questions for us.
Feel free to re-open this ticket if needed.
Kind regards
Kasia