Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
79afa19
Implement foundation for a Server-Timing API, including default metri…
felixarntz Oct 6, 2022
6974ebb
Merge branch 'trunk' into add/551-server-timing-api
felixarntz Oct 10, 2022
1ee4ec8
Implement perflab_wrap_server_timing() utility function for callbacks.
felixarntz Oct 10, 2022
0e89e48
Introduce perflab_server_timing_use_output_buffer() and also record t…
felixarntz Oct 11, 2022
a048bb6
Use shutdown action instead of wp_footer when using an output buffer.
felixarntz Oct 11, 2022
d31ca57
Expose DB queries Server-Timing metrics if SAVEQUERIES is enabled.
felixarntz Oct 12, 2022
692cd60
Merge branch 'trunk' into add/551-server-timing-api
felixarntz Oct 31, 2022
51c4222
Revamp Server-Timing API to simplify API usage.
felixarntz Oct 31, 2022
be29598
Merge branch 'trunk' into add/551-server-timing-api
felixarntz Nov 23, 2022
26cfc27
Move logic to register default Server-Timing metrics to its own file.
felixarntz Nov 23, 2022
096bb87
Place object-cache.php drop-in to load Server-Timing API early enough…
felixarntz Nov 24, 2022
1efb1db
Add alloptions query to metrics to cover, in support of #526.
felixarntz Nov 24, 2022
9430492
Add isset and is_array check to account for odd database implementati…
felixarntz Dec 2, 2022
fb5150e
Consider either performance-lab or performance as plugin directory na…
felixarntz Dec 8, 2022
2c48a19
Follow up fix to last commit.
felixarntz Dec 8, 2022
2ff02a7
Add missing return doc.
felixarntz Dec 9, 2022
e501b5d
Introduce has_registered_metric method.
felixarntz Dec 9, 2022
8115d82
Add tests for Server-Timing API global functions.
felixarntz Dec 9, 2022
5f96a0e
Remove overly strict check that is not feasible for unit testing.
felixarntz Dec 9, 2022
a2afcb9
Include check for extra safety.
felixarntz Dec 9, 2022
9d826f5
Prevent duplicate registration and warn about it, fix potential issue…
felixarntz Dec 9, 2022
33cf718
Fix perflab_wrap_server_timing() to consider potential mmultiple call…
felixarntz Dec 9, 2022
44fd9e5
Reintroduce revised condition to warn about measuring that happens to…
felixarntz Dec 9, 2022
06dd8f0
Add test coverage for Perflab_Server_Timing class.
felixarntz Dec 9, 2022
946fdb9
Add test coverage for Perflab_Server_Timing_Metric class.
felixarntz Dec 9, 2022
1641feb
Add at least basic test for placing object-cache.php drop-in.
felixarntz Dec 10, 2022
668d4e1
Merge branch 'trunk' into add/551-server-timing-api
felixarntz Dec 12, 2022
e88410e
Add comment about global used.
felixarntz Dec 12, 2022
b88611c
Merge branch 'add/551-server-timing-api' of github.com:WordPress/perf…
felixarntz Dec 12, 2022
e9eba75
Rename object-cache.php to object-cache.copy.php to indicate its usag…
felixarntz Dec 12, 2022
6f2f1c5
Delete custom object-cache.php drop-in on deactivation (and restore o…
felixarntz Dec 12, 2022
a5f9f5a
Use more specific -orig.php suffix in case any other active plugin is…
felixarntz Dec 12, 2022
fdcad81
Fix legacy test setUp method names to be set_up.
felixarntz Dec 12, 2022
08c05d5
Fix test warning and account for filesystem that does not allow writi…
felixarntz Dec 12, 2022
03ad67e
Further fixes around WP_Filesystem() usage.
felixarntz Dec 12, 2022
7c87c31
Change wp-env config to force direct filesystem access, similar to co…
felixarntz Dec 12, 2022
ed6bbbd
Merge branch 'trunk' into add/551-server-timing-api
felixarntz Dec 14, 2022
ca837cd
Fix documentation wording issue.
felixarntz Dec 14, 2022
e8a4bad
Clarify output buffer intention and why it would be useful to enable it.
felixarntz Dec 14, 2022
f2d60e9
Merge branch 'add/551-server-timing-api' of github.com:WordPress/perf…
felixarntz Dec 14, 2022
ebb4824
Use PHP_INT_MIN if available instead of arbitrary -1000.
felixarntz Dec 14, 2022
887f6b1
Move logic to check for null metric value to a more logical place.
felixarntz Dec 14, 2022
5a25b2c
Only add filter for measuring autoloaded options query if object-cach…
felixarntz Dec 14, 2022
6c71103
Add doc comments to clarify use of SAVEQUERIES constant.
felixarntz Dec 14, 2022
1d26d91
Fix .wp-env.json indentation to use spaces per .editorconfig guidelines.
felixarntz Dec 14, 2022
ddd8fe3
Rename get_header_value() method to get_header().
felixarntz Dec 14, 2022
b6466fa
Merge branch 'trunk' into add/551-server-timing-api
felixarntz Dec 15, 2022
569637d
Also allow using numeric strings to set Server-Timing metric values.
felixarntz Dec 15, 2022
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
Use more specific -orig.php suffix in case any other active plugin is…
… doing something similar, to avoid conflicts.
  • Loading branch information
felixarntz committed Dec 12, 2022
commit a5f9f5a8bd24d0a89738bd6e5067069d86894081
8 changes: 4 additions & 4 deletions load.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ function perflab_maybe_set_object_cache_dropin() {
// The Performance Lab object-cache.php will still load it, so the
// behavior does not change.
if ( $wp_filesystem->exists( WP_CONTENT_DIR . '/object-cache.php' ) ) {
$wp_filesystem->move( WP_CONTENT_DIR . '/object-cache.php', WP_CONTENT_DIR . '/object-cache-orig.php' );
$wp_filesystem->move( WP_CONTENT_DIR . '/object-cache.php', WP_CONTENT_DIR . '/object-cache-plst-orig.php' );
}

$wp_filesystem->copy( PERFLAB_PLUGIN_DIR_PATH . 'server-timing/object-cache.copy.php', WP_CONTENT_DIR . '/object-cache.php' );
Expand All @@ -320,7 +320,7 @@ function perflab_maybe_set_object_cache_dropin() {
*
* This function should be run on plugin deactivation. If there was another original
* object-cache.php drop-in file (renamed in `perflab_maybe_set_object_cache_dropin()`
* to object-cache-orig.php), it will be restored.
* to object-cache-plst-orig.php), it will be restored.
*
* This function will short-circuit if the constant
* 'PERFLAB_DISABLE_OBJECT_CACHE_DROPIN' is set as true.
Expand All @@ -346,8 +346,8 @@ function perflab_maybe_remove_object_cache_dropin() {
// If there is an actual object-cache.php file, restore it
// and override the Performance Lab file.
// Otherwise just delete the Performance Lab file.
if ( $wp_filesystem->exists( WP_CONTENT_DIR . '/object-cache-orig.php' ) ) {
$wp_filesystem->move( WP_CONTENT_DIR . '/object-cache-orig.php', WP_CONTENT_DIR . '/object-cache.php', true );
if ( $wp_filesystem->exists( WP_CONTENT_DIR . '/object-cache-plst-orig.php' ) ) {
$wp_filesystem->move( WP_CONTENT_DIR . '/object-cache-plst-orig.php', WP_CONTENT_DIR . '/object-cache.php', true );
} else {
$wp_filesystem->delete( WP_CONTENT_DIR . '/object-cache.php' );
}
Expand Down
4 changes: 2 additions & 2 deletions server-timing/object-cache.copy.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ function perflab_load_server_timing_api_from_dropin() {
perflab_load_server_timing_api_from_dropin();

// Load the original object cache drop-in if present.
if ( file_exists( WP_CONTENT_DIR . '/object-cache-orig.php' ) ) {
require_once WP_CONTENT_DIR . '/object-cache-orig.php';
if ( file_exists( WP_CONTENT_DIR . '/object-cache-plst-orig.php' ) ) {
require_once WP_CONTENT_DIR . '/object-cache-plst-orig.php';
}