Skip to content

Commit 3fda75f

Browse files
committed
Use non_get_request instead of not_get_request
1 parent afaf3ce commit 3fda75f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

plugins/optimization-detective/helper.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function od_generate_media_query( ?int $minimum_viewport_width, ?int $maximum_vi
7171
* is_embed?: string,
7272
* is_preview?: string,
7373
* is_customize_preview?: string,
74-
* not_get_request?: string,
74+
* non_get_request?: string,
7575
* no_cache_purge_post_id?: string,
7676
* filter_disabled?: string,
7777
* rest_api_unavailable?: string,
@@ -84,7 +84,7 @@ function od_get_disabled_reasons(): array {
8484
'is_embed' => false,
8585
'is_preview' => false,
8686
'is_customize_preview' => false,
87-
'not_get_request' => false,
87+
'non_get_request' => false,
8888
'no_cache_purge_post_id' => false,
8989
);
9090

@@ -114,7 +114,7 @@ function od_get_disabled_reasons(): array {
114114

115115
// Disable for POST responses since they cannot, by definition, be cached.
116116
if ( isset( $_SERVER['REQUEST_METHOD'] ) && 'GET' !== $_SERVER['REQUEST_METHOD'] ) {
117-
$disabled_flags['not_get_request'] = true;
117+
$disabled_flags['non_get_request'] = true;
118118
}
119119

120120
// Disable when there is no post ID available for cache purging. Page caching plugins can only reliably be told to invalidate a cached page when a post is available to trigger
@@ -139,7 +139,7 @@ function od_get_disabled_reasons(): array {
139139
* is_embed: bool,
140140
* is_preview: bool,
141141
* is_customize_preview: bool,
142-
* not_get_request: bool,
142+
* non_get_request: bool,
143143
* no_cache_purge_post_id: bool
144144
* } $disabled_flags Flags indicating which conditions are disabling optimization.
145145
*/
@@ -152,7 +152,7 @@ function od_get_disabled_reasons(): array {
152152
'is_embed' => __( 'Page is not optimized because it is an embed.', 'optimization-detective' ),
153153
'is_preview' => __( 'Page is not optimized because it is a preview.', 'optimization-detective' ),
154154
'is_customize_preview' => __( 'Page is not optimized because it is a customize preview.', 'optimization-detective' ),
155-
'not_get_request' => __( 'Page is not optimized because it is not a GET request.', 'optimization-detective' ),
155+
'non_get_request' => __( 'Page is not optimized because it is not a GET request.', 'optimization-detective' ),
156156
'no_cache_purge_post_id' => __( 'Page is not optimized because there is no post ID available for cache purging.', 'optimization-detective' ),
157157
);
158158

plugins/optimization-detective/tests/test-optimization.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public function data_provider_test_od_maybe_add_template_output_buffer_filter():
185185
add_filter(
186186
'od_can_optimize_response',
187187
function ( $can_optimize, array $disabled_flags ): bool {
188-
$expected_keys = array( 'is_search', 'is_embed', 'is_preview', 'is_customize_preview', 'not_get_request', 'no_cache_purge_post_id' );
188+
$expected_keys = array( 'is_search', 'is_embed', 'is_preview', 'is_customize_preview', 'non_get_request', 'no_cache_purge_post_id' );
189189
$this->assertCount( count( $expected_keys ), $disabled_flags );
190190
foreach ( $expected_keys as $key ) {
191191
$this->assertArrayHasKey( $key, $disabled_flags );
@@ -395,7 +395,7 @@ public function test_od_can_optimize_response( Closure $set_up, bool $expected )
395395
'is_embed',
396396
'is_preview',
397397
'is_customize_preview',
398-
'not_get_request',
398+
'non_get_request',
399399
'no_cache_purge_post_id',
400400
'filter_disabled',
401401
'rest_api_unavailable',

0 commit comments

Comments
 (0)