Plugin Directory

Changeset 3447061


Ignore:
Timestamp:
01/26/2026 12:01:50 PM (2 months ago)
Author:
coozywana
Message:

Update to version 2.4.0 from GitHub

Location:
staticdelivr
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • staticdelivr/tags/2.4.0/README.txt

    r3446608 r3447061  
    240240== Changelog ==
    241241
     242= 2.4.0 =
     243* New: Smart Dimension Detection. The plugin now automatically identifies missing width and height attributes for WordPress images and restores them using attachment metadata.
     244* Improved: Resolves Google PageSpeed Insights warnings regarding "Explicit width and height" for image elements.
     245* Improved: Enhances Cumulative Layout Shift (CLS) scores by ensuring browsers reserve the correct aspect ratio during image loading.
     246* Improved: Synchronized CDN URL optimization parameters with detected database dimensions for more accurate image scaling.
     247
    242248= 2.3.0 =
    243249* Major Improvement: Significant performance boost by removing blocking DNS lookups during image processing.
     
    397403== Upgrade Notice ==
    398404
     405= 2.4.0 =
     406This update introduces Smart Dimension Detection to automatically fix PageSpeed Insights warnings and improve your site's SEO and CLS scores. Highly recommended for all users.
     407
    399408= 2.3.0 =
    400409This major update introduces significant performance optimizations and critical stability fixes for thumbnail generation and HTML parsing. Upgrading is highly recommended for a faster and more stable site experience.
  • staticdelivr/tags/2.4.0/includes/class-staticdelivr-images.php

    r3446608 r3447061  
    299299        $height = preg_match( '/height=["\']?(\d+)/i', $img_tag, $h_match ) ? (int)$h_match[1] : null;
    300300
     301        // Smart Attribute Injection: If dimensions are missing, try to find them via the WP ID class
     302        if ( ( ! $width || ! $height ) && preg_match( '/wp-image-([0-9]+)/i', $img_tag, $id_match ) ) {
     303            $attachment_id = (int) $id_match[1];
     304            $meta = wp_get_attachment_metadata( $attachment_id );
     305
     306            if ( $meta ) {
     307                if ( ! $width && ! empty( $meta['width'] ) ) {
     308                    $width = $meta['width'];
     309                    $img_tag = str_replace( '<img', '<img width="' . esc_attr( $width ) . '"', $img_tag );
     310                }
     311                if ( ! $height && ! empty( $meta['height'] ) ) {
     312                    $height = $meta['height'];
     313                    $img_tag = str_replace( '<img', '<img height="' . esc_attr( $height ) . '"', $img_tag );
     314                }
     315            }
     316        }
     317
    301318        return preg_replace_callback(
    302319            '/src=["\']([^"\']+)["\']/i',
  • staticdelivr/tags/2.4.0/staticdelivr.php

    r3446608 r3447061  
    33 * Plugin Name: StaticDelivr CDN
    44 * Description: Speed up your WordPress site with free CDN delivery and automatic image optimization. Reduces load times and bandwidth costs.
    5  * Version: 2.3.0
     5 * Version: 2.4.0
    66 * Requires at least: 5.8
    77 * Requires PHP: 7.4
     
    2121// Define plugin constants.
    2222if (!defined('STATICDELIVR_VERSION')) {
    23     define('STATICDELIVR_VERSION', '2.3.0');
     23    define('STATICDELIVR_VERSION', '2.4.0');
    2424}
    2525if (!defined('STATICDELIVR_PLUGIN_FILE')) {
  • staticdelivr/trunk/README.txt

    r3446608 r3447061  
    240240== Changelog ==
    241241
     242= 2.4.0 =
     243* New: Smart Dimension Detection. The plugin now automatically identifies missing width and height attributes for WordPress images and restores them using attachment metadata.
     244* Improved: Resolves Google PageSpeed Insights warnings regarding "Explicit width and height" for image elements.
     245* Improved: Enhances Cumulative Layout Shift (CLS) scores by ensuring browsers reserve the correct aspect ratio during image loading.
     246* Improved: Synchronized CDN URL optimization parameters with detected database dimensions for more accurate image scaling.
     247
    242248= 2.3.0 =
    243249* Major Improvement: Significant performance boost by removing blocking DNS lookups during image processing.
     
    397403== Upgrade Notice ==
    398404
     405= 2.4.0 =
     406This update introduces Smart Dimension Detection to automatically fix PageSpeed Insights warnings and improve your site's SEO and CLS scores. Highly recommended for all users.
     407
    399408= 2.3.0 =
    400409This major update introduces significant performance optimizations and critical stability fixes for thumbnail generation and HTML parsing. Upgrading is highly recommended for a faster and more stable site experience.
  • staticdelivr/trunk/includes/class-staticdelivr-images.php

    r3446608 r3447061  
    299299        $height = preg_match( '/height=["\']?(\d+)/i', $img_tag, $h_match ) ? (int)$h_match[1] : null;
    300300
     301        // Smart Attribute Injection: If dimensions are missing, try to find them via the WP ID class
     302        if ( ( ! $width || ! $height ) && preg_match( '/wp-image-([0-9]+)/i', $img_tag, $id_match ) ) {
     303            $attachment_id = (int) $id_match[1];
     304            $meta = wp_get_attachment_metadata( $attachment_id );
     305
     306            if ( $meta ) {
     307                if ( ! $width && ! empty( $meta['width'] ) ) {
     308                    $width = $meta['width'];
     309                    $img_tag = str_replace( '<img', '<img width="' . esc_attr( $width ) . '"', $img_tag );
     310                }
     311                if ( ! $height && ! empty( $meta['height'] ) ) {
     312                    $height = $meta['height'];
     313                    $img_tag = str_replace( '<img', '<img height="' . esc_attr( $height ) . '"', $img_tag );
     314                }
     315            }
     316        }
     317
    301318        return preg_replace_callback(
    302319            '/src=["\']([^"\']+)["\']/i',
  • staticdelivr/trunk/staticdelivr.php

    r3446608 r3447061  
    33 * Plugin Name: StaticDelivr CDN
    44 * Description: Speed up your WordPress site with free CDN delivery and automatic image optimization. Reduces load times and bandwidth costs.
    5  * Version: 2.3.0
     5 * Version: 2.4.0
    66 * Requires at least: 5.8
    77 * Requires PHP: 7.4
     
    2121// Define plugin constants.
    2222if (!defined('STATICDELIVR_VERSION')) {
    23     define('STATICDELIVR_VERSION', '2.3.0');
     23    define('STATICDELIVR_VERSION', '2.4.0');
    2424}
    2525if (!defined('STATICDELIVR_PLUGIN_FILE')) {
Note: See TracChangeset for help on using the changeset viewer.