WooCommerce Pre-Orders cron job not functioning as intended
-
In the Woocommerce Pre Orders plugin, there’s a cron job function that disables the ‘Enable Pre-Orders’ check for products for which the availability date/time has already passed. Unfortunately, in my case the products stay on Pre-Order, hence showing up on my website as “Pre-Order Now”.
I’ve tried to manually run the cron job, but that doesnt fix the issue either. The only option I have is to either manually disable all of them, or for me to run an SQL query finding all posts for which the datetime has already passed:
SELECT * FROM
wp_postmeta
WHERE meta_key = ‘_wc_pre_orders_enabled’ AND meta_value = ‘yes’ AND post_id IN (SELECT post_id FROMwp_postmeta
WHERE meta_key = ‘_wc_pre_orders_availability_datetime’ AND meta_value < UNIX_TIMESTAMP(UTC_TIMESTAMP)) ORDER BYpost_id
DESCIs there any way to fix this? I no longer have support for the plugin but would hate to have to manually update each time after a product has already arrived.
-
If I understand correctly, the
wc_pre_orders_completion_check
cron event is sitting in the cron events queue and not running, is that right?Are your other cron events running properly? To check this, you can load up the free WP Crontrol plugin: https://wordpress.org/plugins/wp-crontrol/
Then, check to see if all of your cron events say
now
or if they are scheduled for the future: https://d.pr/i/ucEAiqnow
indicates that they are scheduled for a past date/time, and aren’t being triggered properly. If that’s the case, then you have an issue with your custom cron. I’d recommend re-enabling the WP CRON constant to verify that things work properly at that point, as a baseline.Thanks for looking into this.
It doesnt look like the cron processing is the issue. As shared, I have tried to manually run the cron job (using WP-Cron) but it doesnt fix the problem.
wc_pre_orders_completion_check is there, shows are recurrence every 60 minutes, but then the last run shows as 2020-01-16 13:34:14 (now), even though its actually the 19th of January today. Running the cron job manually doesnt fix it.
Also, the issue has been present for much longer than 01/16.
Running cron events from the Cron Events list often doesn’t complete, from my experience, and I don’t think that’s a reliable indicator of much.
I really do recommend that you consider re-enabling WP CRON, just to test this out – it’s a very simple thing to do, and I can say from experience that it can often run things differently than a custom cron ping, or running them manually via CLI. There’s nothing to lose, anyway, and you can just turn it back off if it doesn’t prove to be effective after this is all over.
Another thing I would suggest is some basic conflict testing. I’ve found that there can be 3rd-party plugins or custom code that will prevent cron events from running, even though there’s no error that is output indicating such.
Hi NickGreen,
Thank you once again for following up. WP-Cron has been enabled since last week. Currently, WP-Cron still lists wc_pre_orders_completion_check as last completed on 2020-01-16 13:34:14 (now) while its listed as running Every 60 minutes.
I have tried disabling all plugins except Woocommerce and Pre-Orders, but to no avail. It is still not removing the old products, except for those I’ve manually disabled via SQL.
Hi there, could you copy/paste the Site Status Report in a reply here? I’d like to verify the current versions of each of the plugins. You can get it from WooCommerce > status.
Also, if you get a chance to temporarily switch to a default theme, such as Twenty Twenty, then we could also rule out a theme or custom code conflict.
Hi NickGreen,
I just tested switching to Twenty Twenty (I had it removed, but added it and removed it again because I do not like to keep unused Themes on server), but to no avail. The test product I created with yesterday’s date, still shows up as Active Pre-Order.
Here’s the Site Status Report:
### WordPress Environment ### WordPress address (URL): OMITTED Site address (URL): OMITTED WC Version: 3.8.1 REST API Version: ✔ 1.0.2 Log Directory Writable: ✔ WP Version: 5.3.2 WP Multisite: – WP Memory Limit: 2 GB WP Debug Mode: – WP Cron: ✔ Language: en_US External object cache: – ### Server Environment ### Server Info: Apache PHP Version: 7.2.26 PHP Post Max Size: 1 GB PHP Time Limit: 1800 PHP Max Input Vars: 1000 cURL Version: 7.62.0 OpenSSL/1.0.2k SUHOSIN Installed: – MySQL Version: 5.5.5-10.3.21-MariaDB Max Upload Size: 1 GB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### Database ### WC Database Version: 3.8.1 WC Database Prefix: wp_ Total Database Size: 657.70MB Database Data Size: 529.40MB Database Index Size: 128.30MB wp_woocommerce_sessions: Data: 338.91MB + Index: 4.50MB + Engine MyISAM wp_woocommerce_api_keys: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_woocommerce_attribute_taxonomies: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_downloadable_product_permissions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_order_items: Data: 0.54MB + Index: 0.25MB + Engine MyISAM wp_woocommerce_order_itemmeta: Data: 3.37MB + Index: 2.08MB + Engine MyISAM wp_woocommerce_tax_rates: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_tax_rate_locations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_shipping_zones: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_shipping_zone_locations: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_woocommerce_shipping_zone_methods: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_payment_tokens: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_woocommerce_payment_tokenmeta: Data: 0.01MB + Index: 0.02MB + Engine MyISAM wp_woocommerce_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM crypto_files: Data: 0.02MB + Index: 0.33MB + Engine InnoDB crypto_membership: Data: 0.02MB + Index: 0.09MB + Engine InnoDB crypto_payments: Data: 0.02MB + Index: 0.31MB + Engine InnoDB crypto_products: Data: 0.02MB + Index: 0.25MB + Engine InnoDB wp_amazon_accounts: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_amazon_btg: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_amazon_categories: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_amazon_feeds: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_amazon_feed_templates: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_amazon_feed_tpl_data: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_amazon_feed_tpl_values: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_amazon_jobs: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_amazon_listings: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_amazon_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_amazon_markets: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_amazon_orders: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_amazon_payment: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_amazon_profiles: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_amazon_reports: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_amazon_shipping: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_amz_assets: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_amz_cross_sell: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_amz_products: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_amz_report_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_AnythingPopup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_cftemail_forms: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_cftemail_messages: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_commentmeta: Data: 0.09MB + Index: 0.08MB + Engine MyISAM wp_comments: Data: 1.37MB + Index: 0.80MB + Engine MyISAM wp_ebay_accounts: Data: 0.01MB + Index: 0.00MB + Engine MyISAM wp_ebay_auctions: Data: 0.62MB + Index: 0.01MB + Engine MyISAM wp_ebay_categories: Data: 1.03MB + Index: 0.55MB + Engine MyISAM wp_ebay_jobs: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_ebay_log: Data: 0.02MB + Index: 0.01MB + Engine MyISAM wp_ebay_messages: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_ebay_orders: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_ebay_payment: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_ebay_profiles: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_ebay_shipping: Data: 0.01MB + Index: 0.00MB + Engine MyISAM wp_ebay_sites: Data: 0.03MB + Index: 0.00MB + Engine MyISAM wp_ebay_store_categories: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_ebay_transactions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_ebcpf_custom_products: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_ebcpf_ebay_accounts: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_ebcpf_ebay_currency: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_ebcpf_ebay_shipping: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_ebcpf_feeds: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_email_log: Data: 7.32MB + Index: 0.01MB + Engine MyISAM wp_faq_termmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_feedmanager_channel: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_feedmanager_country: Data: 0.01MB + Index: 0.02MB + Engine MyISAM wp_feedmanager_errors: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_feedmanager_feed_status: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_feedmanager_field_categories: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_feedmanager_product_feed: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_feedmanager_product_feedmeta: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_feedmanager_source: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_links: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_mail_bank_email_logs: Data: 16.52MB + Index: 0.00MB + Engine InnoDB wp_ms_snippets: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_nf3_actions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_nf3_action_meta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_nf3_fields: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_nf3_field_meta: Data: 0.01MB + Index: 0.00MB + Engine MyISAM wp_nf3_forms: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_nf3_form_meta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_nf3_objects: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_nf3_object_meta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_nf3_relationships: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_options: Data: 15.13MB + Index: 1.81MB + Engine MyISAM wp_pmxi_files: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_pmxi_history: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_pmxi_images: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_pmxi_imports: Data: 0.01MB + Index: 0.00MB + Engine MyISAM wp_pmxi_posts: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_pmxi_templates: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_postmeta: Data: 45.31MB + Index: 15.98MB + Engine MyISAM wp_posts: Data: 18.05MB + Index: 1.93MB + Engine MyISAM wp_relevanssi: Data: 10.88MB + Index: 17.68MB + Engine MyISAM wp_relevanssi_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_relevanssi_stopwords: Data: 0.01MB + Index: 0.01MB + Engine MyISAM wp_revslider_css: Data: 0.09MB + Index: 0.01MB + Engine MyISAM wp_revslider_layer_animations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_revslider_navigations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_revslider_settings: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_revslider_sliders: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_revslider_slides: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_revslider_static_slides: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_sabre_table: Data: 0.50MB + Index: 0.39MB + Engine MyISAM wp_snippets: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_social_users: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_termmeta: Data: 0.03MB + Index: 0.03MB + Engine MyISAM wp_terms: Data: 0.05MB + Index: 0.07MB + Engine MyISAM wp_term_relationships: Data: 0.44MB + Index: 0.89MB + Engine MyISAM wp_term_taxonomy: Data: 0.02MB + Index: 0.04MB + Engine MyISAM wp_usermeta: Data: 6.24MB + Index: 3.58MB + Engine MyISAM wp_users: Data: 0.09MB + Index: 0.08MB + Engine MyISAM wp_wc_admin_notes: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_admin_note_actions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_customer_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_download_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_order_coupon_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_order_product_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_order_stats: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_order_tax_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wc_product_meta_lookup: Data: 0.21MB + Index: 0.29MB + Engine MyISAM wp_wc_tax_rate_classes: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_wc_webhooks: Data: 0.00MB + Index: 0.00MB + Engine MyISAM wp_wps_hit: Data: 3.92MB + Index: 7.37MB + Engine MyISAM wp_wps_index: Data: 24.62MB + Index: 35.39MB + Engine MyISAM wp_wps_key: Data: 0.91MB + Index: 1.22MB + Engine MyISAM wp_wps_object_type: Data: 0.00MB + Index: 0.01MB + Engine MyISAM wp_wps_query: Data: 0.35MB + Index: 0.39MB + Engine MyISAM wp_wps_uri: Data: 1.74MB + Index: 0.52MB + Engine MyISAM wp_wps_user_agent: Data: 0.35MB + Index: 0.05MB + Engine MyISAM wp_yith_wcwl: Data: 11.90MB + Index: 8.46MB + Engine MyISAM wp_yith_wcwl_lists: Data: 18.18MB + Index: 22.54MB + Engine MyISAM wp_yoast_seo_links: Data: 0.30MB + Index: 0.07MB + Engine MyISAM wp_yoast_seo_meta: Data: 0.10MB + Index: 0.10MB + Engine MyISAM ### Security ### Secure connection (HTTPS): ✔ Hide errors from visitors: ✔ ### Active Plugins (29) ### Code Snippets: by Shea Bunge – 2.13.3 Disable Comments: by Samir Shah – 1.10.2 Facebook for WooCommerce: by Facebook – 1.9.15 – Not tested with the active version of WooCommerce Flexible Shipping: by WP Desk – 3.9.6 Header and Footer Scripts: by Digital Liberation – 2.1.1 Login No Captcha reCAPTCHA (Google): by Robert Peake – 1.6.7 Manage XML-RPC: by brainvireinfo – 1.0 Nextend Social Login: by Nextendweb – 3.0.20 Post SMTP: by Yehuda Hassine – 2.0.9 PricePanda Product Feed for WooCommerce: by AppieGeek – 1.0 – Not tested with the active version of WooCommerce Relevanssi: by Mikko Saari – 4.4.1 reSmush.it Image Optimizer: by reSmush.it – 0.2.4 Tawk.to Live Chat: by Tawkto – 0.4.1 Bitcoin Payment Gateway for WooCommerce: by TripleA – 1.2.0 – Not tested with the active version of WooCommerce Woocommerce delete product images: by Husain Ahmed – 1.0.2 – Not tested with the active version of WooCommerce WooCommerce Xfers Payment Gateway: by – 2.0 – Not tested with the active version of WooCommerce WooCommerce Extended Coupon Features FREE: by Soft79 – 3.1.2 – Not tested with the active version of WooCommerce Call for Price for WooCommerce: by Tyche Softwares – 3.2.7 – Not tested with the active version of WooCommerce WooCommerce Print Invoice & Delivery Note: by Tyche Softwares – 4.5.3 – Not tested with the active version of WooCommerce WooCommerce Stripe Gateway: by WooCommerce – 4.3.1 WooCommerce Pre-Orders: by WooCommerce – 1.5.21 WooCommerce Product Search: by itthinx – 2.19.0 WooCommerce: by Automattic – 3.8.1 WooSidebars: by WooCommerce – 1.4.5 Yoast SEO: by Team Yoast – 12.9 WP Crontrol: by John Blackbourn & crontributors – 1.7.1 WP-Lister Lite for eBay: by WP Lab – 2.2.10 WPForms Lite: by WPForms – 1.5.8.2 YITH WooCommerce Wishlist: by YITH – 3.0.5 ### Inactive Plugins (2) ### WooCommerce Product Feed: by WebAppick – 3.2.13 WP Product Feed Manager: by Michel Jongbloed – 1.19.0 ### Settings ### API Enabled: ✔ Force SSL: ✔ Currency: SGD (S$ ) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: ✔ ### WC Pages ### Shop base: ❌ Page not set Cart: #6038 - /cart/ Checkout: #6046 - /checkout/ My account: #6036 - /my-account/ Terms and conditions: #8466 - /terms-conditions/ ### Theme ### Name: Flatsome Child Version: 3.0 Author URL: Child Theme: ✔ Parent Theme Name: Flatsome Parent Theme Version: 3.10.1 Parent Theme Author URL: http://www.uxthemes.com/ WooCommerce Support: ✔ ### Templates ### Overrides: flatsome/woocommerce/archive-product.php flatsome/woocommerce/cart/cart-empty.php flatsome/woocommerce/cart/cart-shipping.php flatsome/woocommerce/cart/cart.php flatsome/woocommerce/checkout/form-checkout.php flatsome/woocommerce/checkout/form-coupon.php flatsome/woocommerce/checkout/terms.php flatsome/woocommerce/checkout/thankyou.php flatsome/woocommerce/content-product.php flatsome/woocommerce/content-product_cat.php flatsome/woocommerce/content-single-product.php flatsome/woocommerce/content-widget-product.php flatsome/woocommerce/global/breadcrumb.php flatsome/woocommerce/global/quantity-input.php flatsome/woocommerce/global/wrapper-end.php flatsome/woocommerce/global/wrapper-start.php flatsome/woocommerce/loop/loop-end.php flatsome/woocommerce/loop/loop-start.php flatsome/woocommerce/loop/pagination.php flatsome/woocommerce/loop/result-count.php flatsome/woocommerce/loop/sale-flash.php flatsome/woocommerce/myaccount/form-login.php flatsome/woocommerce/myaccount/navigation.php flatsome/woocommerce/notices/error.php flatsome/woocommerce/notices/notice.php flatsome/woocommerce/notices/success.php flatsome/woocommerce/product-searchform.php flatsome/woocommerce/single-product/photoswipe.php flatsome/woocommerce/single-product/price.php flatsome/woocommerce/single-product/product-image.php flatsome/woocommerce/single-product/product-thumbnails.php flatsome/woocommerce/single-product/rating.php flatsome-child/woocommerce/single-product/related.php version 1.6.4 is out of date. The core version is 3.0.0 flatsome/woocommerce/single-product/review.php flatsome/woocommerce/single-product/sale-flash.php flatsome/woocommerce/single-product/share.php flatsome/woocommerce/single-product/short-description.php flatsome/woocommerce/single-product/tabs/tabs.php flatsome/woocommerce/single-product/title.php flatsome/woocommerce/single-product/up-sells.php flatsome/woocommerce/single-product-reviews.php flatsome/woocommerce/single-product.php Outdated Templates: ❌ Learn how to update ### Action Scheduler ### Complete: 2 Oldest: 2020-01-16 13:28:49 +0800 Newest: 2020-01-16 13:28:49 +0800 Pending: 2 Oldest: 2020-01-23 13:28:49 +0800 Newest: 2020-01-23 13:28:49 +0800 Canceled: 167 Oldest: 2019-06-04 11:21:53 +0800 Newest: 2019-06-17 10:56:05 +0800 In-progress: 0 Oldest: – Newest: – Failed: 0 Oldest: – Newest: –
Thanks for the further details. I just tried to duplicate this on my local site by creating a test Pre-Order product which was set to become available in a few minutes.
I then took a look at the Cron Events, and I can see the pre orders event here: https://d.pr/i/DOkNU7
I then waited until the scheduled time, loaded the front end of my site (to trigger WP CRON), and the event ran as expected. Here you see it re-scheduled for another 60 minutes from now: https://d.pr/i/kHBsiZ
I double-checked, and sure enough, the pre-order product is now available for immediate purchase, as expected.
This doesn’t help you particularly, except to point out that on a fresh install, the same issue isn’t happening, so it’s likely to be specific to your website.
You said in a previous reply that “It doesnt look like the cron processing is the issue.” however, you didn’t clarify if other cron events are running as expected. When you look at the cron events list, are _any_ of the cron events running at their scheduled time?
Actually, now that I look at that, yeah it looks like the majority of tasks show next run cron job as several days ago.. What’s causing that?
OK, good, that’s really important to know. What it likely means is that the problem isn’t specifically with Pre-Orders, but rather that your Cron just isn’t working as expected.
Your status report shows that WP Cron is enabled, yet your Cron events aren’t firing. There are usually 2 reasons why this could be:
– Cron just isn’t working, for whatever reason. Sometimes host settings will interfere with WP CRON. You could try turning on Alternate Cron temporarily and see if your events start firing.
– Plugins hooking into cron are erroring or going into infinite loops, preventing Cron actions from completing. When you said, “I have tried disabling all plugins except Woocommerce and Pre-Orders, but to no avail.” Can you verify that you disabled them, tried to ping WP Cron, and gave it enough time to run any/all Cron events? You might also literally disable all plugins and theme, and see if any Cron events are running at all.We haven’t heard back from you in a while, so I’m going to mark this as resolved. Feel free to start a new thread if you have any further questions!
Hi Austin,
Apologies, I was away for a couple of days. The issue is not yet resolved.
Apparently there are multiple issues with my cron jobs and scheduled tasks. Doing some more testing, I can see that they run only when all my plugins are disabled, which confused me earlier, because it did not seem to make a difference before.
How can I find out which plugin could potentially be causing the cron jobs from running successfully? Is there a better plugin than WP-Cron to debug WordPress Cron events?
Also how do I ‘ping WP Cron’?
I just added ALTERNATE_WP_CRON to my wpconfig and notice that all cron jobs are running properly. Is there a way/need to fix the original Cron issue in this case?
As of late, I’m getting fatal errors for several of my plugins that seem to be related to cron jobs. Is this all related to Abandoned Cart Recovery cron job? My cron issues started before I installed their plugin..
Error Details
=============
An error of type E_ERROR was caused in line 110 of the file /home/username/public_html/wp-content/plugins/woocommerce-abandoned-cart-recovery/includes/email/send-email-cron.php. Error message: Uncaught Error: Call to a member function get_name() on boolean in /home/username/public_html/wp-content/plugins/woocommerce-abandoned-cart-recovery/includes/email/send-email-cron.php:110
Stack trace:
#0 /home/username/public_html/wp-content/plugins/woocommerce-abandoned-cart-recovery/includes/email/send-email-cron.php(67): WACVP\Inc\Email\Send_Email_Cron->email_content(Object(stdClass), ‘26719’)
#1 /home/username/public_html/wp-includes/class-wp-hook.php(288): WACVP\Inc\Email\Send_Email_Cron->send_reminder_mail(”)
#2 /home/username/public_html/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters(”, Array)
#3 /home/username/public_html/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
#4 /home/username/public_html/wp-content/plugins/woocommerce-abandoned-cart-recovery/includes/cron.php(51): do_action(‘wacv_cron_send_…’)
#5 /home/username/public_html/wp-includes/class-wp-hook.php(288): WACVP\Inc\Cron->wacv_execute_cron()
#6 /home/username/public_html/wp-includes/class-wp-hook.php(312): WP_Hook->Hi there, yes, that error that you posted here is directly related to the abandoned cart plugin. Specifically, there is a reminder email coming from that plugin which is causing an error – either it’s a problem with the email template or with the code in the plugin which sends that email.
The first things I would try are:
1. Update all of your plugins and theme and see if the errors go away.
2. Deactivate the abandoned cart plugin and see if Cron starts up again (you can temporarily deactivate Alternative Cron to see if it was the errors that were preventing Cron from running at all).Cron not running can happen for various reasons. For example, sometimes a specific Cron Event can be causing errors which stop it from completing, and therefore gum up the works. Deactivating the plugins associated with fatal errors can sometimes help with that.
Also, it could simply be a host-level problem. If that’s the case, then you could consider replacing WP CRON with a server-side cron job, as briefly explained here: https://automatewoo.com/docs/replace-wordpress-cron-real-cron-job/
- The topic ‘WooCommerce Pre-Orders cron job not functioning as intended’ is closed to new replies.