-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimise already uploaded SVG images #81
Comments
I have done a bit of initial investigation here, but I have been unable to find a viable path for leveraging the same SVGO library added in #79 through a WP php hook that is triggered on batch image regeneration. The only way I could see this working would be a cli command that installs and runs npm packages to the local filesystem. However, this is not a feasible option for most web hosts. I think the only viable options here would be: |
@darylldoyle any thoughts on how to handle this based on the research findings above? |
@jeffpaul unfortunately not. This was initially part of the "pro" package for this reason. It was hard/hacky to do on the server, so I offloaded it to a specific SVGO server I was running to do the compression and then push it back. Something similar could be done here with the option for people to use their own server? I'm not sure how that sits with the OSP though. |
@csloisel @darylldoyle are there any known, reliable SVGO servers that we could consider integrating with and allow plugin users to select their preference (and potentially include whatever auth credentials are needed for those services via plugin settings)? |
@jeffpaul not that I'm aware of. This is what I was hoping for when I originally made the pro plugin. There's a lack of SVGO services (SVGOAAS?). I've found the following services that say they support SVG optimisation via API, that could be worth looking into: The only other option I could see is for 10up to host one, though that'd likely need a larger conversation around what that entails. |
https://github.com/vector-express/vectorexpress-api#convertor-svgo looks like it might be an option perhaps? |
Is your enhancement related to a problem? Please describe.
Optimize existing SVGs when someone triggers a batch regenerate of images, with WP-CLI or a third-party plugin. That way we wouldn't have to build a settings page for that, or a specific mechanism from scratch and the implementation should be quicker.
The challenge with the optimizer is that being a JS tool, it cannot utilize the standard PHP hooks so it would take some testing/investigation to see how this could best work.
For more context refer: #79
Designs
No response
Describe alternatives you've considered
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: