diff --git a/includes/abstracts/abstract-wc-rest-shipping-zones-controller.php b/includes/abstracts/abstract-wc-rest-shipping-zones-controller.php deleted file mode 100644 index 7f343463136..00000000000 --- a/includes/abstracts/abstract-wc-rest-shipping-zones-controller.php +++ /dev/null @@ -1,127 +0,0 @@ - 404 ) ); - } - - return $zone; - } - - /** - * Check whether a given request has permission to read Shipping Zones. - * - * @param WP_REST_Request $request Full details about the request. - * @return WP_Error|boolean - */ - public function get_items_permissions_check( $request ) { - if ( ! wc_shipping_enabled() ) { - return new WP_Error( 'rest_no_route', __( 'Shipping is disabled.', 'woocommerce' ), array( 'status' => 404 ) ); - } - - if ( ! wc_rest_check_manager_permissions( 'settings', 'read' ) ) { - return new WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) ); - } - - return true; - } - - /** - * Check if a given request has access to create Shipping Zones. - * - * @param WP_REST_Request $request Full details about the request. - * @return WP_Error|boolean - */ - public function create_item_permissions_check( $request ) { - if ( ! wc_shipping_enabled() ) { - return new WP_Error( 'rest_no_route', __( 'Shipping is disabled.', 'woocommerce' ), array( 'status' => 404 ) ); - } - - if ( ! wc_rest_check_manager_permissions( 'settings', 'edit' ) ) { - return new WP_Error( 'woocommerce_rest_cannot_create', __( 'Sorry, you are not allowed to create resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) ); - } - - return true; - } - - /** - * Check whether a given request has permission to edit Shipping Zones. - * - * @param WP_REST_Request $request Full details about the request. - * @return WP_Error|boolean - */ - public function update_items_permissions_check( $request ) { - if ( ! wc_shipping_enabled() ) { - return new WP_Error( 'rest_no_route', __( 'Shipping is disabled.', 'woocommerce' ), array( 'status' => 404 ) ); - } - - if ( ! wc_rest_check_manager_permissions( 'settings', 'edit' ) ) { - return new WP_Error( 'woocommerce_rest_cannot_edit', __( 'Sorry, you are not allowed to edit this resource.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) ); - } - - return true; - } - - /** - * Check whether a given request has permission to delete Shipping Zones. - * - * @param WP_REST_Request $request Full details about the request. - * @return WP_Error|boolean - */ - public function delete_items_permissions_check( $request ) { - if ( ! wc_shipping_enabled() ) { - return new WP_Error( 'rest_no_route', __( 'Shipping is disabled.', 'woocommerce' ), array( 'status' => 404 ) ); - } - - if ( ! wc_rest_check_manager_permissions( 'settings', 'delete' ) ) { - return new WP_Error( 'woocommerce_rest_cannot_edit', __( 'Sorry, you are not allowed to delete this resource.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) ); - } - - return true; - } - -} diff --git a/includes/api/class-wc-rest-coupons-controller.php b/includes/api/class-wc-rest-coupons-controller.php index f36945ee537..03fa58af974 100644 --- a/includes/api/class-wc-rest-coupons-controller.php +++ b/includes/api/class-wc-rest-coupons-controller.php @@ -27,7 +27,7 @@ class WC_REST_Coupons_Controller extends WC_REST_Posts_Controller { * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-customer-downloads-controller.php b/includes/api/class-wc-rest-customer-downloads-controller.php index 03f0c993600..0b83c6e6250 100644 --- a/includes/api/class-wc-rest-customer-downloads-controller.php +++ b/includes/api/class-wc-rest-customer-downloads-controller.php @@ -27,7 +27,7 @@ class WC_REST_Customer_Downloads_Controller extends WC_REST_Controller { * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-customers-controller.php b/includes/api/class-wc-rest-customers-controller.php index 02db8a9d89c..799e101a6ce 100644 --- a/includes/api/class-wc-rest-customers-controller.php +++ b/includes/api/class-wc-rest-customers-controller.php @@ -27,7 +27,7 @@ class WC_REST_Customers_Controller extends WC_REST_Controller { * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-order-notes-controller.php b/includes/api/class-wc-rest-order-notes-controller.php index 62097ea5788..5acebfae339 100644 --- a/includes/api/class-wc-rest-order-notes-controller.php +++ b/includes/api/class-wc-rest-order-notes-controller.php @@ -27,7 +27,7 @@ class WC_REST_Order_Notes_Controller extends WC_REST_Controller { * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-order-refunds-controller.php b/includes/api/class-wc-rest-order-refunds-controller.php index d97d88638c8..307cbff1cfd 100644 --- a/includes/api/class-wc-rest-order-refunds-controller.php +++ b/includes/api/class-wc-rest-order-refunds-controller.php @@ -29,7 +29,7 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller { * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-orders-controller.php b/includes/api/class-wc-rest-orders-controller.php index 76ee41404ed..df8cdaf0163 100644 --- a/includes/api/class-wc-rest-orders-controller.php +++ b/includes/api/class-wc-rest-orders-controller.php @@ -27,7 +27,7 @@ class WC_REST_Orders_Controller extends WC_REST_Posts_Controller { * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-payment-gateways-controller.php b/includes/api/class-wc-rest-payment-gateways-controller.php index ede6193ce0a..c60fa6fe15c 100644 --- a/includes/api/class-wc-rest-payment-gateways-controller.php +++ b/includes/api/class-wc-rest-payment-gateways-controller.php @@ -25,7 +25,7 @@ class WC_REST_Payment_Gateways_Controller extends WC_REST_Controller { * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-product-attribute-terms-controller.php b/includes/api/class-wc-rest-product-attribute-terms-controller.php index 6fa5653bb81..b11992e6cca 100644 --- a/includes/api/class-wc-rest-product-attribute-terms-controller.php +++ b/includes/api/class-wc-rest-product-attribute-terms-controller.php @@ -27,7 +27,7 @@ class WC_REST_Product_Attribute_Terms_Controller extends WC_REST_Terms_Controlle * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-product-attributes-controller.php b/includes/api/class-wc-rest-product-attributes-controller.php index 1c534230ca0..79e1f059a50 100644 --- a/includes/api/class-wc-rest-product-attributes-controller.php +++ b/includes/api/class-wc-rest-product-attributes-controller.php @@ -27,7 +27,7 @@ class WC_REST_Product_Attributes_Controller extends WC_REST_Controller { * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-product-categories-controller.php b/includes/api/class-wc-rest-product-categories-controller.php index d99aecd72fd..7bd0167df93 100644 --- a/includes/api/class-wc-rest-product-categories-controller.php +++ b/includes/api/class-wc-rest-product-categories-controller.php @@ -27,7 +27,7 @@ class WC_REST_Product_Categories_Controller extends WC_REST_Terms_Controller { * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-product-reviews-controller.php b/includes/api/class-wc-rest-product-reviews-controller.php index ed7d9c5e04d..331fbc32574 100644 --- a/includes/api/class-wc-rest-product-reviews-controller.php +++ b/includes/api/class-wc-rest-product-reviews-controller.php @@ -27,7 +27,7 @@ class WC_REST_Product_Reviews_Controller extends WC_REST_Controller { * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-product-shipping-classes-controller.php b/includes/api/class-wc-rest-product-shipping-classes-controller.php index 8f03c23ed4d..13465fbec37 100644 --- a/includes/api/class-wc-rest-product-shipping-classes-controller.php +++ b/includes/api/class-wc-rest-product-shipping-classes-controller.php @@ -27,7 +27,7 @@ class WC_REST_Product_Shipping_Classes_Controller extends WC_REST_Terms_Controll * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-product-tags-controller.php b/includes/api/class-wc-rest-product-tags-controller.php index b845cac3009..c1c7b24e59c 100644 --- a/includes/api/class-wc-rest-product-tags-controller.php +++ b/includes/api/class-wc-rest-product-tags-controller.php @@ -27,7 +27,7 @@ class WC_REST_Product_Tags_Controller extends WC_REST_Terms_Controller { * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-product-variations-controller.php b/includes/api/class-wc-rest-product-variations-controller.php index 45a43c8fd0a..0890aedaeed 100644 --- a/includes/api/class-wc-rest-product-variations-controller.php +++ b/includes/api/class-wc-rest-product-variations-controller.php @@ -27,7 +27,7 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-products-controller.php b/includes/api/class-wc-rest-products-controller.php index 7b39234e137..0c281a99e62 100644 --- a/includes/api/class-wc-rest-products-controller.php +++ b/includes/api/class-wc-rest-products-controller.php @@ -27,7 +27,7 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller { * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-report-sales-controller.php b/includes/api/class-wc-rest-report-sales-controller.php index 3e67157a8ee..305505d9385 100644 --- a/includes/api/class-wc-rest-report-sales-controller.php +++ b/includes/api/class-wc-rest-report-sales-controller.php @@ -27,7 +27,7 @@ class WC_REST_Report_Sales_Controller extends WC_REST_Controller { * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-report-top-sellers-controller.php b/includes/api/class-wc-rest-report-top-sellers-controller.php index ca9cca675a6..e64b87c35eb 100644 --- a/includes/api/class-wc-rest-report-top-sellers-controller.php +++ b/includes/api/class-wc-rest-report-top-sellers-controller.php @@ -27,7 +27,7 @@ class WC_REST_Report_Top_Sellers_Controller extends WC_REST_Report_Sales_Control * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-reports-controller.php b/includes/api/class-wc-rest-reports-controller.php index a77d2852a61..d88855ff873 100644 --- a/includes/api/class-wc-rest-reports-controller.php +++ b/includes/api/class-wc-rest-reports-controller.php @@ -27,7 +27,7 @@ class WC_REST_Reports_Controller extends WC_REST_Controller { * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-settings-controller.php b/includes/api/class-wc-rest-settings-controller.php index 6d1da814e7a..ed8ddf0ead4 100644 --- a/includes/api/class-wc-rest-settings-controller.php +++ b/includes/api/class-wc-rest-settings-controller.php @@ -18,7 +18,7 @@ class WC_REST_Settings_Controller extends WC_REST_Controller { /** * WP REST API namespace/version. */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-settings-options-controller.php b/includes/api/class-wc-rest-settings-options-controller.php index 76ff0ae0496..0472b0e56e3 100644 --- a/includes/api/class-wc-rest-settings-options-controller.php +++ b/includes/api/class-wc-rest-settings-options-controller.php @@ -18,7 +18,7 @@ class WC_REST_Settings_Options_Controller extends WC_REST_Controller { /** * WP REST API namespace/version. */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-shipping-methods-controller.php b/includes/api/class-wc-rest-shipping-methods-controller.php index 5bf5bc0346a..f681e20b77e 100644 --- a/includes/api/class-wc-rest-shipping-methods-controller.php +++ b/includes/api/class-wc-rest-shipping-methods-controller.php @@ -25,7 +25,7 @@ class WC_REST_Shipping_Methods_Controller extends WC_REST_Controller { * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-shipping-zone-locations-controller.php b/includes/api/class-wc-rest-shipping-zone-locations-controller.php index 8f69de6ce1a..14f356ad29b 100644 --- a/includes/api/class-wc-rest-shipping-zone-locations-controller.php +++ b/includes/api/class-wc-rest-shipping-zone-locations-controller.php @@ -18,9 +18,9 @@ if ( ! defined( 'ABSPATH' ) ) { * REST API Shipping Zone Locations class. * * @package WooCommerce/API - * @extends WC_REST_Shipping_Zones_Controller_Base + * @extends WC_REST_Shipping_Zones_Controller */ -class WC_REST_Shipping_Zone_Locations_Controller extends WC_REST_Shipping_Zones_Controller_Base { +class WC_REST_Shipping_Zone_Locations_Controller extends WC_REST_Shipping_Zones_Controller { /** * Register the routes for Shipping Zone Locations. diff --git a/includes/api/class-wc-rest-shipping-zone-methods-controller.php b/includes/api/class-wc-rest-shipping-zone-methods-controller.php index 33dcd77f1d4..600c165a32e 100644 --- a/includes/api/class-wc-rest-shipping-zone-methods-controller.php +++ b/includes/api/class-wc-rest-shipping-zone-methods-controller.php @@ -18,9 +18,9 @@ if ( ! defined( 'ABSPATH' ) ) { * REST API Shipping Zone Methods class. * * @package WooCommerce/API - * @extends WC_REST_Shipping_Zones_Controller_Base + * @extends WC_REST_Shipping_Zones_Controller */ -class WC_REST_Shipping_Zone_Methods_Controller extends WC_REST_Shipping_Zones_Controller_Base { +class WC_REST_Shipping_Zone_Methods_Controller extends WC_REST_Shipping_Zones_Controller { /** * Register the routes for Shipping Zone Methods. diff --git a/includes/api/class-wc-rest-shipping-zones-controller.php b/includes/api/class-wc-rest-shipping-zones-controller.php index 40e57ad9542..5dfe0a8015c 100644 --- a/includes/api/class-wc-rest-shipping-zones-controller.php +++ b/includes/api/class-wc-rest-shipping-zones-controller.php @@ -18,9 +18,23 @@ if ( ! defined( 'ABSPATH' ) ) { * REST API Shipping Zones class. * * @package WooCommerce/API - * @extends WC_REST_Shipping_Zones_Controller_Base + * @extends WC_REST_Controller */ -class WC_REST_Shipping_Zones_Controller extends WC_REST_Shipping_Zones_Controller_Base { +class WC_REST_Shipping_Zones_Controller extends WC_REST_Controller { + + /** + * Endpoint namespace. + * + * @var string + */ + protected $namespace = 'wc/v2'; + + /** + * Route base. + * + * @var string + */ + protected $rest_base = 'shipping/zones'; /** * Register the routes for Shipping Zones. @@ -75,6 +89,94 @@ class WC_REST_Shipping_Zones_Controller extends WC_REST_Shipping_Zones_Controlle ) ); } + /** + * Retrieve a Shipping Zone by it's ID. + * + * @param int $zone_id Shipping Zone ID. + * @return WC_Shipping_Zone|WP_Error + */ + protected function get_zone( $zone_id ) { + $zone = WC_Shipping_Zones::get_zone_by( 'zone_id', $zone_id ); + + if ( false === $zone ) { + return new WP_Error( 'woocommerce_rest_shipping_zone_invalid', __( 'Resource does not exist.', 'woocommerce' ), array( 'status' => 404 ) ); + } + + return $zone; + } + + /** + * Check whether a given request has permission to read Shipping Zones. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|boolean + */ + public function get_items_permissions_check( $request ) { + if ( ! wc_shipping_enabled() ) { + return new WP_Error( 'rest_no_route', __( 'Shipping is disabled.', 'woocommerce' ), array( 'status' => 404 ) ); + } + + if ( ! wc_rest_check_manager_permissions( 'settings', 'read' ) ) { + return new WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) ); + } + + return true; + } + + /** + * Check if a given request has access to create Shipping Zones. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|boolean + */ + public function create_item_permissions_check( $request ) { + if ( ! wc_shipping_enabled() ) { + return new WP_Error( 'rest_no_route', __( 'Shipping is disabled.', 'woocommerce' ), array( 'status' => 404 ) ); + } + + if ( ! wc_rest_check_manager_permissions( 'settings', 'edit' ) ) { + return new WP_Error( 'woocommerce_rest_cannot_create', __( 'Sorry, you are not allowed to create resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) ); + } + + return true; + } + + /** + * Check whether a given request has permission to edit Shipping Zones. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|boolean + */ + public function update_items_permissions_check( $request ) { + if ( ! wc_shipping_enabled() ) { + return new WP_Error( 'rest_no_route', __( 'Shipping is disabled.', 'woocommerce' ), array( 'status' => 404 ) ); + } + + if ( ! wc_rest_check_manager_permissions( 'settings', 'edit' ) ) { + return new WP_Error( 'woocommerce_rest_cannot_edit', __( 'Sorry, you are not allowed to edit this resource.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) ); + } + + return true; + } + + /** + * Check whether a given request has permission to delete Shipping Zones. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|boolean + */ + public function delete_items_permissions_check( $request ) { + if ( ! wc_shipping_enabled() ) { + return new WP_Error( 'rest_no_route', __( 'Shipping is disabled.', 'woocommerce' ), array( 'status' => 404 ) ); + } + + if ( ! wc_rest_check_manager_permissions( 'settings', 'delete' ) ) { + return new WP_Error( 'woocommerce_rest_cannot_edit', __( 'Sorry, you are not allowed to delete this resource.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) ); + } + + return true; + } + /** * Get a single Shipping Zone. * diff --git a/includes/api/class-wc-rest-system-status-controller.php b/includes/api/class-wc-rest-system-status-controller.php index 4f63c710c6f..fec247bc7f9 100644 --- a/includes/api/class-wc-rest-system-status-controller.php +++ b/includes/api/class-wc-rest-system-status-controller.php @@ -25,7 +25,7 @@ class WC_REST_System_Status_Controller extends WC_REST_Controller { * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-system-status-tools-controller.php b/includes/api/class-wc-rest-system-status-tools-controller.php index 89609137622..a8b799bea57 100644 --- a/includes/api/class-wc-rest-system-status-tools-controller.php +++ b/includes/api/class-wc-rest-system-status-tools-controller.php @@ -25,7 +25,7 @@ class WC_REST_System_Status_Tools_Controller extends WC_REST_Controller { * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-tax-classes-controller.php b/includes/api/class-wc-rest-tax-classes-controller.php index 89128ae6039..45a27cc23fc 100644 --- a/includes/api/class-wc-rest-tax-classes-controller.php +++ b/includes/api/class-wc-rest-tax-classes-controller.php @@ -27,7 +27,7 @@ class WC_REST_Tax_Classes_Controller extends WC_REST_Controller { * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-taxes-controller.php b/includes/api/class-wc-rest-taxes-controller.php index b3972ee2c06..836f2358704 100644 --- a/includes/api/class-wc-rest-taxes-controller.php +++ b/includes/api/class-wc-rest-taxes-controller.php @@ -27,7 +27,7 @@ class WC_REST_Taxes_Controller extends WC_REST_Controller { * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-webhook-deliveries.php b/includes/api/class-wc-rest-webhook-deliveries.php index 6e7569dbbe7..e11e8a27a77 100644 --- a/includes/api/class-wc-rest-webhook-deliveries.php +++ b/includes/api/class-wc-rest-webhook-deliveries.php @@ -27,7 +27,7 @@ class WC_REST_Webhook_Deliveries_Controller extends WC_REST_Controller { * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/api/class-wc-rest-webhooks-controller.php b/includes/api/class-wc-rest-webhooks-controller.php index 0e451b6a9f6..f666cffd492 100644 --- a/includes/api/class-wc-rest-webhooks-controller.php +++ b/includes/api/class-wc-rest-webhooks-controller.php @@ -27,7 +27,7 @@ class WC_REST_Webhooks_Controller extends WC_REST_Posts_Controller { * * @var string */ - protected $namespace = 'wc/v1'; + protected $namespace = 'wc/v2'; /** * Route base. diff --git a/includes/class-wc-api.php b/includes/class-wc-api.php index fdaee0b3ac7..5b78374325d 100644 --- a/includes/class-wc-api.php +++ b/includes/class-wc-api.php @@ -141,7 +141,6 @@ class WC_API extends WC_Legacy_API { // Abstract controllers. include_once( dirname( __FILE__ ) . '/abstracts/abstract-wc-rest-controller.php' ); include_once( dirname( __FILE__ ) . '/abstracts/abstract-wc-rest-posts-controller.php' ); - include_once( dirname( __FILE__ ) . '/abstracts/abstract-wc-rest-shipping-zones-controller.php' ); include_once( dirname( __FILE__ ) . '/abstracts/abstract-wc-rest-terms-controller.php' ); include_once( dirname( __FILE__ ) . '/abstracts/abstract-wc-settings-api.php' );