manifest / performance / wp-cloudflare-image-resizer
WordPress Cloudflare Image Resizer
Cloudflare Image Resizer with full page buffering/replacement.
by Midweste · github.com/midweste/wp-cloudflare-image-resizer · website
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/midweste/wp-cloudflare-image-resizer/archive/refs/heads/main.zipDeclares an update source (https://api.github.com/repos/midweste/wp-cloudflare-image-resizer/commits/main), so updates arrive through the plugin's own updater.
From the readme
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.