PluginProbe
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization / trunk
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization vtrunk
4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 2.5.5 2.5.6 2.5.7 3.0.0 3.0.1 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.11.0 3.11.1 3.11.2 3.11.3 3.12.0 All 135 releases
← All changes | inc/v2/PageProfiler/Profile.php +3 -3 4.2.9 → trunk View file →
@@ -155,9 +155,9 @@
155 155 * Stores above-fold image data for a specific profile ID and device type.
156 156 *
157 157 * @param string $id The profile ID.
158 158 * @param int $device_type The device type constant.
159 - * @param array<string> $above_fold_images Array of above-fold images.
159 + * @param array<int|string> $above_fold_images Array of above-fold image ids.
160 160 * @param array<string, array<string, array<int, string>>> $af_bg_selectors Array of above-fold background selectors.
161 161 * Array structure:
162 162 * [
163 163 * 'css_selector' => [
@@ -383,9 +383,9 @@
383 383 * @return bool True if the LCP image is in the viewport of all device types, false otherwise.
384 384 */
385 385 public function is_lcp_image_in_all_viewports( int $image_id ): bool {
386 386 foreach ( self::get_active_devices() as $device ) {
387 - if ( ( ( self::$current_profile_data[ $device ]['lcp']['type'] ?? '' ) === 'img' ) && ( self::$current_profile_data[ $device ]['lcp']['imageId'] === $image_id ) ) {
387 + if ( ( ( self::$current_profile_data[ $device ]['lcp']['type'] ?? '' ) === 'img' ) && ( ( self::$current_profile_data[ $device ]['lcp']['imageId'] ?? null ) === $image_id ) ) {
388 388 return true;
389 389 }
390 390 }
391 391
@@ -481,9 +481,9 @@
481 481
482 482 // Add device-specific metrics
483 483 foreach ( $profile_data as $device_type => $device_data ) {
484 484 $device_name = $this->get_device_name( $device_type );
485 - $comment_parts[] = 'measurement#device-' . $device_name . '#' . json_encode( $device_data );
485 + $comment_parts[] = 'measurement#device-' . $device_name . '#' . json_encode( $device_data, JSON_HEX_TAG | JSON_HEX_AMP );
486 486 }
487 487
488 488 return '<!-- ' . implode( ' ', $comment_parts ) . ' -->';
489 489 }