@@ -1885,12 +1885,12 @@ public function save_performance( $name, $start_time = false ) {
1885
1885
1886
1886
$ execution_time = microtime ( true ) - $ start_time ;
1887
1887
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 ' ;
1891
1891
}
1892
1892
else {
1893
- $ execution_time = round ( $ execution_time , 4 );
1893
+ $ execution_time = " [RED] " . round ( $ execution_time , 4 ) . " s[/RED] " ;
1894
1894
}
1895
1895
1896
1896
// The dot syntax can be used to created "groups".
@@ -1906,10 +1906,10 @@ public function save_performance( $name, $start_time = false ) {
1906
1906
$ function_name .= '() ' ;
1907
1907
}
1908
1908
1909
- $ this ->performance [$ group_name ][$ function_name ] = $ execution_time . ' s ' ;
1909
+ $ this ->performance [$ group_name ][$ function_name ] = $ execution_time ;
1910
1910
}
1911
1911
else {
1912
- $ this ->performance [$ name ] = $ execution_time . ' s ' ;
1912
+ $ this ->performance [$ name ] = $ execution_time ;
1913
1913
}
1914
1914
}
1915
1915
@@ -2065,8 +2065,8 @@ private function parse_slow_hook_actions() {
2065
2065
2066
2066
if ( array_key_exists ( 'Hooks ' , $ this ->performance ) ) {
2067
2067
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 ' ) {
2070
2070
// Make sure there are hooks to parse.
2071
2071
if ( property_exists ( $ wp_filter [$ hook_name ], 'callbacks ' ) ) {
2072
2072
$ callback_data = [];
0 commit comments