This package can be used with WordPress 5.8 and forward, due to WebP support being introduced. This package enables servers to directly process and convert JPEG or PNG files on upload as well as bulk and single image conversions via WP CLI.
This package is installed using Composer.
Run composer require eleven-miles/iris
to install.
Use wp iris
to run a full media library conversion. This will run through all JPG and PNG attachments and convert them to webp. This process uses Action Scheduler to queue up each conversion and wait until each is complete to progress.
Use wp iris-id $id
to run a single image conversion. This command takes an attachment ID as an argument and then runs a webp conversion on the single image.
Iris requires the two following plugins to be installed and activated.
Iris uses Action Scheduler to run webp convertion at scheduled intervals. This functionality helps when converting media libraies, and when images are uploaded in bulk. The GD image processing can have memory issues when bulk uploading images and return failed conversion. Action Scheduler helps to ensure that all images are converted by queuing up the conversions.
Iris uses Offload Media to store converted images in the cloud. During the Iris process the following Offload method - Media_Library_Item::get_by_source_id
- is used to check if the attachement exists in the relevant storage system (eg AWS S3 bucket).
For debugging: Debug::debug($image_meta);