Broken script dependencies leads to error on PDP
-
Hi guys,
I run this plugin along with the excellent Query Monitor plugin to watch performance & loads times. It shows script includes and other useful things including errors.
The Braintree plugin is including a
braintree-js-data-collector
script which is dependent onbraintree-js-client
, butbraintree-js-client
is only included on pages which include the braintree payment functionality (eg. Cart & Checkout). This results in an error being thrown on most site pages including PDP etc.Specifically,
woocommerce-gateway-paypal-powered-by-braintree/includes/class-wc-gateway-braintree-credit-card.php
128 public function enqueue_gateway_assets() {
129
130 // advanced/kount fraud tool
131 if ( $this->is_advanced_fraud_tool_enabled() ) {
132
133 // enqueue braintree-data.js library
134 wp_enqueue_script( 'braintree-js-data-collector', 'https://js.braintreeg ateway.com/web/' . WC_Braintree::BRAINTREE_JS_SDK_VERSION . '/js/data-collector.min.js', array( 'braintree-js-client' ), WC_Braintree::VERSION, true );I have advanced fraud enabled. Is
braintree-js-client
required for the advanced Fraud functionality to work or shouldbraintree-js-data-collector
not be included on PDP?If I remove the dependency I do not get any console errors.
When can your devs assess & release a fix for this?
- The topic ‘Broken script dependencies leads to error on PDP’ is closed to new replies.