Skip to content

tlovett1/dynamic-cloudinary

Repository files navigation

Dynamic Cloundary

Automatically serve all your images optimized from the cloud.

This WordPress plugin proxies all images and videos on a page through Cloudinary. It uses Cloudinary auto-upload functionality so Cloudinary uploads and serves images on the fly. This means you don't have to upload anything to Cloudinary. Everything just works out of the box. Cloudinary also provides a powerful transformation API so you can modify and optimize images on the fly.

Install / Setup

  1. Create a Cloudinary account. Make sure you take name of your Cloud Name. Also, you need to set up your auto upload mapping. This can be done in the Settings > Upload section of your Cloudinary Dashboard. Take close note of the name you give your folder.

Auto mapping Cloudinary 2. Upload and activate the WordPress plugin. Make sure you run composer install. 3. Configure the plugin in the WordPress admin in Settings > Dynamic Cloudinary. For Auto Mapping Folder, I'd provide folder-name from the screenshot above.

Cloudinary API

Cloudinary lets you customize images and video on the fly using their API. Dynamic Cloudinary supports many of these transformations. In order to add a transformation to an image, you can add a data- attribute to the element. For example, to modify the image crop you would add something like data-crop="fill" to the image element. To modify image opacity, you would add something like data-opacity="50" to the image element. Check out the full list of supported transformations:

format
angle
aspect_ratio
background
border
crop
color
dpr
duration
effect
end_offset
flags
height
overlay
opacity
quality
radius
start_offset
named_transformation
underlay
video_codec
width
x
y
zoom
audio_codec
audio_frequency
bit_rate
color_space
default_image
delay
density
fetch_format
gravity
prefix
page
video_sampling
progressive

You can also add data-transformations-string to any image or source element for manually specifying the transformation string.

Known Issues

  • Any HTML entities inside of an image or source element will prevent this plugin from replacing the URL e.g. having & in an alt tag.

Issues

If you identify any errors or have an idea for improving the plugin, please open an issue.

License

Dynamic Cloudinary is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

About

Automatically serve all your images optimized from the cloud.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages