• Looks like this has happened to a couple of other users before but I’m very occasionally getting the following error:

    2021-03-25T15:05:55+00:00 CRITICAL Uncaught Error: Cannot use object of type WP_Error as array in /public_html/wp-content/plugins/referralcandy-for-woocommerce/includes/class-rc-order.php:149
    Stack trace:
    #0 /public_html/wp-content/plugins/referralcandy-for-woocommerce/includes/class-wc-referralcandy-integration.php(209): RC_Order->submit_purchase()
    #1 /public_html/wp/wp-includes/class-wp-hook.php(294): WC_Referralcandy_Integration->rc_submit_purchase(70991)
    #2 /public_html/wp/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters(NULL, Array)
    #3 /public_html/wp/wp-includes/plugin.php(484): WP_Hook->do_action(Array)
    #4 /public_html/wp-content/plugins/woocommerce/includes/class-wc-order.php(363): do_action('woocommerce_ord...', 70991, Object(Automattic\WooCommerce\Admin\Overrides\Order))
    #5 /public_html/wp-content/plugins/woocommerce/includes/class-wc-order.php(221): WC_Order->status_trans in /home/goodlifecompetit/public_html/wp-content/plugins/referralcandy-for-woocommerce/includes/class-rc-order.php on line 149

    Looking at the code, it seems like you need to check if the $response is not a WP_Error before #L149. Something like:

    if ( is_wp_error( $response ) ) {
      return;
    }
    • This topic was modified 3 years, 8 months ago by Matt Rose.
    • This topic was modified 3 years, 8 months ago by Matt Rose.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello @boswall ,

    Apologies for the delay in response, and thank you for raising this. Our team is currently working on another update now, but we’ll include the fix for this issue on the next release.

    Thanks again!

    I’m experiencing the same issue, which is preventing some of our WooCommerce subscriptions from auto-renewing properly.

    Any ideas when the plugin might be updated to account for this bug?

    Also any idea why the API would be throwing an error?

    06-23-2021 @ 01:34:41 - scheduled action 941111 (subscription payment) failed to finish processing due to the following error: Uncaught Error: Cannot use object of type WP_Error as array in /nas/content/live/nybll/wp-content/plugins/referralcandy-for-woocommerce/includes/class-rc-order.php:149
    Stack trace:
    #0 /nas/content/live/nybll/wp-content/plugins/referralcandy-for-woocommerce/includes/class-wc-referralcandy-integration.php(209): RC_Order->submit_purchase()
    #1 /nas/content/live/nybll/wp-includes/class-wp-hook.php(294): WC_Referralcandy_Integration->rc_submit_purchase(75387)
    #2 /nas/content/live/nybll/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters(NULL, Array)
    #3 /nas/content/live/nybll/wp-includes/plugin.php(484): WP_Hook->do_action(Array)
    #4 /nas/content/live/nybll/wp-content/plugins/woocommerce/includes/class-wc-order.php(363): do_action('woocommerce_ord...', 75387, Object(WC_Order))
    #5 /nas/content/live/nybll/wp-content/plugins/woocommerce/includes/class-wc-order.php(221): WC_Order->status_transition()
    #6 /nas/content/live/nybll/wp-content/plugins/woocommerce/includes/class-wc-order.php(119): WC_Order->save()

    @jasonnrc,

    I just updated to the latest version (I was on v2.3.0), and it looks like the fix did NOT make it into the most recent releases (v2.3.1 or v2.3.2).

    Any idea when this will be fixed? For now, I’m going to fork the plugin code and just add the fix myself.

    @jasonnrc,

    I went ahead and create a pull request with the fix here:

    https://github.com/ReferralCandy/woocommerce-referralcandy/pull/40

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error’ is closed to new replies.