22/**
33 * Detects third-party plugins relevant for compatibility checks.
44 *
5+ * @see self::scan() for the plugins list.
6+ *
57 * @package WooCommerce\PayPalCommerce\Compat\PluginDetector
68 */
79
810declare (strict_types=1 );
911
1012namespace WooCommerce \PayPalCommerce \Compat \PluginDetector ;
1113
12- /**
13- * Detects active plugins that may customize products
14- *
15- * @see self::scan() for the plugins list.
16- */
1714class PluginDetector {
1815
1916 /**
@@ -33,74 +30,34 @@ public function scan(): array {
3330 );
3431 }
3532
36- /**
37- * Checks whether WooCommerce Subscriptions is active.
38- *
39- * @return bool
40- */
4133 private function is_woocommerce_subscriptions_active (): bool {
4234 return class_exists ( \WC_Subscriptions::class );
4335 }
4436
45- /**
46- * Checks whether WooCommerce Gift Cards is active.
47- *
48- * @return bool
49- */
5037 private function is_woocommerce_gift_cards_active (): bool {
5138 return function_exists ( 'WC_GC ' );
5239 }
5340
54- /**
55- * Checks whether WooCommerce Product Bundles is active.
56- *
57- * @return bool
58- */
5941 private function is_woocommerce_product_bundles_active (): bool {
6042 return class_exists ( \WC_Bundles::class );
6143 }
6244
63- /**
64- * Checks whether WooCommerce Product Add-Ons is active.
65- *
66- * @return bool
67- */
6845 private function is_woocommerce_product_addons_active (): bool {
6946 return class_exists ( \WC_Product_Addons::class );
7047 }
7148
72- /**
73- * Checks whether WooCommerce Min/Max Quantities is active.
74- *
75- * @return bool
76- */
7749 private function is_woocommerce_min_max_quantities_active (): bool {
7850 return class_exists ( \WC_Min_Max_Quantities::class );
7951 }
8052
81- /**
82- * Checks whether WooCommerce Composite Products is active.
83- *
84- * @return bool
85- */
8653 private function is_woocommerce_composite_products_active (): bool {
8754 return class_exists ( \WC_Composite_Products::class );
8855 }
8956
90- /**
91- * Checks whether WooCommerce Per-Product Shipping is active.
92- *
93- * @return bool
94- */
9557 private function is_woocommerce_shipping_per_product_active (): bool {
9658 return class_exists ( \WC_Shipping_Per_Product_Init::class );
9759 }
9860
99- /**
100- * Checks whether WooCommerce Deposits is active.
101- *
102- * @return bool
103- */
10461 private function is_woocommerce_deposits_active (): bool {
10562 return defined ( 'WC_DEPOSITS_VERSION ' );
10663 }
0 commit comments