• Resolved Jose

    (@giuse)


    Hello

    Woocommerce 5.5.1 was causing mixed content errors on the cart page.

    No doubt, the errors were caused by WooCommerce. Tested with the default WordPress theme, also with Storefront, and no plugins, but WooCommerce 5.5.1. Probably some settings on the server together with WooCommerce were causing this issue. The issue was only on the cart page, and the mixed content was caused by assets (called also by the core) via http instead of https.

    Problem solved rolling back to version 5.4.2, without changing anything else.

    I think you should improve the testing of WooCommerce. These kinds of issues are not acceptable for a plugin with so many installations.
    The time you would spend testing the plugin would be saved by having fewer support requests.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Shaun Kuschel a11n

    (@shaunkuschel)

    Automattic Happiness Engineer

    Hey @giuse,

    Thanks for taking the time to bring this to our attention and share that feedback.

    I attempted to reproduce this issue on several of my test sites running WC 5.5.1 (with different server environments) but I didn’t see any mixed content errors on the cart page. I also looked to see if we’ve received any other reports of this happening but I wasn’t able to find anything. I suspect that you are probably correct about the server settings playing a role here, though, I can’t say for sure currently.

    Our dev team does a substantial amount of testing before releasing any updates, however, if you can provide any additional info about this mixed content error we’d certainly appreciate it.

    Since this thread was created, version 5.5.2 was released- which included several fixes for issues that were identified from the previous version, so I’d recommend testing version 5.5.2 on a staging copy of the site to see if the errors show on the cart page in that latest version as well. If so, you can share the details of the issue with the devs directly by creating a new issue on the public Github repo.

    Thread Starter Jose

    (@giuse)

    Hi @shaunkuschel

    thank you very much for your reply.

    I can say:

    – The.htaccess file has nothing strange
    – The website is connected with Cloudflare
    – The problem occurs also with all other plugins disabled and the theme Storefront ant TwentyTwentyOne, but not with WC 5.4.2
    – I tested WC 5.5.2 and the issue occurred again. I rolled back to WC 5.4.2 and the issue disappeared.

    So, I suppose it’s something in WC 5.5.1 and WC 5.5.2 that triggers a problem caused by Cloudflare.

    When you say you tested it on different server environments and the issue didn’t occur on your installations, I believe it. Maybe if you can do it, I would also do some tests using Cloudflare.
    I think it’s not WooCommerce alone. In another case you would have a lot of support requests, I agree with that.

    I will try to disable Cloudflare and I will let you know if it changes something.

    If Cloudflare is the cause, for me the problem will be solved by disabling it on the cart page. I will see.

    Thank you very much for your help.

    Thread Starter Jose

    (@giuse)

    Hello

    I haven’t really found the root cause of this issue. I can only say it happens with WC >= 5.5.0 on the cart page when you have an SSL with Cloudflare.

    In my case I solved with this quick. and dirty solution:

    add_filter( 'style_loader_src','my_force_asset_https' );
    add_filter( 'script_loader_src','my_force_asset_https' );
    
    function my_force_asset_https( $src ){
    	if( function_exists( 'is_cart' ) && is_cart() ){
    		return str_replace( 'https://','https://',$src );
    	}
    	return $src;
    }
    
    add_action('wp_print_scripts',function(){
        wp_dequeue_script('wc-password-strength-meter');
    } );

    I forced https for all the assets loaded on the cart page and dequeued wc-password-strength-meter because it was the only one that was still loading via http and I don’t need it.

    @shaunkuschel

    • This reply was modified 3 years, 4 months ago by Jose.

    Hey @giuse,

    I appreciate you sharing the solution that worked for you. You might also open up an issue about this on GitHub. That would let the developers know as well just in case there is anything in the code that needs to be altered.

    https://github.com/woocommerce/woocommerce/issues/new/choose

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Mixed content error in the cart page’ is closed to new replies.