Skip to content

Commit ddc6164

Browse files
Remove checking for specific missing required params
Co-authored-by: felixarntz <[email protected]>
1 parent 6fee919 commit ddc6164

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

plugins/optimization-detective/site-health.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,12 @@ function od_compose_site_health_result( $response ): array {
126126
$body = wp_remote_retrieve_body( $response );
127127
$data = json_decode( $body, true );
128128

129-
$required_args = array( 'slug', 'current_etag', 'hmac', 'url', 'viewport', 'elements' );
130-
$is_expected = (
129+
$is_expected = (
131130
400 === $code &&
132131
isset( $data['code'], $data['data']['params'] ) &&
133132
'rest_missing_callback_param' === $data['code'] &&
134133
is_array( $data['data']['params'] ) &&
135-
count( array_intersect( $data['data']['params'], $required_args ) ) === count( $required_args )
134+
count( $data['data']['params'] ) > 0
136135
);
137136
if ( ! $is_expected ) {
138137
$result['status'] = 'critical';

plugins/optimization-detective/storage/rest-api.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ function od_register_endpoint(): void {
4141

4242
// The slug and cache_purge_post_id args are further validated via the validate_callback for the 'hmac' parameter,
4343
// they are provided as input with the 'url' argument to create the HMAC by the server.
44-
// The following args are referenced in od_compose_site_health_result().
4544
$args = array(
4645
'slug' => array(
4746
'type' => 'string',

0 commit comments

Comments
 (0)