observe(); ( new OrderNotifications() )->observe(); ( new AbandonedCart() )->observe(); } /** * Register the service — a no-op if WooCommerce isn't active, so we * never hook WooCommerce actions, schedule the abandoned-cart cron, or * touch `WC()`/`WC_Order` on a site that doesn't have it. * * @return void */ public static function register(): void { if ( ! self::is_active() ) { return; } new self(); } /** * Whether WooCommerce is active on this site. * * @return bool */ public static function is_active(): bool { return class_exists( 'WooCommerce' ); } }