Skip to content

Commit c0e3291

Browse files
committed
Rename string to jsonString to avoid potential type confusion
1 parent ad6d264 commit c0e3291

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

plugins/optimization-detective/detect.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,13 +330,13 @@ function extendElementData( xpath, properties ) {
330330
}
331331

332332
/**
333-
* Compresses a string using CompressionStream API.
333+
* Compresses a (JSON) string using CompressionStream API.
334334
*
335-
* @param {string} string - String to compress.
335+
* @param {string} jsonString - JSON string to compress.
336336
* @return {Promise<Blob>} Compressed data.
337337
*/
338-
async function compress( string ) {
339-
const encodedData = new TextEncoder().encode( string );
338+
async function compress( jsonString ) {
339+
const encodedData = new TextEncoder().encode( jsonString );
340340
const compressedDataStream = new Blob( [ encodedData ] )
341341
.stream()
342342
.pipeThrough( new CompressionStream( 'gzip' ) );

plugins/optimization-detective/storage/data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ function od_get_maximum_url_metric_size(): int {
486486
esc_html( "Filter: 'od_maximum_url_metric_size'" ),
487487
esc_html(
488488
sprintf(
489-
/* translators: %s: size */
489+
/* translators: %s: size */
490490
__( 'Invalid size "%s". Must be greater than zero.', 'optimization-detective' ),
491491
$size
492492
)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ function od_trigger_page_cache_invalidation( int $cache_purge_post_id ): void {
353353
* @param mixed $result Response to replace the requested version with. Can be anything a normal endpoint can return, or null to not hijack the request.
354354
* @param WP_REST_Server $server Server instance.
355355
* @param WP_REST_Request $request Request used to generate the response.
356-
* @return mixed Response to replace the requested version with.
356+
* @return mixed Passed through $result if successful, or otherwise a WP_Error.
357357
*/
358358
function od_decompress_rest_request_body( $result, WP_REST_Server $server, WP_REST_Request $request ) {
359359
if (

0 commit comments

Comments
 (0)