manifest / performance / wp-cloudflare-image-resizer
WordPress Cloudflare Image Resizer
Cloudflare Image Resizer with full page buffering/replacement.
★ 0stars
Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/midweste/wp-cloudflare-image-resizer/archive/refs/heads/main.zipUpdates itself. It ships its own updater (Update URI header), so new versions appear under Dashboard → Updates.
Wordpress Cloudflare Image Resizer
Rewrites the image src of images, srcsets, and other images to use Cloudflares Image Resizing (https://developers.cloudflare.com/images/transform-images/transform-via-url/).
To Install
As a normal plugin
- Unzip and add to the plugins folder, activate
Configuration
By default, the settings are below and available via filter cloudflareimageresizesettings. Most settings are covered on https://developers.cloudflare.com/images/transform-images/transform-via-url/#options
Filters
applyfilters('cloudflareimageresizesettings', $settings)
Array. This filter allows you to change default settings.
applyfilters('cloudflareimageresizeexclude', false)
Boolean. This filter will allow you to add custom logic to exclude or prevent image src rewriting.
applyfilters('cloudflareimageresizeshutdownhtml', $final)
String. This filter will allow you to modify or change full page html buffering
Actions
applyfilters('cloudflareimageresizemaxsizeexceeded', $settings, $imagepath, $width, $height, \$\SERVER['REQUESTURI'])
This action allows for action to be taken when the max width of an image is exceeded.