• Resolved Jason

    (@galapogos01)


    When we upgrade a site to 3.2.5 it goes offline and gives the following critical error:

    PHP Fatal error:  Uncaught Error: Class 'WC_Braintree' not found in /wp-content/plugins/woocommerce-gateway-paypal-powered-by-braintree/includes/class-wc-gateway-braintree-paypal-blocks-support.php:20
    Stack trace:
    #0 /wp-content/plugins/woocommerce-gateway-paypal-powered-by-braintree/woocommerce-gateway-paypal-powered-by-braintree.php(601): WC_Gateway_Braintree_PayPal_Blocks_Support->__construct()
    #1 /wp-includes/class-wp-hook.php(324): WC_PayPal_Braintree_Loader->{closure}()
    #2 /wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #3 /wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 /wp-content/plugins/woocommerce/src/Blocks/Integrations/IntegrationRegistry.php(50): do_action()
    #5 /wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Blocks\Integrations\IntegrationRegistry->initialize()
    #6 /wp-includes/class-wp-hook.php(348): WP_Hook-> in /wp-content/plugins/woocommerce-gateway-paypal-powered-by-braintree/includes/class-wc-gateway-braintree-paypal-blocks-support.php on line 20
    Fatal error: Uncaught Error: Class 'WC_Braintree' not found in /wp-content/plugins/woocommerce-gateway-paypal-powered-by-braintree/includes/class-wc-gateway-braintree-paypal-blocks-support.php:20
    Stack trace:
    #0 /wp-content/plugins/woocommerce-gateway-paypal-powered-by-braintree/woocommerce-gateway-paypal-powered-by-braintree.php(601): WC_Gateway_Braintree_PayPal_Blocks_Support->__construct()
    #1 /wp-includes/class-wp-hook.php(324): WC_PayPal_Braintree_Loader->{closure}()
    #2 /wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #3 /wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 /wp-content/plugins/woocommerce/src/Blocks/Integrations/IntegrationRegistry.php(50): do_action()
    #5 /wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Blocks\Integrations\IntegrationRegistry->initialize()
    #6 /wp-includes/class-wp-hook.php(348): WP_Hook-> in /wp-content/plugins/woocommerce-gateway-paypal-powered-by-braintree/includes/class-wc-gateway-braintree-paypal-blocks-support.php on line 20
    Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.

    Downgrading to 3.2.3 resolves the issue.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support Moses M. (woo-hc)

    (@mosesmedh)

    Hi @galapogos01,

    The error you’re encountering happens because the WC_Braintree class, which is crucial for the Braintree for WooCommerce Payment Gateway plugin to function, is not found when the plugin tries to load its dependencies. This typically occurs when certain files or classes are missing after an update.

    A potential solution is to reinstall the plugin to ensure all necessary files are intact. Sometimes, plugin updates don’t fully complete, leaving files corrupted or incomplete. To do this, first deactivate the plugin from the WordPress admin panel and delete it. Afterward, download the latest version from the official WordPress repository or the plugin developer’s site. Upload the fresh copy to your WordPress installation and activate it again. This should help resolve the issue caused by missing or incomplete files.

    Additionally, I’d like to better understand your setup. Could you please share your system status report and any fatal error logs? You can find the system status report by going to WooCommerce > Status > Get Report > Copy for support in your WordPress admin panel. For the error logs, you can find them in WooCommerce > Status > Logs.

    You can then upload both the system status report and the error logs to Pastebin and share the link. This will help in diagnosing the issue more accurately.

    Thread Starter Jason

    (@galapogos01)

    I attempted this install a second time and encountered the same error. The fatal error log contains:

    2025-03-04T06:32:20+00:00 CRITICAL Uncaught Error: Class 'WC_Braintree' not found in /wp-content/plugins/woocommerce-gateway-paypal-powered-by-braintree/includes/class-wc-gateway-braintree-paypal-blocks-support.php:20 CONTEXT: {"error":{"type":1,"file":"/wp-content/plugins/woocommerce-gateway-paypal-powered-by-braintree/includes/class-wc-gateway-braintree-paypal-blocks-support.php","line":20},"backtrace":["","#0 /wp-content/plugins/woocommerce-gateway-paypal-powered-by-braintree/woocommerce-gateway-paypal-powered-by-braintree.php(605): WC_Gateway_Braintree_PayPal_Blocks_Support->__construct()","#1 /wp-includes/class-wp-hook.php(324): WC_PayPal_Braintree_Loader->{closure}()","#2 /wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()","#3 /wp-includes/plugin.php(517): WP_Hook->do_action()","#4 /wp-content/plugins/woocommerce/src/Blocks/Integrations/IntegrationRegistry.php(50): do_action()","#5 /wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Blocks\Integrations\IntegrationRegistry->initialize()","#6 /wp-includes/class-wp-hook.php(348): WP_Hook->"]}

    Downgrading to 3.2.3 is the only thing that works. Please provide some help.

    Thread Starter Jason

    (@galapogos01)

    The issue is related to line 64 in woocommerce-gateway-paypal-powered-by-braintree.php

    /** minimum WooCommerce version required by this plugin */
    const MINIMUM_WC_VERSION = '9.5';

    Setting this to 9.4 restores functionality. I am running WC 9.4.3 & WC 9.2.3.

    This highlights a few problems:

    1. Your dev team never tested this plugin with an older version of WC to make sure the deprecated version handling works. Your plugin somehow aborts the class registration but still registers Blocks support, meaning the Blocks code fails to find the class (see the original error). The code in woocommerce-gateway-paypal-powered-by-braintree.php line 108 should conditionally register blocks based on the same logic.
    2. The upcoming Braintree Certificate update, which is a breaking change, will block payments on all sites not running 3.2.6 or newer. Given 3.2.6 requires WC 9.5+, this will mean a lot of sites running WC 9.4 or older will break come June 30, 2025. I would recommend you lower the WC version requirement so that all users of the plugin can get the new certificate.

    Thanks,
    Jason

    Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello Jason,

    Thank you for your reply.

    I understand that updating Braintree for WooCommerce to 3.2.5 causes a critical error due to the class ‘WC_Braintree’ not being found.

    Could you share your site’s System Status Report?
    You can paste it into Pastebin and share the link here.

    May I ask why you’re using an older version of WooCommerce?
    I recommend updating to the latest 9.7.1 version.

    Also, I strongly advise against modifying the plugin code, as it may cause additional issues and isn’t covered by our support policy.

    Looking forward to your response. ??

    Thread Starter Jason

    (@galapogos01)

    @doublezed2

    You don’t need my system report. I’ve provided the relevant info to reproduce this fatal error.

    I run a few versions behind because it’s difficult to keep up with releases, especially when new features break existing functionality. I’m not alone in this, and as I’ve explained you’re going to have tens of thousands of sites on older versions of WooCommerce complaining once you force them to upgrade this plugin to fix the cert issue.

    I suggest your team lower the minimum supported version to avoid this.

    Thanks,

    Jason

    Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello Jason,

    Thank you for your reply.

    I understand that you prefer not to share a system status report, but it helps us in understanding your site’s configuration.

    Our support policy covers the latest WooCommerce release and the previous version. If your WooCommerce version is older than that, it falls outside our support scope. Updating to a supported version is recommended to ensure compatibility and security.

    Let me know if you have any questions, I am here to help. ??

    Best regards.

    Thread Starter Jason

    (@galapogos01)

    @doublezed2

    You are not addressing any of the key points in my messages and this is getting quite frustrating.

    1. Please address the bug where the unsupported version handling code in this plugin causes a fatal error when run with older versions of WooCommerce, due to the above mentioned Blocks error.
    2. I would suggest altering the support policy to handle the Braintree certificate expiration, which currently requires 3.2.6 of this plugin to work post June, and 3.2.6 currently causes fatal errors on older versions of WooCommerce.

    You can choose to ignore #2 at the expense of your other users but please address the bug in #1.

    Thanks, Jason

    As another user who is experiencing the same problem as Jason, I agree with everything he is suggesting. This is about to be a much bigger issue as site begin trying to upgrade to the Braintreee certificate expiration.

    Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello Jason,

    Thank you for your reply.

    I would appreciate it if you could share your site’s System Status Report with me.
    You can paste it into https://pastebin.com and share the link here.

    In the first message, you mentioned upgrading Braintree for WooCommerce to the version 3.2.5.
    I checked and confirmed that the Braintree for WooCommerce 3.2.5 supports WooCommerce 9.4.

    However, you shared this line of code which is from Braintree for WooCommerce 3.2.6.
    This made me think you might be using 3.2.6.

    /** minimum WooCommerce version required by this plugin */
    const MINIMUM_WC_VERSION = '9.5';

    I’m trying to explain that lack of system status report from your side is making this troubleshooting process slow.

    Having said that, if you are using Braintree for WooCommerce 3.2.6, you will need to meet the minimum WooCommerce version requirement of 9.5. I hope this answers your first point.

    Regarding your second point, I recommend you post it at our Feature request portal.
    This way your suggestion will be logged into the system and processed further.

    Please let me know if you have any more questions or concerns.

    Best regards.

    Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello jpollard,

    Thank you for your message here.

    I understand you are facing a similar problem.
    As per forum guidelines, I suggest you create a new topic so we can assist you separately.

    Additionally, you may also post your suggestion at our Feature request portal.

    Have a great day!

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.