Feature: Add Cloudflare image format setting#24
Open
roboes wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
PhastPress counterpart to kiboit/phast#22, which contains the full context and core logic.
Adds an
img-cloudflare-formatsetting (off/webp/avif) to the WordPress admin panel, allowing users to configure modern image format serving behind Cloudflare. Defaults tooff, preserving existing behaviour.Changes
PluginConfiguration::getDefaultAdminPanelSettings()- adds'img-cloudflare-format' => 'off'.PhastConfiguration::get()andgetForHTMLSnippets()- maps the setting to$phastConfig['images']['cloudflare-image-format'].Translations::DATA- adds UI label, per-option descriptions, and a tip linking to the Cloudflare Vary for Images documentation.Translations::__construct()- fixes PHP 8.1+ deprecation:isset()was called with$this->locale(which isnullbefore assignment) as the array offset; changed to use the$localeparameter instead. No behavior change; compatible with PHP 7.4-8.5.Notes
The PHP side is complete. For the admin panel UI, the Vue source appears to live in a private SDK repo not accessible from the public phast or phastpress repos.
To render the
img-cloudflare-formatsetting as a three-option select (off/webp/avif), a new Vue component would be needed. Two options to consider:img-cloudflare-webpandimg-cloudflare-avif) could replace the single select - this fits the existing UI without any new components.Happy to go either way, but would need guidance or access to the SDK source to proceed with option 1.