Support » Plugin: Payment Plugins Braintree For WooCommerce » Checkout page crash after upgrade to 3.1.0

  • Resolved twowheeler

    (@twowheeler)


    We have been using 2.6.65 and it works great. When I test an upgrade to 3.1.0, the checkout page appears all distorted with giant images of credit card options (see screenshot) which repeat over and over until the page crashes with “PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/user/testdomain/wp-includes/rest-api.php on line 374” in the log, so it acts like some kind of infinite loop. This is on WC 3.8.1 and WP 5.3.1. I am using the dropin form. What should I do?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Payment Plugins

    (@mrclayton)

    @twowheeler are you using the cart flows plugin?

    Thread Starter twowheeler

    (@twowheeler)

    No.

    Plugin Author Payment Plugins

    (@mrclayton)

    Can you please provide your full stack trace? This isn’t a common issue so it’s most likely due to your combination of plugins.

    By seeing the stack trace it will give more clues.

    You can find that in your WooCommerce failure logs.

    Plugin Author Payment Plugins

    (@mrclayton)

    @twowheeler,

    I have seen this infinite loop behavior one other time and it’s because the merchant had hooked in to the WooCommerce template filter and was replacing templates that contained the string checkout/payment-method.php

    Our pugin uses the same name for a template so if you’re replacing the WooCommerce checkout/payment-method.php file, make sure you’re checking the default path so only WC’s template is replaced and not our plugin’s.

    One of the plugins you’re using could be doing that replacement, so if you don’t suspect you have any custom code I would start by investigating the plugins you have active.

    Thread Starter twowheeler

    (@twowheeler)

    The woocommerce log contains the same text as I posted above, so that isn’t much help. I’m not sure how to get a full stack trace in this situation. But meanwhile I will start deactivating the other plugins one by one to see if it clears up. I’ll let you know the outcome. Thanks.

    Thread Starter twowheeler

    (@twowheeler)

    BTW I grepped for the string ‘checkout/payment-method.php’ in the plugins folder and didn’t get any hits outside of braintree and woocommerce itself. Thanks for the thought.

    Thread Starter twowheeler

    (@twowheeler)

    Ok the conflict is with the OpenTickets plugin, which is unfortunate because the purpose of the site is to sell tickets created by this plugin. I’ve posted in both forums since I don’t know which one is the source of the error. Meanwhile, I can’t upgrade Braintree. Thanks for any help.

    Plugin Author Payment Plugins

    (@mrclayton)

    @twowheeler,

    Thanks for the info. Is the open tickets plug-in hosted on word press.org? If so can you please provide the link and I can do some testing.

    It will be relatively easy to determine where the error is occurring once I get my hands on that plugin.

    Thanks,

    Thread Starter twowheeler

    (@twowheeler)

    Yes here is the link.
    Thanks so much!

    Plugin Author Payment Plugins

    (@mrclayton)

    @twowheeler,

    I found the issue, it’s their plugin’s code. They are replacing any template that contains checkout/payment-method.php without checking where the template is coming from.

    Their plugin should only replace the checkout/payment-method.php template if the template_path contains woocommerce.

    Here is the code in their plugin that’s causing the problem:

    public static function wc_locate_template($current, $template_name, $template_path) {
    	$name = $template_name;
    	$found = self::locate_woo_template( $name );
    	return $found ? $found : $current;
    }

    Suggestion: only replace templates when the template originates from WooCommerce.

    public static function wc_locate_template($current, $template_name, $template_path) {
    	if(strstr($template_path, 'woocommerce')){
    		$name = $template_name;
    		$found = self::locate_woo_template( $name );
    		return $found ? $found : $current;
    	}
    	return $current;
    }
    Thread Starter twowheeler

    (@twowheeler)

    Whoa that works perfectly! Thank you!

    Plugin Author Payment Plugins

    (@mrclayton)

    @twowheeler I recommend you show that snippet of code to the ticket plugin devs and ask them to incorporate it in their next release.

    We always appreciate a good review 🙂

    Kind regards,

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Checkout page crash after upgrade to 3.1.0’ is closed to new replies.