Changeset 3350722
- Timestamp:
- 08/26/2025 10:12:55 PM (5 months ago)
- Location:
- easy-image-optimizer
- Files:
-
- 8 edited
- 1 copied
-
tags/4.2.1 (copied) (copied from easy-image-optimizer/trunk)
-
tags/4.2.1/changelog.txt (modified) (1 diff)
-
tags/4.2.1/classes/class-exactdn.php (modified) (9 diffs)
-
tags/4.2.1/easy-image-optimizer.php (modified) (2 diffs)
-
tags/4.2.1/readme.txt (modified) (3 diffs)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/classes/class-exactdn.php (modified) (9 diffs)
-
trunk/easy-image-optimizer.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
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 1 6 = 4.2.0 = 2 7 *Release Date - July 15, 2025* -
easy-image-optimizer/tags/4.2.1/classes/class-exactdn.php
r3328397 r3350722 169 169 */ 170 170 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(); 171 179 172 180 /** … … 1574 1582 // Replace original tag with modified version. 1575 1583 $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 } 1576 1592 } 1577 1593 } elseif ( $lazy && ! empty( $placeholder_src ) && $this->validate_image_url( $placeholder_src ) ) { … … 1650 1666 } // End if() -- we found images in the page at all. 1651 1667 1668 // Check our preloads and see if we need to update any of them. 1669 $content = $this->update_preload_images( $content ); 1670 1652 1671 // Process <a> elements in the page for image URLs. 1653 1672 $content = $this->filter_image_links( $content ); … … 1676 1695 $this->filtering_the_content = false; 1677 1696 1678 foreach ( $this->preload_images as $preload_i ndex => $preload_image ) {1697 foreach ( $this->preload_images as $preload_image ) { 1679 1698 if ( ! empty( $preload_image['found'] ) ) { 1680 1699 continue; … … 1692 1711 if ( $this->filtering_the_page && $this->get_option( $this->prefix . 'debug' ) && 0 !== \strpos( $content, '{' ) && false === \strpos( '$content', '<loc>' ) ) { 1693 1712 $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 } 1694 1760 } 1695 1761 return $content; … … 1973 2039 $element = \str_replace( $bg_images[ $bindex ], $bg_image, $element ); 1974 2040 } 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 } 1975 2052 } 1976 2053 } … … 2001 2078 $prz_thumb = $this->generate_url( $prz_detail_matches[1], \apply_filters( 'exactdn_personalizationdotcom_thumb_args', '', $prz_detail_matches[1] ) ); 2002 2079 if ( $prz_thumb !== $prz_detail_matches ) { 2080 $this->add_image_to_replacements( $prz_detail_matches[1], $prz_thumb ); 2003 2081 $content = \str_replace( "thumbnailUrl:'{$prz_detail_matches[1]}'", "thumbnailUrl:'$prz_thumb'", $content ); 2004 2082 } … … 2598 2676 $resize_existing = true; 2599 2677 } 2600 } else {2678 } elseif ( 'full' !== $size ) { 2601 2679 $resize_existing = true; 2602 2680 } … … 2628 2706 $intermediate, 2629 2707 ); 2708 if ( ! $resize_existing ) { 2709 $this->add_image_to_replacements( $image_url, $image[0] ); 2710 } 2630 2711 } elseif ( \is_array( $size ) ) { 2631 2712 // Pull width and height values from the provided array, if possible. -
easy-image-optimizer/tags/4.2.1/easy-image-optimizer.php
r3328397 r3350722 14 14 Description: Easily speed up your website to better connect with your visitors. Properly compress and size/scale images. Includes lazy load and WebP auto-convert. 15 15 Author: Exactly WWW 16 Version: 4.2. 016 Version: 4.2.1 17 17 Requires at least: 6.6 18 18 Requires PHP: 8.1 … … 30 30 add_action( 'admin_notices', 'easyio_unsupported_php' ); 31 31 } elseif ( false === strpos( add_query_arg( '', '' ), 'easyio_disable=1' ) ) { 32 define( 'EASYIO_VERSION', 42 0);32 define( 'EASYIO_VERSION', 421 ); 33 33 34 34 /** -
easy-image-optimizer/tags/4.2.1/readme.txt
r3328397 r3350722 3 3 Tags: image, resize, webp, lazy load, compress 4 4 Tested up to: 6.8 5 Stable tag: 4.2. 05 Stable tag: 4.2.1 6 6 License: GPLv3 7 7 … … 56 56 * 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/ 57 57 58 = 4.2.1 = 59 *Release Date - August 26, 2025* 60 61 * fixed: Some preload URLs not updated 62 58 63 = 4.2.0 = 59 64 *Release Date - July 15, 2025* … … 79 84 * fixed: Easy IO srcset filler using incorrect width for calculations 80 85 81 = 3.9.4 =82 *Release Date - October 31, 2024*83 84 * fixed: Lazy Load for iframes results in empty src attribute85 * fixed: Lazy Load breaks --background CSS variable86 87 = 3.9.3 =88 *Release Date - September 12, 2024*89 * fixed: HTML syntax for noscript fall-back when lazy loading picture elements90 * fixed: is_file wrapper method triggers PHP warning91 * fixed: some strings not properly i18n92 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 disabled97 * changed: improve performance of ewwwio_is_file(), props @rmpel98 * changed: require PHP 8.1 or higher99 * fixed: Lazy Load and Easy IO fail to decode URLs with HTML-encoded characters, which causes esc_url to break the URL100 * fixed: Easy IO fails to update CDN domain if site is re-registered while still active101 102 = 3.9.1 =103 *Release Date - May 29, 2024*104 105 * added: warning when hiding query strings with Hide My WP106 * changed: much better resizing for PNG8 and other paletted PNG images107 * changed: apply async loading to lazyload JS using WP core functionality108 109 = 3.9.0 =110 *Release Date - April 23, 2024*111 112 * added: Easy IO delivery for JS/CSS assets from additional domains113 * added: Easy IO support for Divi Pixel image masks114 * changed: Lazy Load checks for auto-scale exclusions on ancestors of lazyloaded element115 * fixed: Help links broken in Firefox's Strict mode116 117 = 3.8.0 =118 *Release Date - April 11, 2024*119 120 * added: Lazy Load can use dominant color placeholders via Easy IO121 * added: ability to filter/parse admin-ajax.php requests via eio_filter_admin_ajax_response filter122 * changed: improved smoothing of LQIP for Lazy Load when using Easy IO123 124 = 3.7.0 =125 *Release Date - March 20, 2024*126 127 * added: support for upcoming Slider Revolution 7 rendering engine128 * added: update existing image preload URLs129 * added: Lazy Load automatically excludes preloaded images130 * fixed: Easy IO skipping Slider Revolution 6 URLs131 * fixed: Lazy Load incorrectly auto-scales fixed group background images132 133 86 = Earlier versions = 134 87 Please 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 1 6 = 4.2.0 = 2 7 *Release Date - July 15, 2025* -
easy-image-optimizer/trunk/classes/class-exactdn.php
r3328397 r3350722 169 169 */ 170 170 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(); 171 179 172 180 /** … … 1574 1582 // Replace original tag with modified version. 1575 1583 $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 } 1576 1592 } 1577 1593 } elseif ( $lazy && ! empty( $placeholder_src ) && $this->validate_image_url( $placeholder_src ) ) { … … 1650 1666 } // End if() -- we found images in the page at all. 1651 1667 1668 // Check our preloads and see if we need to update any of them. 1669 $content = $this->update_preload_images( $content ); 1670 1652 1671 // Process <a> elements in the page for image URLs. 1653 1672 $content = $this->filter_image_links( $content ); … … 1676 1695 $this->filtering_the_content = false; 1677 1696 1678 foreach ( $this->preload_images as $preload_i ndex => $preload_image ) {1697 foreach ( $this->preload_images as $preload_image ) { 1679 1698 if ( ! empty( $preload_image['found'] ) ) { 1680 1699 continue; … … 1692 1711 if ( $this->filtering_the_page && $this->get_option( $this->prefix . 'debug' ) && 0 !== \strpos( $content, '{' ) && false === \strpos( '$content', '<loc>' ) ) { 1693 1712 $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 } 1694 1760 } 1695 1761 return $content; … … 1973 2039 $element = \str_replace( $bg_images[ $bindex ], $bg_image, $element ); 1974 2040 } 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 } 1975 2052 } 1976 2053 } … … 2001 2078 $prz_thumb = $this->generate_url( $prz_detail_matches[1], \apply_filters( 'exactdn_personalizationdotcom_thumb_args', '', $prz_detail_matches[1] ) ); 2002 2079 if ( $prz_thumb !== $prz_detail_matches ) { 2080 $this->add_image_to_replacements( $prz_detail_matches[1], $prz_thumb ); 2003 2081 $content = \str_replace( "thumbnailUrl:'{$prz_detail_matches[1]}'", "thumbnailUrl:'$prz_thumb'", $content ); 2004 2082 } … … 2598 2676 $resize_existing = true; 2599 2677 } 2600 } else {2678 } elseif ( 'full' !== $size ) { 2601 2679 $resize_existing = true; 2602 2680 } … … 2628 2706 $intermediate, 2629 2707 ); 2708 if ( ! $resize_existing ) { 2709 $this->add_image_to_replacements( $image_url, $image[0] ); 2710 } 2630 2711 } elseif ( \is_array( $size ) ) { 2631 2712 // Pull width and height values from the provided array, if possible. -
easy-image-optimizer/trunk/easy-image-optimizer.php
r3328397 r3350722 14 14 Description: Easily speed up your website to better connect with your visitors. Properly compress and size/scale images. Includes lazy load and WebP auto-convert. 15 15 Author: Exactly WWW 16 Version: 4.2. 016 Version: 4.2.1 17 17 Requires at least: 6.6 18 18 Requires PHP: 8.1 … … 30 30 add_action( 'admin_notices', 'easyio_unsupported_php' ); 31 31 } elseif ( false === strpos( add_query_arg( '', '' ), 'easyio_disable=1' ) ) { 32 define( 'EASYIO_VERSION', 42 0);32 define( 'EASYIO_VERSION', 421 ); 33 33 34 34 /** -
easy-image-optimizer/trunk/readme.txt
r3328397 r3350722 3 3 Tags: image, resize, webp, lazy load, compress 4 4 Tested up to: 6.8 5 Stable tag: 4.2. 05 Stable tag: 4.2.1 6 6 License: GPLv3 7 7 … … 56 56 * 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/ 57 57 58 = 4.2.1 = 59 *Release Date - August 26, 2025* 60 61 * fixed: Some preload URLs not updated 62 58 63 = 4.2.0 = 59 64 *Release Date - July 15, 2025* … … 79 84 * fixed: Easy IO srcset filler using incorrect width for calculations 80 85 81 = 3.9.4 =82 *Release Date - October 31, 2024*83 84 * fixed: Lazy Load for iframes results in empty src attribute85 * fixed: Lazy Load breaks --background CSS variable86 87 = 3.9.3 =88 *Release Date - September 12, 2024*89 * fixed: HTML syntax for noscript fall-back when lazy loading picture elements90 * fixed: is_file wrapper method triggers PHP warning91 * fixed: some strings not properly i18n92 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 disabled97 * changed: improve performance of ewwwio_is_file(), props @rmpel98 * changed: require PHP 8.1 or higher99 * fixed: Lazy Load and Easy IO fail to decode URLs with HTML-encoded characters, which causes esc_url to break the URL100 * fixed: Easy IO fails to update CDN domain if site is re-registered while still active101 102 = 3.9.1 =103 *Release Date - May 29, 2024*104 105 * added: warning when hiding query strings with Hide My WP106 * changed: much better resizing for PNG8 and other paletted PNG images107 * changed: apply async loading to lazyload JS using WP core functionality108 109 = 3.9.0 =110 *Release Date - April 23, 2024*111 112 * added: Easy IO delivery for JS/CSS assets from additional domains113 * added: Easy IO support for Divi Pixel image masks114 * changed: Lazy Load checks for auto-scale exclusions on ancestors of lazyloaded element115 * fixed: Help links broken in Firefox's Strict mode116 117 = 3.8.0 =118 *Release Date - April 11, 2024*119 120 * added: Lazy Load can use dominant color placeholders via Easy IO121 * added: ability to filter/parse admin-ajax.php requests via eio_filter_admin_ajax_response filter122 * changed: improved smoothing of LQIP for Lazy Load when using Easy IO123 124 = 3.7.0 =125 *Release Date - March 20, 2024*126 127 * added: support for upcoming Slider Revolution 7 rendering engine128 * added: update existing image preload URLs129 * added: Lazy Load automatically excludes preloaded images130 * fixed: Easy IO skipping Slider Revolution 6 URLs131 * fixed: Lazy Load incorrectly auto-scales fixed group background images132 133 86 = Earlier versions = 134 87 Please refer to the separate changelog.txt file.
Note: See TracChangeset
for help on using the changeset viewer.