diff --git a/plugins/optimization-detective/class-od-url-metric.php b/plugins/optimization-detective/class-od-url-metric.php index c565b1595..a9ba604de 100644 --- a/plugins/optimization-detective/class-od-url-metric.php +++ b/plugins/optimization-detective/class-od-url-metric.php @@ -38,7 +38,7 @@ * } * @phpstan-type Data array{ * uuid: non-empty-string, - * eTag?: string, + * etag?: string, * url: non-empty-string, * timestamp: float, * viewport: ViewportRect, @@ -156,7 +156,7 @@ public function set_group( OD_URL_Metric_Group $group ): void { * Gets JSON schema for URL Metric. * * @since 0.1.0 - * @since n.e.x.t Added the 'eTag' property to the schema. + * @since n.e.x.t Added the 'etag' property to the schema. * * @todo Cache the return value? * @@ -210,7 +210,7 @@ public static function get_json_schema(): array { 'required' => true, 'readonly' => true, // Omit from REST API. ), - 'eTag' => array( + 'etag' => array( 'description' => __( 'The ETag for the URL Metric.', 'optimization-detective' ), 'type' => 'string', 'required' => false, // To be made required in a future release. @@ -434,7 +434,7 @@ public function get_uuid(): string { */ public function get_etag(): ?string { // Since the ETag is optional for now, return null for old URL Metrics that do not have one. - return $this->data['eTag'] ?? null; + return $this->data['etag'] ?? null; } /** diff --git a/plugins/optimization-detective/storage/rest-api.php b/plugins/optimization-detective/storage/rest-api.php index 51d004ea0..9b3b962ca 100644 --- a/plugins/optimization-detective/storage/rest-api.php +++ b/plugins/optimization-detective/storage/rest-api.php @@ -188,7 +188,7 @@ function od_handle_rest_request( WP_REST_Request $request ) { // Now supply the readonly args which were omitted from the REST API params due to being `readonly`. 'timestamp' => microtime( true ), 'uuid' => wp_generate_uuid4(), - 'eTag' => $request->get_param( 'eTag' ), + 'etag' => $request->get_param( 'eTag' ), ) ) );