How WooCommerce Subscriptions renewal payments can fail
WooCommerce Subscriptions renewal payments can show faulty behaviour by either not being processed or by being processed twice (or more). Here is what you can do when trying to troubleshoot this. Here is a checklist with troubleshooting steps. Scroll down for explanations and information about the steps.
How renewal payments are managed
WordPress schedules all timed events using its cron service. WooCommerce Subscriptions uses its action scheduler which is based on WordPress cron. When payments fail or are being processed twice, here is what you can check.
- Check the order notes of the failed order. Occurring errors are collected and printed out there. Most of the time it will provide an explanation or hint as to what went wrong.
- Put your site into debug mode. Try triggering a test renewal. Here is more information on our WooThemes documentation on how to test a WooCommerce Subscriptions renewal payment. Also check the scheduled action of WooCommerce Subscriptions carefully. Are there any double entries?
- Install and activate: https://wordpress.org/plugins/wp-crontrol/ – this plugin allows you to check the status of cron jobs. Go to the Tools -> Cron Events menu to manage cron events. There, all cron jobs are listed. Look at the “Recurrence” column. Any cron that has “Now” in the “Recurrence” column has failed. “Now” means “I should run now, but cannot”, thus it indicates a cron not running / failed.
Once the now vanishes and is replaced by dates in the future, you know your cron jobs are working normally again.
- Schedule a post for publishing to test CRON
- Sometimes the cord is simply not plugged in. Check whether cron is disabled in your
wp-config.phpyou can do so manually or via a plugin.
- A known issue can occur if the server date / time settings have been changed.
WooCommerce Subscriptions uses the action scheduler by ProsPress which aligns itself with the creation date of the Subscription. Once the server time has been changed, the action scheduler sometimes aligns itself again, creating a double charge for the Subscription, as it falsely considers the Subscription to have two creation dates at that point. This behaviour was completely fixed as of versiob 2.1 in WooCommerce Subscriptions. If you believe this is the case and you are getting double charges, please open a ticket at http://woocommerce.com and describe in the ticket when and how the server time was changed.
- There is an alternate cron that can be activated for troubleshooting. Sometimes this can solve your issue. You can do so manually or via a plugin.
- Deactivate all caching. Many caching mechanisms deliver static pages for speed optimisation. Since the WordPress cron needs active visits / page hits as trigger, this can interfere with cron. Caching plugins might leave static pages even after deactivation / deinstallation. Be thorough and read up on how to completely remove / deactivate your caching method.
- Some providers cache your site without you activating it. Check with your hosting provider.
- WPEngine can activate “WP Engine Alternate Cron” for you for troubleshooting: https://wpengine.com/support/wp-cron-wordpress-scheduling/
- Check due diligence such as possible conflict.
And as always, take a backup before you get to work.
After updating to woocommerce 3.x. I am having problem with with subscription renewal order (woocommerce subscription v2.2.4).
The Subscription renewal order created is null. Here is the screenshot : https://ibb.co/fbEYFk
This looks as if you will need to debug this.
I would create a staging site, put your gateway in testing, turn on debugging, trigger a renewal processing with the failed WooCommerce Subscriptions and see if I can reproduce a null order.