safe-svg
safe-svg copied to clipboard
SVGO Optimisation
Is your enhancement related to a problem? Please describe.
Port in from Pro version
Designs
No response
Describe alternatives you've considered
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
@jeffpaul the pro plugin uses svgo.wpsvg.com to check for a valid license (here) and send the svg file to their server to optimize. To avoid sending to another server, another approach is to use SVGO, which seems to be the tool that the pro plugin uses anyway.
A Draft PR has been added here: https://github.com/10up/safe-svg/pull/79 and the results are promising. Currently, the optimization works for files uploaded via the Media Library, but not yet when uploaded directly (hence the "draft" status of the PR).
@gsarig would be good to note on the PR if you're hoping to handle the direct upload work in the PR or if you'd prefer someone else to help finish that and bring the PR out of draft?
@jeffpaul I've updated the PR, mentioning that I will resume my work with the first chance, to handle direct uploads as well.
@jeffpaul As promised, PR has been updated with support for optimizing direct uploads.