Enhance image URL handling when the image is from DAM inside the editor#1008
Merged
selul merged 2 commits intodevelopmentfrom Dec 11, 2025
Merged
Enhance image URL handling when the image is from DAM inside the editor#1008selul merged 2 commits intodevelopmentfrom
selul merged 2 commits intodevelopmentfrom
Conversation
- Added logic to extract the original URL from Optimole URLs in the `get_optimized_image_url` method. - Moved the `is_dam_url` method to the `Optml_Dam_Offload_Utils` trait for better organization. - Updated the `Normalizer` trait to handle specific URL patterns. - Introduced new tests for `get_unoptimized_url` to cover various scenarios, including non-Optimole URLs and edge cases. - Prevented cache clearing actions during tests to avoid errors related to cache compatibility. https://secure.helpscout.net/conversation/3142052654/476408?viewId=2353196
Collaborator
Collaborator
|
🎉 This PR is included in version 4.1.5 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements and bug fixes related to DAM (Digital Asset Management) image handling, unoptimized URL extraction, and test coverage. The main focus is on enhancing the reliability and accuracy of image URL normalization and attachment ID resolution for DAM/offloaded images, as well as improving test stability.
DAM/offload image handling and attachment resolution:
is_dam_urlinto theOptml_Dam_Offload_Utilstrait and updating its usage throughout the codebase for better encapsulation and reuse. [1] [2]attachment_url_to_post_idmethod to correctly extract attachment IDs from DAM/offloaded image URLs using a new helper (get_attachement_id_from_optimole_id) that queries the database based on the Optimole ID. [1] [2] [3]Unoptimized URL extraction and normalization:
get_unoptimized_urlmethod to correctly handle uploaded images with/id:patterns, ensuring the original URL is extracted and returned as expected.get_optimized_image_urlto always extract the unoptimized URL before rebuilding the Optimole URL, preventing double-optimization issues.Testing and developer experience:
get_unoptimized_url, covering regular, offloaded, custom domain, and edge case URLs to ensure robust behavior.https://secure.helpscout.net/conversation/3142052654/476408?viewId=2353196