thanks for sharing @utrenkner.
I had a similar issue but, in my case, it was CSS optimization which was causing some trouble.
In order to fix, I had to use some hooks that have not been mentioned in this thread:
remove_action('wp_footer', 'fvm_add_loadcss', PHP_INT_MAX);
remove_action('admin_enqueue_scripts', 'fastvelocity_min_load_admin_jscss', PHP_INT_MAX);
remove_action('style_loader_tag', 'fastvelocity_optimizecss', PHP_INT_MAX);
In case it can help someone else, this is the code I had to add to my functions.php:
function disable_fvm_functionality() {
$current_path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
if( strpos($current_path, '/newsletter/') !== false ) {
remove_action('wp_print_scripts', 'fastvelocity_min_merge_header_scripts', PHP_INT_MAX );
remove_action('wp_print_footer_scripts', 'fastvelocity_min_merge_footer_scripts', PHP_INT_MAX);
remove_action('wp_print_styles', 'fastvelocity_min_merge_header_css', PHP_INT_MAX );
remove_action('wp_print_footer_scripts', 'fastvelocity_min_merge_footer_css', PHP_INT_MAX);
remove_action('wp_print_styles', 'fastvelocity_add_google_fonts_merged', PHP_INT_MAX);
remove_action('wp_print_footer_scripts', 'fastvelocity_add_google_fonts_merged', PHP_INT_MAX );
remove_action('init', 'fastvelocity_min_disable_wp_emojicons', PHP_INT_MAX);
remove_action('template_redirect', 'fastvelocity_min_html_compression_start', PHP_INT_MAX);
remove_filter('style_loader_src', 'fastvelocity_remove_cssjs_ver', PHP_INT_MAX);
remove_filter('script_loader_tag', 'fastvelocity_min_defer_js', PHP_INT_MAX);
remove_action('wp_footer', 'fvm_add_loadcss', PHP_INT_MAX);
remove_action('admin_enqueue_scripts', 'fastvelocity_min_load_admin_jscss', PHP_INT_MAX);
remove_action('style_loader_tag', 'fastvelocity_optimizecss', PHP_INT_MAX);
}
}
add_action('template_redirect', 'disable_fvm_functionality');
In my case, I’ve disabled the plugin for all pages that match “/newsletter/” in the URL (replace “/newsletter/” according to your needs or use a different expression to match against).