woocommerce / woocommerce

A customizable, open-source ecommerce platform built on WordPress. Build any commerce solution you can imagine.
https://woocommerce.com
9.29k stars 10.73k forks source link

Use modern A-S functions more cautiously #46632

Open andfinally opened 4 months ago

andfinally commented 4 months ago

Prerequisites (mark completed items with an [x]):

Issue Description:

WooCommerce 8.8.1 introduced some code dependent on Action Scheduler 3.3+. Under normal circumstances that'd be ok, as this WooCommerce version came with A-S 3.7.0 bundled with it. But other plugins that also bundle A-S may do load an old version of A-S unusually early, preventing the one in WC from loading. (For example WP Mail SMTP 2.8.0 enables its old version of A-S too early for a newer version of A-S to override it.) In this case, activating WooCommerce caused a fatal error like Call to undefined function as_has_scheduled_action, breaking wp-admin.

That immediate issue is being addressed in https://github.com/woocommerce/woocommerce/pull/46630. Other parts of WooCommerce also make calls on as_has_scheduled_action: BatchProcessingController and TransientFilesEngine. The issue seems less urgent there: these other calls do not cause errors which totally break wp-admin. But it may make sense to add some defensive conditions there too.

barryhughes commented 1 month ago

Changing team labels, I think it makes sense for Proton to tackle these. Somewhat related: https://github.com/woocommerce/woocommerce/pull/49243.