Plugin Directory

Changeset 3350722


Ignore:
Timestamp:
08/26/2025 10:12:55 PM (5 months ago)
Author:
nosilver4u
Message:

tagging and releasing 4.2.1

Location:
easy-image-optimizer
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • easy-image-optimizer/tags/4.2.1/changelog.txt

    r3328397 r3350722  
     1= 4.2.1 =
     2*Release Date - August 26, 2025*
     3
     4* fixed: Some preload URLs not updated
     5
    16= 4.2.0 =
    27*Release Date - July 15, 2025*
  • easy-image-optimizer/tags/4.2.1/classes/class-exactdn.php

    r3328397 r3350722  
    169169     */
    170170    private $replaced_google_fonts = '';
     171
     172    /**
     173     * Keep track of images that have been replaced with ExactDN URLs.
     174     *
     175     * @access private
     176     * @var array $replaced_images
     177     */
     178    private $replaced_images = array();
    171179
    172180    /**
     
    15741582                        // Replace original tag with modified version.
    15751583                        $content = \str_replace( $tag, $new_tag, $content );
     1584                        // Check through previous replacements to see if the ExactDN URL needs to be updated.
     1585                        foreach ( $this->replaced_images as $replaced_index => $replaced_image ) {
     1586                            if ( $replaced_image['new'] === $src ) {
     1587                                $this->debug_message( "updating replaced image {$replaced_image['new']} with $new_src" );
     1588                                $this->replaced_images[ $replaced_index ]['new'] = $new_src;
     1589                                break;
     1590                            }
     1591                        }
    15761592                    }
    15771593                } elseif ( $lazy && ! empty( $placeholder_src ) && $this->validate_image_url( $placeholder_src ) ) {
     
    16501666        } // End if() -- we found images in the page at all.
    16511667
     1668        // Check our preloads and see if we need to update any of them.
     1669        $content = $this->update_preload_images( $content );
     1670
    16521671        // Process <a> elements in the page for image URLs.
    16531672        $content = $this->filter_image_links( $content );
     
    16761695        $this->filtering_the_content = false;
    16771696
    1678         foreach ( $this->preload_images as $preload_index => $preload_image ) {
     1697        foreach ( $this->preload_images as $preload_image ) {
    16791698            if ( ! empty( $preload_image['found'] ) ) {
    16801699                continue;
     
    16921711        if ( $this->filtering_the_page && $this->get_option( $this->prefix . 'debug' ) && 0 !== \strpos( $content, '{' ) && false === \strpos( '$content', '<loc>' ) ) {
    16931712            $content .= '<!-- Easy IO processing time: ' . $this->elapsed_time . ' seconds -->';
     1713        }
     1714        return $content;
     1715    }
     1716
     1717    /**
     1718     * Add an images to the replaced images list. Checks to see if the image is already in the list.
     1719     *
     1720     * @param string $orig_image The original image URL.
     1721     * @param string $new_image The new image URL.
     1722     */
     1723    public function add_image_to_replacements( $orig_image, $new_image ) {
     1724        if ( ! empty( $orig_image ) && ! empty( $new_image ) && $orig_image !== $new_image ) {
     1725            foreach ( $this->replaced_images as $replaced_image ) {
     1726                if ( $replaced_image['orig'] === $orig_image ) {
     1727                    return;
     1728                }
     1729            }
     1730            $this->replaced_images[] = array(
     1731                'orig' => $orig_image,
     1732                'new'  => $new_image,
     1733            );
     1734        }
     1735    }
     1736
     1737    /**
     1738     * Check the HTML to see if any <link> preload tags need to be updated still.
     1739     *
     1740     * @param string $content The HTML content to parse.
     1741     * @return string The filtered HTML content.
     1742     */
     1743    public function update_preload_images( $content ) {
     1744        $this->debug_message( '<b>' . __METHOD__ . '()</b>' );
     1745        foreach ( $this->preload_images as $index => $preload_image ) {
     1746            if ( empty( $preload_image['found'] ) ) {
     1747                $this->debug_message( "looking for preload image {$preload_image['url']} in replaced image list" );
     1748                foreach ( $this->replaced_images as $replaced_image ) {
     1749                    if ( $replaced_image['orig'] === $preload_image['url'] ) {
     1750                        $this->preload_images[ $index ]['found'] = true;
     1751                        $this->debug_message( "replacing {$preload_image['url']} with {$replaced_image['new']}" );
     1752                        $new_preload_tag = $preload_image['tag'];
     1753                        $this->set_attribute( $new_preload_tag, 'href', \esc_url( $replaced_image['new'] ), true );
     1754                        if ( $preload_image['tag'] !== $new_preload_tag ) {
     1755                            $content = \str_replace( $preload_image['tag'], $new_preload_tag, $content );
     1756                        }
     1757                    }
     1758                }
     1759            }
    16941760        }
    16951761        return $content;
     
    19732039                                    $element = \str_replace( $bg_images[ $bindex ], $bg_image, $element );
    19742040                                }
     2041                                $preload_image = $this->is_image_preloaded( $exactdn_bg_image_url, $bg_image_url );
     2042                                if ( $preload_image ) {
     2043                                    if ( $exactdn_bg_image_url !== $preload_image['url'] ) {
     2044                                        $this->debug_message( "replacing {$preload_image['url']} with $exactdn_bg_image_url" );
     2045                                        $new_preload_tag = $preload_image['tag'];
     2046                                        $this->set_attribute( $new_preload_tag, 'href', \esc_url( $exactdn_bg_image_url ), true );
     2047                                        if ( $preload_image['tag'] !== $new_preload_tag ) {
     2048                                            $content = \str_replace( $preload_image['tag'], $new_preload_tag, $content );
     2049                                        }
     2050                                    }
     2051                                }
    19752052                            }
    19762053                        }
     
    20012078            $prz_thumb = $this->generate_url( $prz_detail_matches[1], \apply_filters( 'exactdn_personalizationdotcom_thumb_args', '', $prz_detail_matches[1] ) );
    20022079            if ( $prz_thumb !== $prz_detail_matches ) {
     2080                $this->add_image_to_replacements( $prz_detail_matches[1], $prz_thumb );
    20032081                $content = \str_replace( "thumbnailUrl:'{$prz_detail_matches[1]}'", "thumbnailUrl:'$prz_thumb'", $content );
    20042082            }
     
    25982676                        $resize_existing = true;
    25992677                    }
    2600                 } else {
     2678                } elseif ( 'full' !== $size ) {
    26012679                    $resize_existing = true;
    26022680                }
     
    26282706                    $intermediate,
    26292707                );
     2708                if ( ! $resize_existing ) {
     2709                    $this->add_image_to_replacements( $image_url, $image[0] );
     2710                }
    26302711            } elseif ( \is_array( $size ) ) {
    26312712                // Pull width and height values from the provided array, if possible.
  • easy-image-optimizer/tags/4.2.1/easy-image-optimizer.php

    r3328397 r3350722  
    1414Description: Easily speed up your website to better connect with your visitors. Properly compress and size/scale images. Includes lazy load and WebP auto-convert.
    1515Author: Exactly WWW
    16 Version: 4.2.0
     16Version: 4.2.1
    1717Requires at least: 6.6
    1818Requires PHP: 8.1
     
    3030    add_action( 'admin_notices', 'easyio_unsupported_php' );
    3131} elseif ( false === strpos( add_query_arg( '', '' ), 'easyio_disable=1' ) ) {
    32     define( 'EASYIO_VERSION', 420 );
     32    define( 'EASYIO_VERSION', 421 );
    3333
    3434    /**
  • easy-image-optimizer/tags/4.2.1/readme.txt

    r3328397 r3350722  
    33Tags: image, resize, webp, lazy load, compress
    44Tested up to: 6.8
    5 Stable tag: 4.2.0
     5Stable tag: 4.2.1
    66License: GPLv3
    77
     
    5656* If you would like to help translate this plugin in your language, get started here: https://translate.wordpress.org/projects/wp-plugins/easy-image-optimizer/
    5757
     58= 4.2.1 =
     59*Release Date - August 26, 2025*
     60
     61* fixed: Some preload URLs not updated
     62
    5863= 4.2.0 =
    5964*Release Date - July 15, 2025*
     
    7984* fixed: Easy IO srcset filler using incorrect width for calculations
    8085
    81 = 3.9.4 =
    82 *Release Date - October 31, 2024*
    83 
    84 * fixed: Lazy Load for iframes results in empty src attribute
    85 * fixed: Lazy Load breaks --background CSS variable
    86 
    87 = 3.9.3 =
    88 *Release Date - September 12, 2024*
    89 * fixed: HTML syntax for noscript fall-back when lazy loading picture elements
    90 * fixed: is_file wrapper method triggers PHP warning
    91 * fixed: some strings not properly i18n
    92 
    93 = 3.9.2 =
    94 *Release Date - July 25, 2024*
    95 
    96 * changed: skip lazy load for LCP images based on fetchpriority when auto-scaling is disabled
    97 * changed: improve performance of ewwwio_is_file(), props @rmpel
    98 * changed: require PHP 8.1 or higher
    99 * fixed: Lazy Load and Easy IO fail to decode URLs with HTML-encoded characters, which causes esc_url to break the URL
    100 * fixed: Easy IO fails to update CDN domain if site is re-registered while still active
    101 
    102 = 3.9.1 =
    103 *Release Date - May 29, 2024*
    104 
    105 * added: warning when hiding query strings with Hide My WP
    106 * changed: much better resizing for PNG8 and other paletted PNG images
    107 * changed: apply async loading to lazyload JS using WP core functionality
    108 
    109 = 3.9.0 =
    110 *Release Date - April 23, 2024*
    111 
    112 * added: Easy IO delivery for JS/CSS assets from additional domains
    113 * added: Easy IO support for Divi Pixel image masks
    114 * changed: Lazy Load checks for auto-scale exclusions on ancestors of lazyloaded element
    115 * fixed: Help links broken in Firefox's Strict mode
    116 
    117 = 3.8.0 =
    118 *Release Date - April 11, 2024*
    119 
    120 * added: Lazy Load can use dominant color placeholders via Easy IO
    121 * added: ability to filter/parse admin-ajax.php requests via eio_filter_admin_ajax_response filter
    122 * changed: improved smoothing of LQIP for Lazy Load when using Easy IO
    123 
    124 = 3.7.0 =
    125 *Release Date - March 20, 2024*
    126 
    127 * added: support for upcoming Slider Revolution 7 rendering engine
    128 * added: update existing image preload URLs
    129 * added: Lazy Load automatically excludes preloaded images
    130 * fixed: Easy IO skipping Slider Revolution 6 URLs
    131 * fixed: Lazy Load incorrectly auto-scales fixed group background images
    132 
    13386= Earlier versions =
    13487Please refer to the separate changelog.txt file.
  • easy-image-optimizer/trunk/changelog.txt

    r3328397 r3350722  
     1= 4.2.1 =
     2*Release Date - August 26, 2025*
     3
     4* fixed: Some preload URLs not updated
     5
    16= 4.2.0 =
    27*Release Date - July 15, 2025*
  • easy-image-optimizer/trunk/classes/class-exactdn.php

    r3328397 r3350722  
    169169     */
    170170    private $replaced_google_fonts = '';
     171
     172    /**
     173     * Keep track of images that have been replaced with ExactDN URLs.
     174     *
     175     * @access private
     176     * @var array $replaced_images
     177     */
     178    private $replaced_images = array();
    171179
    172180    /**
     
    15741582                        // Replace original tag with modified version.
    15751583                        $content = \str_replace( $tag, $new_tag, $content );
     1584                        // Check through previous replacements to see if the ExactDN URL needs to be updated.
     1585                        foreach ( $this->replaced_images as $replaced_index => $replaced_image ) {
     1586                            if ( $replaced_image['new'] === $src ) {
     1587                                $this->debug_message( "updating replaced image {$replaced_image['new']} with $new_src" );
     1588                                $this->replaced_images[ $replaced_index ]['new'] = $new_src;
     1589                                break;
     1590                            }
     1591                        }
    15761592                    }
    15771593                } elseif ( $lazy && ! empty( $placeholder_src ) && $this->validate_image_url( $placeholder_src ) ) {
     
    16501666        } // End if() -- we found images in the page at all.
    16511667
     1668        // Check our preloads and see if we need to update any of them.
     1669        $content = $this->update_preload_images( $content );
     1670
    16521671        // Process <a> elements in the page for image URLs.
    16531672        $content = $this->filter_image_links( $content );
     
    16761695        $this->filtering_the_content = false;
    16771696
    1678         foreach ( $this->preload_images as $preload_index => $preload_image ) {
     1697        foreach ( $this->preload_images as $preload_image ) {
    16791698            if ( ! empty( $preload_image['found'] ) ) {
    16801699                continue;
     
    16921711        if ( $this->filtering_the_page && $this->get_option( $this->prefix . 'debug' ) && 0 !== \strpos( $content, '{' ) && false === \strpos( '$content', '<loc>' ) ) {
    16931712            $content .= '<!-- Easy IO processing time: ' . $this->elapsed_time . ' seconds -->';
     1713        }
     1714        return $content;
     1715    }
     1716
     1717    /**
     1718     * Add an images to the replaced images list. Checks to see if the image is already in the list.
     1719     *
     1720     * @param string $orig_image The original image URL.
     1721     * @param string $new_image The new image URL.
     1722     */
     1723    public function add_image_to_replacements( $orig_image, $new_image ) {
     1724        if ( ! empty( $orig_image ) && ! empty( $new_image ) && $orig_image !== $new_image ) {
     1725            foreach ( $this->replaced_images as $replaced_image ) {
     1726                if ( $replaced_image['orig'] === $orig_image ) {
     1727                    return;
     1728                }
     1729            }
     1730            $this->replaced_images[] = array(
     1731                'orig' => $orig_image,
     1732                'new'  => $new_image,
     1733            );
     1734        }
     1735    }
     1736
     1737    /**
     1738     * Check the HTML to see if any <link> preload tags need to be updated still.
     1739     *
     1740     * @param string $content The HTML content to parse.
     1741     * @return string The filtered HTML content.
     1742     */
     1743    public function update_preload_images( $content ) {
     1744        $this->debug_message( '<b>' . __METHOD__ . '()</b>' );
     1745        foreach ( $this->preload_images as $index => $preload_image ) {
     1746            if ( empty( $preload_image['found'] ) ) {
     1747                $this->debug_message( "looking for preload image {$preload_image['url']} in replaced image list" );
     1748                foreach ( $this->replaced_images as $replaced_image ) {
     1749                    if ( $replaced_image['orig'] === $preload_image['url'] ) {
     1750                        $this->preload_images[ $index ]['found'] = true;
     1751                        $this->debug_message( "replacing {$preload_image['url']} with {$replaced_image['new']}" );
     1752                        $new_preload_tag = $preload_image['tag'];
     1753                        $this->set_attribute( $new_preload_tag, 'href', \esc_url( $replaced_image['new'] ), true );
     1754                        if ( $preload_image['tag'] !== $new_preload_tag ) {
     1755                            $content = \str_replace( $preload_image['tag'], $new_preload_tag, $content );
     1756                        }
     1757                    }
     1758                }
     1759            }
    16941760        }
    16951761        return $content;
     
    19732039                                    $element = \str_replace( $bg_images[ $bindex ], $bg_image, $element );
    19742040                                }
     2041                                $preload_image = $this->is_image_preloaded( $exactdn_bg_image_url, $bg_image_url );
     2042                                if ( $preload_image ) {
     2043                                    if ( $exactdn_bg_image_url !== $preload_image['url'] ) {
     2044                                        $this->debug_message( "replacing {$preload_image['url']} with $exactdn_bg_image_url" );
     2045                                        $new_preload_tag = $preload_image['tag'];
     2046                                        $this->set_attribute( $new_preload_tag, 'href', \esc_url( $exactdn_bg_image_url ), true );
     2047                                        if ( $preload_image['tag'] !== $new_preload_tag ) {
     2048                                            $content = \str_replace( $preload_image['tag'], $new_preload_tag, $content );
     2049                                        }
     2050                                    }
     2051                                }
    19752052                            }
    19762053                        }
     
    20012078            $prz_thumb = $this->generate_url( $prz_detail_matches[1], \apply_filters( 'exactdn_personalizationdotcom_thumb_args', '', $prz_detail_matches[1] ) );
    20022079            if ( $prz_thumb !== $prz_detail_matches ) {
     2080                $this->add_image_to_replacements( $prz_detail_matches[1], $prz_thumb );
    20032081                $content = \str_replace( "thumbnailUrl:'{$prz_detail_matches[1]}'", "thumbnailUrl:'$prz_thumb'", $content );
    20042082            }
     
    25982676                        $resize_existing = true;
    25992677                    }
    2600                 } else {
     2678                } elseif ( 'full' !== $size ) {
    26012679                    $resize_existing = true;
    26022680                }
     
    26282706                    $intermediate,
    26292707                );
     2708                if ( ! $resize_existing ) {
     2709                    $this->add_image_to_replacements( $image_url, $image[0] );
     2710                }
    26302711            } elseif ( \is_array( $size ) ) {
    26312712                // Pull width and height values from the provided array, if possible.
  • easy-image-optimizer/trunk/easy-image-optimizer.php

    r3328397 r3350722  
    1414Description: Easily speed up your website to better connect with your visitors. Properly compress and size/scale images. Includes lazy load and WebP auto-convert.
    1515Author: Exactly WWW
    16 Version: 4.2.0
     16Version: 4.2.1
    1717Requires at least: 6.6
    1818Requires PHP: 8.1
     
    3030    add_action( 'admin_notices', 'easyio_unsupported_php' );
    3131} elseif ( false === strpos( add_query_arg( '', '' ), 'easyio_disable=1' ) ) {
    32     define( 'EASYIO_VERSION', 420 );
     32    define( 'EASYIO_VERSION', 421 );
    3333
    3434    /**
  • easy-image-optimizer/trunk/readme.txt

    r3328397 r3350722  
    33Tags: image, resize, webp, lazy load, compress
    44Tested up to: 6.8
    5 Stable tag: 4.2.0
     5Stable tag: 4.2.1
    66License: GPLv3
    77
     
    5656* If you would like to help translate this plugin in your language, get started here: https://translate.wordpress.org/projects/wp-plugins/easy-image-optimizer/
    5757
     58= 4.2.1 =
     59*Release Date - August 26, 2025*
     60
     61* fixed: Some preload URLs not updated
     62
    5863= 4.2.0 =
    5964*Release Date - July 15, 2025*
     
    7984* fixed: Easy IO srcset filler using incorrect width for calculations
    8085
    81 = 3.9.4 =
    82 *Release Date - October 31, 2024*
    83 
    84 * fixed: Lazy Load for iframes results in empty src attribute
    85 * fixed: Lazy Load breaks --background CSS variable
    86 
    87 = 3.9.3 =
    88 *Release Date - September 12, 2024*
    89 * fixed: HTML syntax for noscript fall-back when lazy loading picture elements
    90 * fixed: is_file wrapper method triggers PHP warning
    91 * fixed: some strings not properly i18n
    92 
    93 = 3.9.2 =
    94 *Release Date - July 25, 2024*
    95 
    96 * changed: skip lazy load for LCP images based on fetchpriority when auto-scaling is disabled
    97 * changed: improve performance of ewwwio_is_file(), props @rmpel
    98 * changed: require PHP 8.1 or higher
    99 * fixed: Lazy Load and Easy IO fail to decode URLs with HTML-encoded characters, which causes esc_url to break the URL
    100 * fixed: Easy IO fails to update CDN domain if site is re-registered while still active
    101 
    102 = 3.9.1 =
    103 *Release Date - May 29, 2024*
    104 
    105 * added: warning when hiding query strings with Hide My WP
    106 * changed: much better resizing for PNG8 and other paletted PNG images
    107 * changed: apply async loading to lazyload JS using WP core functionality
    108 
    109 = 3.9.0 =
    110 *Release Date - April 23, 2024*
    111 
    112 * added: Easy IO delivery for JS/CSS assets from additional domains
    113 * added: Easy IO support for Divi Pixel image masks
    114 * changed: Lazy Load checks for auto-scale exclusions on ancestors of lazyloaded element
    115 * fixed: Help links broken in Firefox's Strict mode
    116 
    117 = 3.8.0 =
    118 *Release Date - April 11, 2024*
    119 
    120 * added: Lazy Load can use dominant color placeholders via Easy IO
    121 * added: ability to filter/parse admin-ajax.php requests via eio_filter_admin_ajax_response filter
    122 * changed: improved smoothing of LQIP for Lazy Load when using Easy IO
    123 
    124 = 3.7.0 =
    125 *Release Date - March 20, 2024*
    126 
    127 * added: support for upcoming Slider Revolution 7 rendering engine
    128 * added: update existing image preload URLs
    129 * added: Lazy Load automatically excludes preloaded images
    130 * fixed: Easy IO skipping Slider Revolution 6 URLs
    131 * fixed: Lazy Load incorrectly auto-scales fixed group background images
    132 
    13386= Earlier versions =
    13487Please refer to the separate changelog.txt file.
Note: See TracChangeset for help on using the changeset viewer.