Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a1fd89c
Implement logic to measure specific hook execution time with Server-T…
Jul 18, 2023
1c21d08
Merge branch 'trunk' into add/server-timing-hook-ui
Jul 21, 2023
ec9708b
Fix newly exposed lint violations.
Jul 21, 2023
6a1205f
Use more appropriate workaround when PHP_INT_MIN is not defined.
Jul 21, 2023
08d79c3
Merge branch 'trunk' into add/server-timing-hook-ui
Aug 3, 2023
694a6d1
Reuse logic to measure actions and filters, and provide inline docume…
Aug 3, 2023
6b5d12a
Clarify how the hooks are measured in WP Admin UI.
Aug 3, 2023
61f5ccc
Ensure that no duplicate hooks can be provided.
Aug 3, 2023
585911d
Add tests for server timing setting registration.
Aug 3, 2023
6db1e85
Add tests for server timing admin UI.
Aug 3, 2023
a8d141f
Remove XHTML syntax from WP Admin forms.
Aug 7, 2023
400c0a1
Modify hook measuring logic to use all hook.
Aug 7, 2023
c5fe384
Replace sanitize_key for hook name sanitization with custom regex to …
Aug 7, 2023
447f078
Have hook callbacks self-remove to only measure first occurrence.
Aug 7, 2023
c48d206
Remove novalidate attribute.
Aug 7, 2023
b85959e
Loosen hook name sanitization to rely on sanitize_text_field(), while…
Aug 7, 2023
124a7a6
Update test to cover whitespace in hookname.
Aug 7, 2023
7f99021
Use allowlist for Server-Timing option keys.
Aug 7, 2023
05d849e
Fix tests.
Aug 7, 2023
fd41db1
Add note on hook limitation unless output buffering is enabled.
Aug 7, 2023
f484a7d
Use placeholders for non-translatable strings.
Aug 8, 2023
7c94b9e
Add missing early return on top of procedural file.
Aug 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add note on hook limitation unless output buffering is enabled.
  • Loading branch information
Felix Arntz
Felix Arntz committed Aug 7, 2023
commit fd41db1ebfbafe0545722dfafcf75de4ed83c565
9 changes: 9 additions & 0 deletions admin/server-timing.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ static function() {
__( 'For any hook name provided, the <strong>cumulative duration between all callbacks</strong> attached to the hook is measured, in milliseconds.', 'performance-lab' ),
array( 'strong' => array() )
);
if ( ! perflab_server_timing_use_output_buffer() ) {
?>
<br>
<?php
echo wp_kses(
__( 'Since the Server-Timing header is sent before the template is loaded, only hooks before the <code>template_include</code> filter can be measured.', 'performance-lab' ),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd use sprintf with a placeholder for template_include so that it does not get translated

array( 'code' => array() )
);
}
?>
</p>
<?php
Expand Down