diff --git a/plugins/woocommerce/includes/class-wc-autoloader.php b/plugins/woocommerce/includes/class-wc-autoloader.php index ed18c81d9b8..f5e33279333 100644 --- a/plugins/woocommerce/includes/class-wc-autoloader.php +++ b/plugins/woocommerce/includes/class-wc-autoloader.php @@ -21,7 +21,8 @@ class WC_Autoloader { private $include_path = ''; private static array $known_classes_paths = array( - + 'WC_Product_Usage' => WC_ABSPATH . 'includes/product-usage/class-wc-product-usage.php', + 'WC_Product_Usage_Rule_Set' => WC_ABSPATH . 'includes/product-usage/class-wc-product-usage-rule-set.php', ); /** @@ -67,13 +68,13 @@ class WC_Autoloader { * @param string $class Class name. */ public function autoload( $class ) { - $class = strtolower( $class ); - if ( isset( self::$known_classes_paths[ $class ] ) ) { $this->load_file( self::$known_classes_paths[ $class ] ); return; } + $class = strtolower( $class ); + if ( 0 !== strpos( $class, 'wc_' ) ) { return; } diff --git a/plugins/woocommerce/includes/class-woocommerce.php b/plugins/woocommerce/includes/class-woocommerce.php index 85ce78999c1..426e98f9d9f 100644 --- a/plugins/woocommerce/includes/class-woocommerce.php +++ b/plugins/woocommerce/includes/class-woocommerce.php @@ -707,11 +707,6 @@ final class WooCommerce { */ include_once WC_ABSPATH . 'includes/wccom-site/class-wc-wccom-site.php'; - /** - * Product Usage - */ - include_once WC_ABSPATH . 'includes/product-usage/class-wc-product-usage.php'; - /** * Libraries and packages. */