From b4fc1737bc0d3add2cd4ec85979f8ac000ee01e2 Mon Sep 17 00:00:00 2001 From: Brian Henry Date: Wed, 2 Jun 2021 23:39:48 -0700 Subject: [PATCH 1/2] Remove functionless ABSPATH check. Checking for ABSPATH is recommended so WordPress functions are not called before WordPress has been loaded. This does not apply to interfaces. --- includes/interfaces/class-wc-logger-interface.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/includes/interfaces/class-wc-logger-interface.php b/includes/interfaces/class-wc-logger-interface.php index 726b20cfe66..78b83df0ae6 100644 --- a/includes/interfaces/class-wc-logger-interface.php +++ b/includes/interfaces/class-wc-logger-interface.php @@ -6,10 +6,6 @@ * @package WooCommerce\Interface */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} - /** * WC Logger Interface * From d2d660a8060f703465bce477b52aca6ddd0ab236 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Thu, 3 Jun 2021 13:02:19 -0300 Subject: [PATCH 2/2] Remove ASBPATH check from interfaces --- .../class-wc-abstract-order-data-store-interface.php | 4 ---- includes/interfaces/class-wc-coupon-data-store-interface.php | 4 ---- .../interfaces/class-wc-customer-data-store-interface.php | 4 ---- .../class-wc-customer-download-data-store-interface.php | 4 ---- .../class-wc-customer-download-log-data-store-interface.php | 4 ---- includes/interfaces/class-wc-importer-interface.php | 4 ---- includes/interfaces/class-wc-log-handler-interface.php | 4 ---- includes/interfaces/class-wc-object-data-store-interface.php | 4 ---- includes/interfaces/class-wc-order-data-store-interface.php | 4 ---- .../interfaces/class-wc-order-item-data-store-interface.php | 4 ---- .../class-wc-order-item-product-data-store-interface.php | 4 ---- .../class-wc-order-item-type-data-store-interface.php | 4 ---- .../interfaces/class-wc-order-refund-data-store-interface.php | 4 ---- .../class-wc-payment-token-data-store-interface.php | 4 ---- includes/interfaces/class-wc-product-data-store-interface.php | 4 ---- .../class-wc-product-variable-data-store-interface.php | 4 ---- includes/interfaces/class-wc-queue-interface.php | 4 ---- .../class-wc-shipping-zone-data-store-interface.php | 4 ---- .../interfaces/class-wc-webhooks-data-store-interface.php | 4 ---- 19 files changed, 76 deletions(-) diff --git a/includes/interfaces/class-wc-abstract-order-data-store-interface.php b/includes/interfaces/class-wc-abstract-order-data-store-interface.php index c043c34e214..6e2ca1f224d 100644 --- a/includes/interfaces/class-wc-abstract-order-data-store-interface.php +++ b/includes/interfaces/class-wc-abstract-order-data-store-interface.php @@ -6,10 +6,6 @@ * @package WooCommerce\Interfaces */ -if ( ! defined( 'ABSPATH' ) ) { - exit; -} - /** * WC Order Data Store Interface * diff --git a/includes/interfaces/class-wc-coupon-data-store-interface.php b/includes/interfaces/class-wc-coupon-data-store-interface.php index 95256bcc00d..1cc0389ebce 100644 --- a/includes/interfaces/class-wc-coupon-data-store-interface.php +++ b/includes/interfaces/class-wc-coupon-data-store-interface.php @@ -6,10 +6,6 @@ * @package WooCommerce\Interfaces */ -if ( ! defined( 'ABSPATH' ) ) { - exit; -} - /** * WC Coupon Data Store Interface * diff --git a/includes/interfaces/class-wc-customer-data-store-interface.php b/includes/interfaces/class-wc-customer-data-store-interface.php index d2601898516..f3df3083fea 100644 --- a/includes/interfaces/class-wc-customer-data-store-interface.php +++ b/includes/interfaces/class-wc-customer-data-store-interface.php @@ -6,10 +6,6 @@ * @package WooCommerce\Interface */ -if ( ! defined( 'ABSPATH' ) ) { - exit; -} - /** * WC Customer Data Store Interface * diff --git a/includes/interfaces/class-wc-customer-download-data-store-interface.php b/includes/interfaces/class-wc-customer-download-data-store-interface.php index 4ef79c59395..81cde862794 100644 --- a/includes/interfaces/class-wc-customer-download-data-store-interface.php +++ b/includes/interfaces/class-wc-customer-download-data-store-interface.php @@ -6,10 +6,6 @@ * @package WooCommerce\Interface */ -if ( ! defined( 'ABSPATH' ) ) { - exit; -} - /** * WC Customer Download Data Store Interface. * diff --git a/includes/interfaces/class-wc-customer-download-log-data-store-interface.php b/includes/interfaces/class-wc-customer-download-log-data-store-interface.php index 32c5b168c4f..662f22ef069 100644 --- a/includes/interfaces/class-wc-customer-download-log-data-store-interface.php +++ b/includes/interfaces/class-wc-customer-download-log-data-store-interface.php @@ -6,10 +6,6 @@ * @package WooCommerce\Interface */ -if ( ! defined( 'ABSPATH' ) ) { - exit; -} - /** * WC Customer Download Log Data Store Interface. * diff --git a/includes/interfaces/class-wc-importer-interface.php b/includes/interfaces/class-wc-importer-interface.php index fa4317932b8..55f4cf64aca 100644 --- a/includes/interfaces/class-wc-importer-interface.php +++ b/includes/interfaces/class-wc-importer-interface.php @@ -6,10 +6,6 @@ * @version 3.1.0 */ -if ( ! defined( 'ABSPATH' ) ) { - exit; -} - /** * WC_Importer_Interface class. */ diff --git a/includes/interfaces/class-wc-log-handler-interface.php b/includes/interfaces/class-wc-log-handler-interface.php index d84e39720c8..f83828165e5 100644 --- a/includes/interfaces/class-wc-log-handler-interface.php +++ b/includes/interfaces/class-wc-log-handler-interface.php @@ -6,10 +6,6 @@ * @package WooCommerce\Interface */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} - /** * WC Log Handler Interface * diff --git a/includes/interfaces/class-wc-object-data-store-interface.php b/includes/interfaces/class-wc-object-data-store-interface.php index f6f276aaae6..397aeb965cd 100644 --- a/includes/interfaces/class-wc-object-data-store-interface.php +++ b/includes/interfaces/class-wc-object-data-store-interface.php @@ -6,10 +6,6 @@ * @package WooCommerce\Interface */ -if ( ! defined( 'ABSPATH' ) ) { - exit; -} - /** * WC Data Store Interface * diff --git a/includes/interfaces/class-wc-order-data-store-interface.php b/includes/interfaces/class-wc-order-data-store-interface.php index 6f00c8a3efe..18745176414 100644 --- a/includes/interfaces/class-wc-order-data-store-interface.php +++ b/includes/interfaces/class-wc-order-data-store-interface.php @@ -6,10 +6,6 @@ * @package WooCommerce\Interface */ -if ( ! defined( 'ABSPATH' ) ) { - exit; -} - /** * WC Order Data Store Interface * diff --git a/includes/interfaces/class-wc-order-item-data-store-interface.php b/includes/interfaces/class-wc-order-item-data-store-interface.php index 68ba29b4013..b23f42727bd 100644 --- a/includes/interfaces/class-wc-order-item-data-store-interface.php +++ b/includes/interfaces/class-wc-order-item-data-store-interface.php @@ -6,10 +6,6 @@ * @package WooCommerce\Interface */ -if ( ! defined( 'ABSPATH' ) ) { - exit; -} - /** * WC Order Item Data Store Interface * diff --git a/includes/interfaces/class-wc-order-item-product-data-store-interface.php b/includes/interfaces/class-wc-order-item-product-data-store-interface.php index f5cd402ea2f..654c408c364 100644 --- a/includes/interfaces/class-wc-order-item-product-data-store-interface.php +++ b/includes/interfaces/class-wc-order-item-product-data-store-interface.php @@ -6,10 +6,6 @@ * @package WooCommerce\Interface */ -if ( ! defined( 'ABSPATH' ) ) { - exit; -} - /** * WC Order Item Data Store Interface * diff --git a/includes/interfaces/class-wc-order-item-type-data-store-interface.php b/includes/interfaces/class-wc-order-item-type-data-store-interface.php index 006a4e6b0d4..23693faf29e 100644 --- a/includes/interfaces/class-wc-order-item-type-data-store-interface.php +++ b/includes/interfaces/class-wc-order-item-type-data-store-interface.php @@ -6,10 +6,6 @@ * @package WooCommerce\Interface */ -if ( ! defined( 'ABSPATH' ) ) { - exit; -} - /** * WC Order Item Data Store Interface * diff --git a/includes/interfaces/class-wc-order-refund-data-store-interface.php b/includes/interfaces/class-wc-order-refund-data-store-interface.php index b97864d06e3..1167e830943 100644 --- a/includes/interfaces/class-wc-order-refund-data-store-interface.php +++ b/includes/interfaces/class-wc-order-refund-data-store-interface.php @@ -6,10 +6,6 @@ * @package WooCommerce\Interface */ -if ( ! defined( 'ABSPATH' ) ) { - exit; -} - /** * WC Order Refund Data Store Interface * diff --git a/includes/interfaces/class-wc-payment-token-data-store-interface.php b/includes/interfaces/class-wc-payment-token-data-store-interface.php index fb2a581e741..9fb64a29806 100644 --- a/includes/interfaces/class-wc-payment-token-data-store-interface.php +++ b/includes/interfaces/class-wc-payment-token-data-store-interface.php @@ -6,10 +6,6 @@ * @package WooCommerce\Interface */ -if ( ! defined( 'ABSPATH' ) ) { - exit; -} - /** * WC Payment Token Data Store Interface * diff --git a/includes/interfaces/class-wc-product-data-store-interface.php b/includes/interfaces/class-wc-product-data-store-interface.php index 3e50cfedf14..4c1a68c94ec 100644 --- a/includes/interfaces/class-wc-product-data-store-interface.php +++ b/includes/interfaces/class-wc-product-data-store-interface.php @@ -6,10 +6,6 @@ * @package WooCommerce\Interface */ -if ( ! defined( 'ABSPATH' ) ) { - exit; -} - /** * WC Product Data Store Interface * diff --git a/includes/interfaces/class-wc-product-variable-data-store-interface.php b/includes/interfaces/class-wc-product-variable-data-store-interface.php index b22893dc3a6..03b72b48a3e 100644 --- a/includes/interfaces/class-wc-product-variable-data-store-interface.php +++ b/includes/interfaces/class-wc-product-variable-data-store-interface.php @@ -6,10 +6,6 @@ * @package WooCommerce\Interface */ -if ( ! defined( 'ABSPATH' ) ) { - exit; -} - /** * WC Product Variable Data Store Interface * diff --git a/includes/interfaces/class-wc-queue-interface.php b/includes/interfaces/class-wc-queue-interface.php index 5a960d383f7..3cfe06845ce 100644 --- a/includes/interfaces/class-wc-queue-interface.php +++ b/includes/interfaces/class-wc-queue-interface.php @@ -6,10 +6,6 @@ * @package WooCommerce\Interface */ -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly. -} - /** * WC Queue Interface * diff --git a/includes/interfaces/class-wc-shipping-zone-data-store-interface.php b/includes/interfaces/class-wc-shipping-zone-data-store-interface.php index 7009c5b7209..031e4048b3e 100644 --- a/includes/interfaces/class-wc-shipping-zone-data-store-interface.php +++ b/includes/interfaces/class-wc-shipping-zone-data-store-interface.php @@ -6,10 +6,6 @@ * @package WooCommerce\Interface */ -if ( ! defined( 'ABSPATH' ) ) { - exit; -} - /** * WC Shipping Zone Data Store Interface. * diff --git a/includes/interfaces/class-wc-webhooks-data-store-interface.php b/includes/interfaces/class-wc-webhooks-data-store-interface.php index f0e2e729843..0f59d011d20 100644 --- a/includes/interfaces/class-wc-webhooks-data-store-interface.php +++ b/includes/interfaces/class-wc-webhooks-data-store-interface.php @@ -6,10 +6,6 @@ * @package WooCommerce\Interface */ -if ( ! defined( 'ABSPATH' ) ) { - exit; -} - /** * WooCommerce Webhook data store interface. */