safe-svg icon indicating copy to clipboard operation
safe-svg copied to clipboard

SVGO Optimisation

Open jeffpaul opened this issue 2 years ago • 3 comments

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 avatar Jun 30 '22 21:06 jeffpaul

@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 avatar Oct 09 '22 21:10 gsarig

@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 avatar Oct 10 '22 14:10 jeffpaul

@jeffpaul I've updated the PR, mentioning that I will resume my work with the first chance, to handle direct uploads as well.

gsarig avatar Oct 10 '22 17:10 gsarig

@jeffpaul As promised, PR has been updated with support for optimizing direct uploads.

gsarig avatar Oct 16 '22 20:10 gsarig