• Hello,

    it seems that the Mollie plugin for WordPress is loaded on every single page, also when no payments options are available whatsoever. I would like to ONLY load the script on the checkout page where this is relevant.

    Seems like an easy way to optimize the performance. Is this something you will integrate/change or should I run my own exclusion script?

    hope you can assist,

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter sanderrrrr

    (@sanderrrrr)

    Would you have any updates on this?
    It still appears in the source code of the live environment:

    <script type="rocketlazyloadscript">
    window.wc_ga_pro = {};
    
    window.wc_ga_pro.ajax_url = 'https://www.website.nl/wp-admin/admin-ajax.php';
    
    window.wc_ga_pro.available_gateways = {"mollie_wc_gateway_ideal":"iDEAL","ppcp-gateway":"PayPal","mollie_wc_gateway_bancontact":"Bancontact","mollie_wc_gateway_banktransfer":"Bankoverdracht","mollie_wc_gateway_klarnapaylater":"Achteraf betalen (+\u20ac1)","mollie_wc_gateway_creditcard":"Creditcard (+\u20ac1)","mollie_wc_gateway_applepay":"Apple Pay","mollie_wc_gateway_belfius":"Belfius Direct Net","mollie_wc_gateway_sofort":"SOFORT Banking"};
    
    // interpolate json by replacing placeholders with variables
    window.wc_ga_pro.interpolate_json = function( object, variables ) {
    
    	if ( ! variables ) {
    		return object;
    	}
    
    	var j = JSON.stringify( object );
    
    	for ( var k in variables ) {
    		j = j.split( '{$' + k + '}' ).join( variables[ k ] );
    	}
    
    	return JSON.parse( j );
    };
    
    // return the title for a payment gateway
    window.wc_ga_pro.get_payment_method_title = function( payment_method ) {
    	return window.wc_ga_pro.available_gateways[ payment_method ] || payment_method;
    };
    
    // check if an email is valid
    window.wc_ga_pro.is_valid_email = function( email ) {
      return /[^\s@]+@[^\s@]+\.[^\s@]+/.test( email );
    };
    
    </script>
    • This reply was modified 2 years, 2 months ago by sanderrrrr.
    • This reply was modified 2 years, 2 months ago by sanderrrrr.
    Plugin Support Syde Niklas

    (@niklasinpsyde)

    Hi @sanderrrrr

    It appears the scripts are indeed loaded on any page, but only when the WooCommerce Blocks features are loaded.
    In versions 7.3.4 and older, this required the WooCommerce Blocks feature plugin to be enabled. But in 7.3.5, these features are always available and as a result, also load the scripts on pages where they may not be needed.

    This should be resolved with the next update sometime in February.

    Kind regards,
    Niklas

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Mollie is loaded on every single page’ is closed to new replies.