• Resolved nileshkanani

    (@nileshkanani)


    I’m experiencing recurring fatal errors with the MailChimp for WooCommerce plugin during scheduled subscription payment processing. To keep the site from still processing the order, I have added some temporary validations, but wanted to check if this is a known issue and if it’s going to be addressed in a future plugin update.

    Error Message:

    Call to a member function get_meta() on false in 
    /wp-content/plugins/mailchimp-for-woocommerce/includes/class-mailchimp-woocommerce-service.php:100

    Stack Trace:

    #0 /wp-content/plugins/mailchimp-for-woocommerce/includes/class-mailchimp-woocommerce-service.php(585): MailChimp_Service->onNewOrder()
    #1 /wp-content/plugins/mailchimp-for-woocommerce/includes/class-mailchimp-woocommerce-service.php(595): MailChimp_Service->handleOrderSaved()
    #2 /wp-includes/class-wp-hook.php(324): MailChimp_Service->handleOrderCreate()
    #3 /wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #4 /wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 /wp-content/plugins/woocommerce/includes/data-stores/class-wc-order-data-store-cpt.php(113): do_action()
    #6 /wp-content/plugins/woocommerce/includes/class-wc-data-store.php(186): WC_Order_Data_Store_CPT->create()
    #7 /wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(224): WC_Data_Store->create()
    #8 /wp-content/plugins/woocommerce/includes/class-wc-order.php(273): WC_Abstract_Order->save()
    #9 /wp-content/plugins/woocommerce/includes/wc-core-functions.php(134): WC_Order->save()
    #10 /wp-content/plugins/woocommerce-subscriptions/includes/core/wcs-order-functions.php(236): wc_create_order()
    #11 /wp-content/plugins/woocommerce-subscriptions/includes/core/wcs-renewal-functions.php(29): wcs_create_order_from_subscription()
    #12 /wp-content/plugins/woocommerce-subscriptions/includes/core/class-wc-subscriptions-manager.php(143): wcs_create_renewal_order()
    #13 /wp-content/plugins/woocommerce-subscriptions/includes/core/class-wc-subscriptions-manager.php(116): WC_Subscriptions_Manager::process_renewal()
    #14 /wp-includes/class-wp-hook.php(324): WC_Subscriptions_Manager::prepare_renewal()

    Follow-up Error:

    scheduled action 35128365 (subscription payment) failed to finish processing after 300 seconds

    Environment:

    • WooCommerce Subscriptions: Active
    • Action Scheduler: Handling subscription renewals
    • The error occurs at line 100 in class-mailchimp-woocommerce-service.php where $order->get_meta('mailchimp_woocommerce_landing_site') is called

    Impact:
    This is causing subscription payment processing to fail and scheduled actions to timeout. The error appears to be happening when the plugin attempts to access order metadata during the subscription renewal process.

    Temporary Fix Applied:
    I’ve added validation checks in the following methods to ensure the order object exists before calling methods on it:

    1. onNewOrder() – Added check after line 92
    2. handleOrderCreate() – Added check after line 601
    3. handleOrderUpdate() – Added check after line 617
    if (!$order || !is_a($order, 'WC_Order')) {
    mailchimp_log('error', "MailChimp Service: Invalid order or order not found for ID: {$order_id}");
    return;
    }

    This temporary fix prevents the fatal error and logs instances where orders cannot be retrieved, allowing the site to continue functioning. 

    Please let me know if you need any additional information or debug logs to help diagnose this issue.

    • This topic was modified 7 months, 1 week ago by nileshkanani.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support KJ

    (@kjvextras)

    Hi @nileshkanani thanks for bringing this to our attention. We will look into this and will swing back around

    Chat soon

    Plugin Support KJ

    (@kjvextras)

    Hi @nileshkanani thanks again for bringing this to our attention. We currently have a fix in review, and will include this fix in our next release version. We appreciate your contribution

    Plugin Support KJ

    (@kjvextras)

    Hi there, we’re going to close out this ticket for now since it’s been a few weeks since we’ve been in touch.

    Please let us know if you still need any help and we’ll be glad to reopen and troubleshoot further. Please note, that the best way to reach us is over at the GitHub plugin page: https://github.com/mailchimp/mc-woocommerce/. From there, you can receive direct responses from the development team, log new issues, download the latest version, and track existing support tickets.

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

You must be logged in to reply to this topic.