Search

jQuery.cookie.js/jQuery.cookie.min.js scripts fail to load

This issue is a hosting one. It comes from an outdated MOD_SECURITY core ruleset. More information at GitHub.

The BEST option is to get your host to update the rule set. Contact your hosting provider for assistance.

We recommend changing the following filenames from:


wp-content/plugins/woocommerce/assets/js/jquery-cookie/jquery.cookie.js
wp-content/plugins/woocommerce/assets/js/jquery-cookie/jquery.cookie.min.js

to:


wp-content/plugins/woocommerce/assets/js/jquery-cookie/jquery_cookie.js
wp-content/plugins/woocommerce/assets/js/jquery-cookie/jquery_cookie.min.js

And add the following to your theme’s functions.php file:


add_action( 'wp_enqueue_scripts', 'custom_frontend_scripts' );
function custom_frontend_scripts() {

global $post, $woocommerce;

$suffix = defined( ‘SCRIPT_DEBUG’ ) && SCRIPT_DEBUG ? ” : ‘.min';
wp_deregister_script( ‘jquery-cookie’ );
wp_register_script( ‘jquery-cookie’, $woocommerce->plugin_url() . ‘/assets/js/jquery-cookie/jquery_cookie’ . $suffix . ‘.js’, array( ‘jquery’ ), ‘1.3.1’, true );

}

If you cannot do that, then you need to use this plugin.

Download
Back to the top