Thank you for your reply, you make a lot of sense, and I feel you. Sometimes I too get excited with a new project, starts dev and publish, and then go back to the family routine and forget about it.
Maybe a Github discussion would be better then here…
Conversion method: well, let’s say I got AVIF 100% working but only because of AVIF Support [GrandPlugins] plugin. It adds the well-known AVIF snippet to enable avif, but also a bunch of hooks and filters to call GD or Imagick, as simple as that. When you upload something, it automatically generates all the matching thumbnails in avif format. You still get the same image format thumbnails, that’s WordPress Core. Nothing new under the sun.
The real power in your plugin, as I see it, really, is the .htaccess rules. That’s where the magic happens.
The way I see it, without having you or me re-inventing the wheel, is to simply offer the choice between webp and avif. You cannot offer both, it makes no sense.
- how would you fallback from avif to webp to original, how many htaccess rules will you need?
- if your system accepts webp, it likely also accepts avif
- PHP-Imagick 6.9.11+ supports avif and is likely integrated in most systems
- webp vs avif is a debate I will not start, but webp is pure crap is what I can tell
- only downside of avif is the compute power required to generate them
I think a good chat would be better, to decide the best way to handle this with least amount of effort. Also you have more experience in plugins dev then I do, and already are working on this new plugin converter of yours (not published yet). You should take the lead. I tried renaming all I can in your plugin to get rid of “WebP” in the class/functions/variable names etc but ended up breaking it. Best I could do is alter the “.webp” (webp) and image/webp parts. That’s already a dozen files.
The controversy I think for most people is whether original files should be converted, for the sake of saving a mere 50% of server space. I think the best method is the vary/rewrite rules. Until we can work with avif natively… ALL major browser support avif as of today, including mobiles. I don’t see the point in holding us back.