This commit is contained in:
Almira Krdzic
2018-10-21 02:40:58 +02:00
parent bfc216b0fe
commit 4ee63b053c
3 changed files with 28 additions and 2 deletions

View File

@@ -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){

View File

@@ -1,6 +1,6 @@
<?php
/** Development */
define('SAVEQUERIES', false);
define('SAVEQUERIES', true);
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', false);

View File

@@ -6,4 +6,8 @@
*/
require_once(__DIR__ . '/vendor/autoload.php');
require_once(__DIR__ . '/config/application.php');
global $wp_timer;
$wp_timer = microtime();
require_once(ABSPATH . 'wp-settings.php');