Improved SVG metadata generation - #3022
Open
girishpanchal30 wants to merge 2 commits into
Open
Conversation
Contributor
Bundle Size Diff
|
Contributor
|
Plugin build for 16f03f2 is ready 🛎️!
|
Contributor
E2E TestsPlaywright Test Status: See serial and parallel matrix jobs Performance ResultsserverResponse: {"q25":539.59,"q50":549.47,"q75":571.73,"cnt":10}, firstPaint: {"q25":1601.18,"q50":2014.12,"q75":2360.72,"cnt":10}, domContentLoaded: {"q25":4425.02,"q50":4465.18,"q75":4498.11,"cnt":10}, loaded: {"q25":4429.05,"q50":4469.12,"q75":4501.85,"cnt":10}, firstContentfulPaint: {"q25":3320.9,"q50":3357.16,"q75":3368.64,"cnt":10}, firstBlock: {"q25":20572.17,"q50":20744.88,"q75":21679.15,"cnt":10}, type: {"q25":36.52,"q50":40.57,"q75":44.14,"cnt":10}, typeWithoutInspector: {"q25":31.08,"q50":35.35,"q75":39.89,"cnt":10}, typeWithTopToolbar: {"q25":42.93,"q50":47.36,"q75":53.17,"cnt":10}, typeContainer: {"q25":20.51,"q50":21.46,"q75":23.48,"cnt":10}, focus: {"q25":178.18,"q50":181.49,"q75":185.51,"cnt":10}, inserterOpen: {"q25":54.19,"q50":62.6,"q75":65.32,"cnt":10}, inserterSearch: {"q25":33.7,"q50":36.79,"q75":38.21,"cnt":10}, inserterHover: {"q25":5.86,"q50":6.31,"q75":6.95,"cnt":20}, loadPatterns: {"q25":2264.38,"q50":2307.69,"q75":2453.45,"cnt":10}, listViewOpen: {"q25":296.18,"q50":300.68,"q75":312.31,"cnt":10} |
Contributor
There was a problem hiding this comment.
Pull request overview
Improves SVG attachment metadata generation by safely handling invalid files and parser failures.
Changes:
- Adds guards for missing, unreadable, malformed, or dimensionless SVGs.
- Adds unit tests for failure and success paths.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
inc/class-main.php |
Adds safe SVG validation and parsing. |
tests/test-svg-upload.php |
Tests SVG metadata edge cases. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
selul
approved these changes
Sep 1, 2026
Soare-Robert-Daniel
approved these changes
Sep 1, 2026
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.
Closes #2967
Summary
Handled the SVG attachment metadata generation by adding comprehensive error handling for various edge cases.
Checklist before the final review