WordPress / WordPress/performance

Consider generating fallback JPEG/PNG when a WebP/AVIF is uploaded originally

Open
#2,215 2 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

[Plugin] Modern Image Formats [Type] Enhancement
Dominant language
PHP
Stars
461
Forks
165
Avg merge
11h 12m
Merged PRs (30d)
28

Description

Feature Description

This was raised by @webd-uk in a support forum topic: Open Graph protocol does not support webp.

I thought what was being requested was something that was already implemented (cf. https://github.com/WordPress/performance/issues/2028) where outputting modern image formats is skipped during wp_head for the sake of social providers that don't support them (e.g. Open Graph).

However, the issue is rather if you uploads a WebP or AVIF from the beginning (as WordPress now supports). In this case, the plugin won't need to do anything since a modern image format is the original format. In this case, there's no JPEG/PNG to fall back to render in wp_head.

Perhaps this plugin should support site owners who are already using WebP/AVIF images by generating the JPEG/PNG both for use in wp_head and also for PICTURE element fallbacks.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing handling for modern image formats in wp_head and the PICTURE element fallback behavior. Determine how an originally uploaded WebP or AVIF could produce JPEG/PNG fallbacks for both uses, then verify the behavior with the relevant image and markup tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
performance, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.