Skip to content

Commit bdc9a14

Browse files
author
JuhaniGeniem
authored
Merge pull request #156 from devgeniem/dustpress-debugger-1.6.0-support
Dustpress debugger 1.6.0 support
2 parents de54399 + 5237de7 commit bdc9a14

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [1.31.0] - 2021-02-25
8+
9+
### Added
10+
- Added highlight color for performance alerts.
11+
12+
### Changed
13+
- Decreased DustPress-debugger performance alert from 0.1s to 0.02s.
14+
715
## [1.30.1] - 2021-02-16
816

917
### Fixed

composer.json

+3
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,8 @@
3232
"require": {
3333
"php": ">=7.1",
3434
"ext-json": "*"
35+
},
36+
"conflict": {
37+
"devgeniem/dustpress-debugger": "<1.6.0"
3538
}
3639
}

dustpress.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -1885,12 +1885,12 @@ public function save_performance( $name, $start_time = false ) {
18851885

18861886
$execution_time = microtime( true ) - $start_time;
18871887

1888-
// Having all irrelevant times marked as "< 0.1" speeds up the reading of the performance report.
1889-
if ( $execution_time < 0.1 ) {
1890-
$execution_time = '< 0.1';
1888+
// Having all irrelevant times marked as "< 0.02" speeds up the reading of the performance report.
1889+
if ( $execution_time < 0.02 ) {
1890+
$execution_time = '< 0.02s';
18911891
}
18921892
else {
1893-
$execution_time = round( $execution_time, 4 );
1893+
$execution_time = "[RED]" . round( $execution_time, 4 ) . "s[/RED]";
18941894
}
18951895

18961896
// The dot syntax can be used to created "groups".
@@ -1906,10 +1906,10 @@ public function save_performance( $name, $start_time = false ) {
19061906
$function_name .= '()';
19071907
}
19081908

1909-
$this->performance[$group_name][$function_name] = $execution_time . 's';
1909+
$this->performance[$group_name][$function_name] = $execution_time;
19101910
}
19111911
else {
1912-
$this->performance[$name] = $execution_time . 's';
1912+
$this->performance[$name] = $execution_time;
19131913
}
19141914
}
19151915

@@ -2065,8 +2065,8 @@ private function parse_slow_hook_actions() {
20652065

20662066
if ( array_key_exists( 'Hooks', $this->performance ) ) {
20672067
foreach ( $this->performance['Hooks'] as $hook_name => $execution_time ) {
2068-
// Only analyze hooks that took over 0.1s to execute.
2069-
if ( $execution_time !== '< 0.1s' ) {
2068+
// Only analyze hooks that took over 0.02s to execute.
2069+
if ( $execution_time !== '< 0.02s' ) {
20702070
// Make sure there are hooks to parse.
20712071
if ( property_exists( $wp_filter[$hook_name], 'callbacks' ) ) {
20722072
$callback_data = [];

0 commit comments

Comments
 (0)