Title: recurring message in php_errorlog
Last modified: March 26, 2021

---

# recurring message in php_errorlog

 *  Resolved [keithhill1968](https://wordpress.org/support/users/keithhill1968/)
 * (@keithhill1968)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/recurring-message-in-php_errorlog/)
 * hi Guys, I am suddenly seeing logs size increasing very quickly with the error
   below , there doesn’t seem to need to be any visit to a particular page. check
   the firewall and not too many blocks .
 * Everything looks to be running ok, except the below notice was present 25000 
   times. Any guidance on what could possible be causing this would be greatly appreciated
 * Thanks
    Keith
 * `[26-Mar-2021 02:07:26 UTC] get_cart was called incorrectly. Get cart should 
   not be called before the wp_loaded action. Backtrace: require('wp-blog-header.
   php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('
   wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters,
   WC_Braintree->maybe_init_apple_pay, SkyVerge\WooCommerce\PluginFramework\v5_10_5\
   SV_WC_Payment_Gateway_Plugin->maybe_init_apple_pay, WC_Braintree->build_apple_pay_instance,
   SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway_Apple_Pay-
   >__construct, SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\
   External_Checkout->__construct, SkyVerge\WooCommerce\PluginFramework\v5_10_5\
   Payment_Gateway\External_Checkout\External_Checkout->init, SkyVerge\WooCommerce\
   PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\External_Checkout->
   get_processing_gateway, SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\
   External_Checkout\External_Checkout->get_supporting_gateways, WC_Payment_Gateways-
   >get_available_payment_gateways, apply_filters('woocommerce_available_payment_gateways'),
   WP_Hook->apply_filters, WC_Gateway_Afterpay->check_cart_within_limits, WC_Cart-
   >get_cart, WC_Cart_Session->get_cart_from_session, WC_Cart->calculate_totals,
   WC_Cart->is_empty, WC_Cart->get_cart, wc_doing_it_wrong. This message was added
   in version 2.3.`
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Frecurring-message-in-php_errorlog%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [Simon](https://wordpress.org/support/users/simonskyverge/)
 * (@simonskyverge)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/recurring-message-in-php_errorlog/#post-14238139)
 * Hi [@keithhill1968](https://wordpress.org/support/users/keithhill1968/),
 * Thanks for reaching out and thanks so much for sharing that log snippet, that’s
   very useful!
 * It looks like our Braintree Gateway is checking if Apple Pay should be initiated
   on ‘init’, which eventually works it’s way through the code to the External_Checkout
   code. Here it’s confirming what payment gateways are available by calling ‘_woocommerce\
   _available\_payment\_gateways_‘ which the **WC_Gateway_Afterpay** then seems 
   to jump onto.
 * Here, the Afterpay gateway looks to be calling the _get\_cart()_ function which
   is generating the error.
 * To confirm I’m reading this correctly, can you let me know if you’re also running
   the Afterpay gateway on your site? If so, has this only occurred since upgrading
   either Braintree or have you also upgraded Afterpay recently too?
 * Cheers!
 * Simon.
 *  Thread Starter [keithhill1968](https://wordpress.org/support/users/keithhill1968/)
 * (@keithhill1968)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/recurring-message-in-php_errorlog/#post-14241306)
 * Hi Simon, thanks for the response,
    Yes I am running the braintree payment gateway,
   but I don’t have apple pay enabled. I have the afterpay gateway running, and 
   seem to recall it was recently updated, honestly don’t recall when though. within
   the last few weeks I think
 * Current versions :
    wordpress is running 5.7
 * woocommerce is version 5.1.0
    BrainTree for woocommerce is version 2.5.0 Afterpay
   gateway is 2.2.2
 *  [Simon](https://wordpress.org/support/users/simonskyverge/)
 * (@simonskyverge)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/recurring-message-in-php_errorlog/#post-14247612)
 * Hey [@keithhill1968](https://wordpress.org/support/users/keithhill1968/),
 * Thanks for confirming! Even without Apple Pay enabled, these functions would 
   still be run by our plugin, as they check to see if Apple Pay should be added
   as an available gateway (in case it was enabled!).
 * Thanks for confirming you are running AfterPay on your site and that it was recently
   updated. I would recommend reaching out to their support team and sharing the
   stack trace you’ve shared with us. Hopefully, they’ll be able to add some preventative
   code to stop the error from being logged!
 * I’m sorry I can’t help directly, though I hope this was useful nonetheless. Is
   there anything else I can help out with today?
 * Cheers!
 * Simon.
 *  Thread Starter [keithhill1968](https://wordpress.org/support/users/keithhill1968/)
 * (@keithhill1968)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/recurring-message-in-php_errorlog/#post-14251898)
 * Hi Simon, I’ll chase Afterpay
 * Appreciate your support
 * thanks
    Keith
 *  [Simon](https://wordpress.org/support/users/simonskyverge/)
 * (@simonskyverge)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/recurring-message-in-php_errorlog/#post-14252972)
 * Hey [@keithhill1968](https://wordpress.org/support/users/keithhill1968/),
 * Great stuff! Thanks for keeping me in the loop. If there’s anything else I can
   help with, or if they have any suggestions for us, please don’t hesitate to reach
   out!
 * Cheers,
 * Simon.
 *  [Steve](https://wordpress.org/support/users/skyvergesteve/)
 * (@skyvergesteve)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/recurring-message-in-php_errorlog/#post-14279162)
 * Hey [@keithhill1968](https://wordpress.org/support/users/keithhill1968/) ,
 * It has been a long time since we heard from you, so I’m going to mark this topic
   as resolved.
 * If you’re still experiencing issues please [take a look at our documentation](https://docs.woocommerce.com/document/woocommerce-gateway-paypal-powered-by-braintree/)
   for more information and [create a new thread](https://wordpress.org/support/plugin/woocommerce-gateway-paypal-powered-by-braintree/#new-post)
   if you have further questions.
 * Cheers,
 * Steve
 *  [figment](https://wordpress.org/support/users/joldeski/)
 * (@joldeski)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/recurring-message-in-php_errorlog/#post-14284462)
 * Sorry, but I have the same error. No apple pay running on the site
 * `[06-Apr-2021 17:46:38 UTC] get_cart was called incorrectly. Get basket should
   not be called before the wp_loaded action. Backtrace: require('wp-blog-header.
   php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('
   wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters,
   WC_Braintree->maybe_init_apple_pay, SkyVerge\WooCommerce\PluginFramework\v5_10_5\
   SV_WC_Payment_Gateway_Plugin->maybe_init_apple_pay, WC_Braintree->build_apple_pay_instance,
   SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway_Apple_Pay-
   >__construct, SkyVerge\WooCommerce\PluginFramework\v5_10_5\SV_WC_Payment_Gateway_Apple_Pay-
   >is_available, SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\
   External_Checkout->is_available, SkyVerge\WooCommerce\PluginFramework\v5_10_5\
   SV_WC_Payment_Gateway_Apple_Pay->get_accepted_currencies, SkyVerge\WooCommerce\
   PluginFramework\v5_10_5\Payment_Gateway\External_Checkout\External_Checkout->
   get_processing_gateway, SkyVerge\WooCommerce\PluginFramework\v5_10_5\Payment_Gateway\
   External_Checkout\External_Checkout->get_supporting_gateways, WC_Payment_Gateways-
   >get_available_payment_gateways, apply_filters('woocommerce_available_payment_gateways'),
   WP_Hook->apply_filters, Alg_WC_PGPP_Core->filter_available_payment_gateways_per_category,
   Alg_WC_PGPP_Core->do_disable_gateway_by_terms, WC_Cart->get_cart, wc_doing_it_wrong.
   This message was added in version 2.3.`
 *  [Steve](https://wordpress.org/support/users/skyvergesteve/)
 * (@skyvergesteve)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/recurring-message-in-php_errorlog/#post-14295604)
 * Hey [@keithhill1968](https://wordpress.org/support/users/keithhill1968/) ,
 * Thanks for the update on this, sorry to hear that the issue persists. Following
   up on Simon’s last post, did you get any additional information from AfterPay
   on this?
 * Cheers,
 * Steve
    SkyVerge

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘recurring message in php_errorlog’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-gateway-paypal-powered-by-braintree/assets/icon-
   256x256.png?rev=3234800)
 * [Braintree for WooCommerce Payment Gateway](https://wordpress.org/plugins/woocommerce-gateway-paypal-powered-by-braintree/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-gateway-paypal-powered-by-braintree/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-gateway-paypal-powered-by-braintree/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-gateway-paypal-powered-by-braintree/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-gateway-paypal-powered-by-braintree/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-gateway-paypal-powered-by-braintree/reviews/)

 * 8 replies
 * 4 participants
 * Last reply from: [Steve](https://wordpress.org/support/users/skyvergesteve/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/recurring-message-in-php_errorlog/#post-14295604)
 * Status: resolved