Changeset 3240146
- Timestamp:
- 02/13/2025 01:45:45 PM (11 months ago)
- Location:
- edge-images
- Files:
-
- 66 added
- 4 edited
-
tags/5.3.3 (added)
-
tags/5.3.3/assets (added)
-
tags/5.3.3/assets/css (added)
-
tags/5.3.3/assets/css/admin-front.css (added)
-
tags/5.3.3/assets/css/admin-front.less (added)
-
tags/5.3.3/assets/css/admin.less (added)
-
tags/5.3.3/assets/css/admin.min.css (added)
-
tags/5.3.3/assets/css/images.less (added)
-
tags/5.3.3/assets/css/images.min.css (added)
-
tags/5.3.3/assets/js (added)
-
tags/5.3.3/assets/js/admin.js (added)
-
tags/5.3.3/assets/js/admin.min.js (added)
-
tags/5.3.3/assets/js/main.js (added)
-
tags/5.3.3/assets/js/main.min.js (added)
-
tags/5.3.3/autoload.php (added)
-
tags/5.3.3/classes (added)
-
tags/5.3.3/classes/blocks (added)
-
tags/5.3.3/classes/blocks/class-gallery.php (added)
-
tags/5.3.3/classes/blocks/class-image.php (added)
-
tags/5.3.3/classes/class-activation.php (added)
-
tags/5.3.3/classes/class-admin-page.php (added)
-
tags/5.3.3/classes/class-block.php (added)
-
tags/5.3.3/classes/class-blocks.php (added)
-
tags/5.3.3/classes/class-content-transformer.php (added)
-
tags/5.3.3/classes/class-edge-provider.php (added)
-
tags/5.3.3/classes/class-features.php (added)
-
tags/5.3.3/classes/class-handler.php (added)
-
tags/5.3.3/classes/class-helpers.php (added)
-
tags/5.3.3/classes/class-image-dimensions.php (added)
-
tags/5.3.3/classes/class-images.php (added)
-
tags/5.3.3/classes/class-integration.php (added)
-
tags/5.3.3/classes/class-integrations.php (added)
-
tags/5.3.3/classes/class-providers.php (added)
-
tags/5.3.3/classes/class-settings.php (added)
-
tags/5.3.3/classes/class-srcset-transformer.php (added)
-
tags/5.3.3/classes/edge-providers (added)
-
tags/5.3.3/classes/edge-providers/class-accelerated-domains.php (added)
-
tags/5.3.3/classes/edge-providers/class-bunny.php (added)
-
tags/5.3.3/classes/edge-providers/class-cloudflare.php (added)
-
tags/5.3.3/classes/edge-providers/class-imgix.php (added)
-
tags/5.3.3/classes/edge-providers/class-none.php (added)
-
tags/5.3.3/classes/features (added)
-
tags/5.3.3/classes/features/class-avatars.php (added)
-
tags/5.3.3/classes/features/class-cache.php (added)
-
tags/5.3.3/classes/features/class-htaccess-cache.php (added)
-
tags/5.3.3/classes/features/class-picture.php (added)
-
tags/5.3.3/classes/integrations (added)
-
tags/5.3.3/classes/integrations/bricks (added)
-
tags/5.3.3/classes/integrations/bricks/class-bricks.php (added)
-
tags/5.3.3/classes/integrations/enable-media-replace (added)
-
tags/5.3.3/classes/integrations/enable-media-replace/class-enable-media-replace.php (added)
-
tags/5.3.3/classes/integrations/rank-math (added)
-
tags/5.3.3/classes/integrations/rank-math/class-schema-images.php (added)
-
tags/5.3.3/classes/integrations/rank-math/class-social-images.php (added)
-
tags/5.3.3/classes/integrations/rank-math/class-xml-sitemaps.php (added)
-
tags/5.3.3/classes/integrations/relevanssi (added)
-
tags/5.3.3/classes/integrations/relevanssi/class-live-ajax-search.php (added)
-
tags/5.3.3/classes/integrations/yoast-seo (added)
-
tags/5.3.3/classes/integrations/yoast-seo/class-schema-images.php (added)
-
tags/5.3.3/classes/integrations/yoast-seo/class-social-images.php (added)
-
tags/5.3.3/classes/integrations/yoast-seo/class-xml-sitemaps.php (added)
-
tags/5.3.3/edge-images.php (added)
-
tags/5.3.3/languages (added)
-
tags/5.3.3/readme.md (added)
-
tags/5.3.3/readme.txt (added)
-
tags/5.3.3/uninstall.php (added)
-
trunk/classes/class-handler.php (modified) (1 diff)
-
trunk/classes/class-helpers.php (modified) (2 diffs)
-
trunk/edge-images.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
edge-images/trunk/classes/class-handler.php
r3240034 r3240146 487 487 } 488 488 489 // Check if this is an SVG 490 if (Helpers::is_svg($src)) { 491 /** 492 * Filter whether to enforce dimensions for SVG images. 493 * 494 * @since 5.2.14 495 * 496 * @param bool $enforce_dimensions Whether to enforce dimensions. 497 * @param string $image_html The image HTML. 498 * @param string $context The context. 499 */ 500 $enforce_dimensions = apply_filters('edge_images_enforce_svg_dimensions', true, $image_html, $context); 501 502 if ($enforce_dimensions) { 503 $dimensions = Image_Dimensions::get($processor, $attachment_id); 504 if ($dimensions) { 505 $processor->set_attribute('width', $dimensions['width']); 506 $processor->set_attribute('height', $dimensions['height']); 507 $processor->set_attribute('class', trim($processor->get_attribute('class') . ' edge-images-processed')); 508 return $processor->get_updated_html(); 509 } 510 } 489 // Skip if it's a non-transformable format 490 if (Helpers::is_non_transformable_format($src)) { 511 491 return $image_html; 512 492 } -
edge-images/trunk/classes/class-helpers.php
r3240119 r3240146 135 135 public static function edge_src(string $src, array $args): string { 136 136 137 // Skip non-transformable formats 137 // Skip non-transformable formats (empty URLs, data: URLs, SVG, AVIF) 138 138 if (self::is_non_transformable_format($src)) { 139 139 return $src; … … 261 261 * Determines if an image format should not be transformed. 262 262 * 263 * Checks if the image is in a format that should never be transformed, 264 * such as SVG or AVIF, as these are already optimized formats. 265 * 266 * @since 5.3.0 267 * 268 * @param string $src The image src value. 263 * Checks if the image URL is: 264 * - Empty 265 * - A data: URL 266 * - An SVG file 267 * - An AVIF file 268 * - Not a string 269 * - Doesn't begin with 'http' or '//' 270 * 271 * These formats should never be transformed as they are either 272 * already optimized or cannot/should not be processed. 273 * 274 * @since 5.3.0 275 * 276 * @param string|null $src The image src value. 269 277 * @return bool Whether the image format should not be transformed. 270 278 */ 271 public static function is_non_transformable_format( string $src ): bool { 272 return self::is_svg($src) || self::is_avif($src); 279 public static function is_non_transformable_format( ?string $src ): bool { 280 281 // Skip empty URLs 282 if (empty($src)) { 283 return true; 284 } 285 286 // Skip data URLs 287 if (strpos($src, 'data:') === 0) { 288 return true; 289 } 290 291 // Skip if the $src isn't a string. 292 if (!is_string($src)) { 293 return true; 294 } 295 296 // Skip if the $src doesn't begin with 'http' or '//' 297 if (strpos($src, 'http') !== 0 && strpos($src, '//') !== 0) { 298 return true; 299 } 300 301 // Skip if it's an SVG or AVIF file 302 if (self::is_svg($src) || self::is_avif($src)) { 303 return true; 304 } 305 306 // If we've made it this far, the URL is transformable 307 return false; 273 308 } 274 309 -
edge-images/trunk/edge-images.php
r3240119 r3240146 8 8 * @link https://github.com/jonoalderson/edge-images/ 9 9 * @since 1.0.0 10 * @version 5.3. 210 * @version 5.3.3 11 11 * 12 12 * @wordpress-plugin … … 14 14 * Plugin URI: https://github.com/jonoalderson/edge-images/ 15 15 * Description: Routes images through edge providers (like Cloudflare or Accelerated Domains) for automatic optimization and transformation. Improves page speed and image loading performance. 16 * Version: 5.3. 216 * Version: 5.3.3 17 17 * Requires PHP: 7.4 18 18 * Requires at least: 5.6 … … 34 34 35 35 // Define plugin constants. 36 define( 'EDGE_IMAGES_VERSION', '5.3. 2' );36 define( 'EDGE_IMAGES_VERSION', '5.3.3' ); 37 37 define( 'EDGE_IMAGES_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 38 38 define( 'EDGE_IMAGES_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); -
edge-images/trunk/readme.txt
r3240119 r3240146 4 4 Tested up to: 6.7 5 5 Requires PHP: 7.4 6 Stable tag: 5.3. 26 Stable tag: 5.3.3 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 253 253 == Changelog == 254 254 255 = 5.3. 2( 13/02/2025 ) =255 = 5.3.3 ( 13/02/2025 ) = 256 256 * BUGFIX: Tweaked the Bricks integration to improve SVG handling. 257 257
Note: See TracChangeset
for help on using the changeset viewer.