• Resolved zmzdtc888

    (@zmzdtc888)


    Hi there

    My code snippets was updated to 3.1.1 this morning. However, after the update, my code just stopped working.

    Basically, my SG optimizer combines the JS from Square Payment so I add a filter to it.

    add_filter( 'sgo_javascript_combine_exclude', 'js_combine_exclude' );
    function js_combine_exclude( $exclude_list ) {
        $exclude_list[] = 'wc-square-payment-form';
        $exclude_list[] = 'wc-square-payment-gateway-payment-form';
        $exclude_list[] = 'wc-square';
        $exclude_list[] = 'wc-square-digital-wallet';
    
        return $exclude_list;
    }

    The code worked so far and there is no other change between the plugin update and the new error. Could you advise any possible cause?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Verdi Heinz

    (@ver3)

    We’re looking into it and will get back to you asap!

    Plugin Author Shea Bunge

    (@bungeshea)

    Hi @zmzdtc888,

    I don’t believe we changed anything in the plugin that should affect this. I’d recommend contacting the SiteGround people and checking whether the code snippet is still current.

    As an additional note, I’d avoid using generic function names like js_combine_exclude. It’s much better to write snippets using anonymous functions, like this:

    add_filter( 'sgo_javascript_combine_exclude', function ( $exclude_list ) {
        $exclude_list[] = 'wc-square-payment-form';
        $exclude_list[] = 'wc-square-payment-gateway-payment-form';
        $exclude_list[] = 'wc-square';
        $exclude_list[] = 'wc-square-digital-wallet';
    
        return $exclude_list;
    } );
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Code not working after auto update’ is closed to new replies.