Skip to content

Commit f492eed

Browse files
committed
Clarify legacy constant usage and reorder drop-in checks for better readability.
1 parent b6286a7 commit f492eed

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

plugins/performance-lab/load.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,17 +157,19 @@ function perflab_get_standalone_plugin_version_constants(): array {
157157
function perflab_maybe_set_object_cache_dropin(): void {
158158
global $wp_filesystem;
159159

160-
// Bail if the drop-in is not enabled.
161-
if ( ! defined( 'PERFLAB_PLACE_OBJECT_CACHE_DROPIN' ) || ! PERFLAB_PLACE_OBJECT_CACHE_DROPIN ) {
160+
// Bail if Server-Timing is disabled entirely.
161+
if ( defined( 'PERFLAB_DISABLE_SERVER_TIMING' ) && PERFLAB_DISABLE_SERVER_TIMING ) {
162162
return;
163163
}
164164

165-
// Bail if Server-Timing is disabled entirely.
166-
if ( defined( 'PERFLAB_DISABLE_SERVER_TIMING' ) && PERFLAB_DISABLE_SERVER_TIMING ) {
165+
// Bail if the drop-in is not enabled.
166+
if ( ! defined( 'PERFLAB_PLACE_OBJECT_CACHE_DROPIN' ) || ! PERFLAB_PLACE_OBJECT_CACHE_DROPIN ) {
167167
return;
168168
}
169169

170170
// Bail if disabled via constant.
171+
// This constant is maintained only for backward compatibility and should not be relied upon in new implementations.
172+
// Use the 'PERFLAB_PLACE_OBJECT_CACHE_DROPIN' constant instead to control drop-in placement.
171173
if ( defined( 'PERFLAB_DISABLE_OBJECT_CACHE_DROPIN' ) && PERFLAB_DISABLE_OBJECT_CACHE_DROPIN ) {
172174
return;
173175
}

0 commit comments

Comments
 (0)