29 lines
551 B
PHP
29 lines
551 B
PHP
<?php
|
|
|
|
/**
|
|
* Enable Query Log
|
|
*/
|
|
if (!function_exists('fluentcrm_eql')) {
|
|
function fluentcrm_eql()
|
|
{
|
|
defined('SAVEQUERIES') || define('SAVEQUERIES', true);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Get Query Log
|
|
*/
|
|
if (!function_exists('fluentcrm_gql')) {
|
|
function fluentcrm_gql()
|
|
{
|
|
$result = [];
|
|
foreach ((array)$GLOBALS['wpdb']->queries as $key => $query) {
|
|
$result[++$key] = array_combine([
|
|
'query', 'execution_time'
|
|
], array_slice($query, 0, 2));
|
|
}
|
|
return $result;
|
|
}
|
|
}
|
|
|