From 4ee63b053c0062b34c9a5bdc914c3206361528f5 Mon Sep 17 00:00:00 2001 From: Almira Krdzic Date: Sun, 21 Oct 2018 02:40:58 +0200 Subject: [PATCH] test --- .../class-wiaas-rest-delivery-process-api.php | 24 ++++++++++++++++++- backend/config/environments/staging.php | 2 +- backend/wp-config.php | 4 ++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/backend/app/plugins/wiaas/includes/api/class-wiaas-rest-delivery-process-api.php b/backend/app/plugins/wiaas/includes/api/class-wiaas-rest-delivery-process-api.php index de409a7..0cfb9d1 100644 --- a/backend/app/plugins/wiaas/includes/api/class-wiaas-rest-delivery-process-api.php +++ b/backend/app/plugins/wiaas/includes/api/class-wiaas-rest-delivery-process-api.php @@ -93,7 +93,29 @@ class Wiass_REST_Delivery_Process_API { ); } - return rest_ensure_response($data); + global $wpdb; + + + $data = array(); + $total = 0; + $queries =$wpdb->queries; + foreach ($queries as $query) { + $data[] = array( + $query[0], + $query[1] + ); + + $total += $query[1]; + } + + global $wp_timer; + + + return rest_ensure_response(array( + 'data' => $queries, + 'total' => $total * 1000, + 'start' => (microtime() - $wp_timer) * 1000 + )); } public static function get_customer_acceptance(WP_REST_Request $request){ diff --git a/backend/config/environments/staging.php b/backend/config/environments/staging.php index ae4da8c..b0def10 100644 --- a/backend/config/environments/staging.php +++ b/backend/config/environments/staging.php @@ -1,6 +1,6 @@