Updated prefixes for wc-admin plugin.

This commit is contained in:
Peter Fabian 2018-09-17 21:13:19 +02:00
parent 429803cc25
commit 9ac635fd42
13 changed files with 28 additions and 85 deletions

View File

@ -31,51 +31,6 @@ class WC_Admin_REST_Reports_Controller extends WC_REST_Reports_Controller {
*/ */
protected $rest_base = 'reports'; protected $rest_base = 'reports';
/**
* Get reports list.
*
* @since 3.5.0
* @return array
*/
protected function get_reports() {
$reports = parent::get_reports();
$reports[] = array(
'slug' => 'orders/count',
'description' => __( 'Orders stats count.', 'woocommerce' ),
);
$reports[] = array(
'slug' => 'products/count',
'description' => __( 'Customers stats count.', 'woocommerce' ),
);
$reports[] = array(
'slug' => 'customers/count',
'description' => __( 'Customers stats count.', 'woocommerce' ),
);
$reports[] = array(
'slug' => 'coupons/count',
'description' => __( 'Coupons stats count.', 'woocommerce' ),
);
$reports[] = array(
'slug' => 'reviews/count',
'description' => __( 'Reviews stats count.', 'woocommerce' ),
);
$reports[] = array(
'slug' => 'categories/count',
'description' => __( 'Categories stats count.', 'woocommerce' ),
);
$reports[] = array(
'slug' => 'tags/count',
'description' => __( 'Tags stats count.', 'woocommerce' ),
);
$reports[] = array(
'slug' => 'attributes/count',
'description' => __( 'Attributes stats count.', 'woocommerce' ),
);
return $reports;
}
/** /**
* Register the routes for reports. * Register the routes for reports.
*/ */

View File

@ -4,8 +4,7 @@
* *
* Handles requests to the /reports/coupons/stats endpoint. * Handles requests to the /reports/coupons/stats endpoint.
* *
* @package WooCommerce/API * @package WooCommerce Admin/API
* @since 3.5.0
*/ */
defined( 'ABSPATH' ) || exit; defined( 'ABSPATH' ) || exit;
@ -16,7 +15,7 @@ defined( 'ABSPATH' ) || exit;
* @package WooCommerce/API * @package WooCommerce/API
* @extends WC_REST_Reports_Controller * @extends WC_REST_Reports_Controller
*/ */
class WC_REST_Reports_Coupons_Stats_Controller extends WC_REST_Reports_Controller { class WC_Admin_REST_Reports_Coupons_Stats_Controller extends WC_REST_Reports_Controller {
/** /**
* Endpoint namespace. * Endpoint namespace.

View File

@ -4,8 +4,7 @@
* *
* Handles requests to the /reports/customers endpoint. * Handles requests to the /reports/customers endpoint.
* *
* @package WooCommerce/API * @package WooCommerce Admin/API
* @since 3.5.0
*/ */
defined( 'ABSPATH' ) || exit; defined( 'ABSPATH' ) || exit;
@ -16,7 +15,7 @@ defined( 'ABSPATH' ) || exit;
* @package WooCommerce/API * @package WooCommerce/API
* @extends WC_REST_Reports_Controller * @extends WC_REST_Reports_Controller
*/ */
class WC_REST_Reports_Customers_Controller extends WC_REST_Reports_Controller { class WC_Admin_REST_Reports_Customers_Controller extends WC_REST_Reports_Controller {
/** /**
* Endpoint namespace. * Endpoint namespace.

View File

@ -4,8 +4,7 @@
* *
* Handles requests to the /reports/downloads endpoint. * Handles requests to the /reports/downloads endpoint.
* *
* @package WooCommerce/API * @package WooCommerce Admin/API
* @since 3.5.0
*/ */
defined( 'ABSPATH' ) || exit; defined( 'ABSPATH' ) || exit;
@ -16,7 +15,7 @@ defined( 'ABSPATH' ) || exit;
* @package WooCommerce/API * @package WooCommerce/API
* @extends WC_REST_Reports_Controller * @extends WC_REST_Reports_Controller
*/ */
class WC_REST_Reports_Downloads_Controller extends WC_REST_Reports_Controller { class WC_Admin_REST_Reports_Downloads_Controller extends WC_REST_Reports_Controller {
/** /**
* Endpoint namespace. * Endpoint namespace.

View File

@ -4,8 +4,7 @@
* *
* Handles requests to the /reports/downloads/files endpoint. * Handles requests to the /reports/downloads/files endpoint.
* *
* @package WooCommerce/API * @package WooCommerce Admin/API
* @since 3.5.0
*/ */
defined( 'ABSPATH' ) || exit; defined( 'ABSPATH' ) || exit;
@ -16,7 +15,7 @@ defined( 'ABSPATH' ) || exit;
* @package WooCommerce/API * @package WooCommerce/API
* @extends WC_REST_Reports_Controller * @extends WC_REST_Reports_Controller
*/ */
class WC_REST_Reports_Downloads_Files_Controller extends WC_REST_Reports_Controller { class WC_Admin_REST_Reports_Downloads_Files_Controller extends WC_REST_Reports_Controller {
/** /**
* Endpoint namespace. * Endpoint namespace.

View File

@ -4,8 +4,7 @@
* *
* Handles requests to the /reports/downloads/stats endpoint. * Handles requests to the /reports/downloads/stats endpoint.
* *
* @package WooCommerce/API * @package WooCommerce Admin/API
* @since 3.5.0
*/ */
defined( 'ABSPATH' ) || exit; defined( 'ABSPATH' ) || exit;
@ -16,7 +15,7 @@ defined( 'ABSPATH' ) || exit;
* @package WooCommerce/API * @package WooCommerce/API
* @extends WC_REST_Reports_Controller * @extends WC_REST_Reports_Controller
*/ */
class WC_REST_Reports_Downloads_Stats_Controller extends WC_REST_Reports_Controller { class WC_Admin_REST_Reports_Downloads_Stats_Controller extends WC_REST_Reports_Controller {
/** /**
* Endpoint namespace. * Endpoint namespace.

View File

@ -4,8 +4,7 @@
* *
* Handles requests to the /reports/orders/stats endpoint. * Handles requests to the /reports/orders/stats endpoint.
* *
* @package WooCommerce/API * @package WooCommerce Admin/API
* @since 3.5.0
*/ */
defined( 'ABSPATH' ) || exit; defined( 'ABSPATH' ) || exit;
@ -16,7 +15,7 @@ defined( 'ABSPATH' ) || exit;
* @package WooCommerce/API * @package WooCommerce/API
* @extends WC_REST_Reports_Controller * @extends WC_REST_Reports_Controller
*/ */
class WC_REST_Reports_Orders_Stats_Controller extends WC_REST_Reports_Controller { class WC_Admin_REST_Reports_Orders_Stats_Controller extends WC_REST_Reports_Controller {
/** /**
* Endpoint namespace. * Endpoint namespace.
@ -63,7 +62,7 @@ class WC_REST_Reports_Orders_Stats_Controller extends WC_REST_Reports_Controller
*/ */
public function get_items( $request ) { public function get_items( $request ) {
$query_args = $this->prepare_reports_query( $request ); $query_args = $this->prepare_reports_query( $request );
$orders_query = new WC_Reports_Orders_Stats_Query( $query_args ); $orders_query = new WC_Admin_Reports_Orders_Stats_Query( $query_args );
$report_data = $orders_query->get_data(); $report_data = $orders_query->get_data();
$out_data = array( $out_data = array(

View File

@ -4,8 +4,7 @@
* *
* Handles requests to the /reports/products endpoint. * Handles requests to the /reports/products endpoint.
* *
* @package WooCommerce/API * @package WooCommerce Admin/API
* @since 3.5.0
*/ */
defined( 'ABSPATH' ) || exit; defined( 'ABSPATH' ) || exit;
@ -16,7 +15,7 @@ defined( 'ABSPATH' ) || exit;
* @package WooCommerce/API * @package WooCommerce/API
* @extends WC_REST_Reports_Controller * @extends WC_REST_Reports_Controller
*/ */
class WC_REST_Reports_Products_Controller extends WC_REST_Reports_Controller { class WC_Admin_REST_Reports_Products_Controller extends WC_REST_Reports_Controller {
/** /**
* Endpoint namespace. * Endpoint namespace.

View File

@ -4,8 +4,7 @@
* *
* Handles requests to the /reports/products/stats endpoint. * Handles requests to the /reports/products/stats endpoint.
* *
* @package WooCommerce/API * @package WooCommerce Admin/API
* @since 3.5.0
*/ */
defined( 'ABSPATH' ) || exit; defined( 'ABSPATH' ) || exit;
@ -16,7 +15,7 @@ defined( 'ABSPATH' ) || exit;
* @package WooCommerce/API * @package WooCommerce/API
* @extends WC_REST_Reports_Controller * @extends WC_REST_Reports_Controller
*/ */
class WC_REST_Reports_Products_Stats_Controller extends WC_REST_Reports_Controller { class WC_Admin_REST_Reports_Products_Stats_Controller extends WC_REST_Reports_Controller {
/** /**
* Endpoint namespace. * Endpoint namespace.

View File

@ -4,8 +4,7 @@
* *
* Handles requests to the /reports/revenue/stats endpoint. * Handles requests to the /reports/revenue/stats endpoint.
* *
* @package WooCommerce/API * @package WooCommerce Admin/API
* @since 3.5.0
*/ */
defined( 'ABSPATH' ) || exit; defined( 'ABSPATH' ) || exit;
@ -16,7 +15,7 @@ defined( 'ABSPATH' ) || exit;
* @package WooCommerce/API * @package WooCommerce/API
* @extends WC_REST_Reports_Controller * @extends WC_REST_Reports_Controller
*/ */
class WC_REST_Reports_Revenue_Stats_Controller extends WC_REST_Reports_Controller { class WC_Admin_REST_Reports_Revenue_Stats_Controller extends WC_REST_Reports_Controller {
/** /**
* Endpoint namespace. * Endpoint namespace.

View File

@ -4,8 +4,7 @@
* *
* Handles requests to the /reports/taxes endpoint. * Handles requests to the /reports/taxes endpoint.
* *
* @package WooCommerce/API * @package WooCommerce Admin/API
* @since 3.5.0
*/ */
defined( 'ABSPATH' ) || exit; defined( 'ABSPATH' ) || exit;
@ -16,7 +15,7 @@ defined( 'ABSPATH' ) || exit;
* @package WooCommerce/API * @package WooCommerce/API
* @extends WC_REST_Reports_Controller * @extends WC_REST_Reports_Controller
*/ */
class WC_REST_Reports_Taxes_Controller extends WC_REST_Reports_Controller { class WC_Admin_REST_Reports_Taxes_Controller extends WC_REST_Reports_Controller {
/** /**
* Endpoint namespace. * Endpoint namespace.

View File

@ -4,8 +4,7 @@
* *
* Handles requests to the /reports/taxes/stats endpoint. * Handles requests to the /reports/taxes/stats endpoint.
* *
* @package WooCommerce/API * @package WooCommerce Admin/API
* @since 3.5.0
*/ */
defined( 'ABSPATH' ) || exit; defined( 'ABSPATH' ) || exit;
@ -16,7 +15,7 @@ defined( 'ABSPATH' ) || exit;
* @package WooCommerce/API * @package WooCommerce/API
* @extends WC_REST_Reports_Controller * @extends WC_REST_Reports_Controller
*/ */
class WC_REST_Reports_Taxes_Stats_Controller extends WC_REST_Reports_Controller { class WC_Admin_REST_Reports_Taxes_Stats_Controller extends WC_REST_Reports_Controller {
/** /**
* Endpoint namespace. * Endpoint namespace.

View File

@ -4,8 +4,7 @@
* *
* Handles requests to the /system_status/tools/* endpoints. * Handles requests to the /system_status/tools/* endpoints.
* *
* @package WooCommerce/API * @package WooCommerce Admin/API
* @since 3.0.0
*/ */
defined( 'ABSPATH' ) || exit; defined( 'ABSPATH' ) || exit;
@ -13,10 +12,10 @@ defined( 'ABSPATH' ) || exit;
/** /**
* System status tools controller. * System status tools controller.
* *
* @package WooCommerce/API * @package WooCommerce Admin/API
* @extends WC_REST_System_Status_Tools_V2_Controller * @extends WC_REST_System_Status_Tools_Controller
*/ */
class WC_REST_System_Status_Tools_Controller extends WC_REST_System_Status_Tools_V2_Controller { class WC_Admin_REST_System_Status_Tools_Controller extends WC_REST_System_Status_Tools_Controller {
/** /**
* Endpoint namespace. * Endpoint namespace.
@ -56,7 +55,7 @@ class WC_REST_System_Status_Tools_Controller extends WC_REST_System_Status_Tools
switch ( $tool ) { switch ( $tool ) {
case 'rebuild_stats': case 'rebuild_stats':
WC_Reports_Orders_Data_Store::queue_order_stats_repopulate_database(); WC_Admin_Reports_Orders_Data_Store::queue_order_stats_repopulate_database();
$message = __( 'Rebuilding reports data in the background . . .', 'woocommerce' ); $message = __( 'Rebuilding reports data in the background . . .', 'woocommerce' );
break; break;
default: default: