All Projects → junaidbhura → auto-cloudinary

junaidbhura / auto-cloudinary

Licence: MIT license
Super simple Cloudinary auto-upload implementation for WordPress.

Programming Languages

PHP
23972 projects - #3 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to auto-cloudinary

uploadcare-ios
UploadcareKit: iOS SDK for Uploadcare API
Stars: ✭ 24 (-29.41%)
Mutual labels:  cdn, image-manipulation, image-optimization
imagekit-angular
Angular SDK for ImageKit.io client side file upload and URL generation
Stars: ✭ 16 (-52.94%)
Mutual labels:  image-manipulation, image-optimization
Cloudinary npm
Cloudinary NPM for node.js integration
Stars: ✭ 450 (+1223.53%)
Mutual labels:  cdn, image-manipulation
imagekit-python
ImageKit.io Python SDK
Stars: ✭ 27 (-20.59%)
Mutual labels:  image-manipulation, image-optimization
Image Resizer
On-the-fly image resizing using Node.js and libvips. Heroku Ready!
Stars: ✭ 59 (+73.53%)
Mutual labels:  cdn, image-optimization
Cdn
CDN is a Just-in-time asset manipulation and delivery application, providing a complete content distribution/delivery solution
Stars: ✭ 192 (+464.71%)
Mutual labels:  cdn, image-manipulation
Imgp
📸 High-performance cli batch image resizer and rotator
Stars: ✭ 744 (+2088.24%)
Mutual labels:  image-manipulation, image-optimization
imagekit-php
PHP SDK for ImageKit.io API.
Stars: ✭ 34 (+0%)
Mutual labels:  image-manipulation, image-optimization
imagekit-javascript
Javascript SDK for using ImageKit.io
Stars: ✭ 43 (+26.47%)
Mutual labels:  image-manipulation, image-optimization
plugin-intellij
jsDelivr plugin for JetBrains IntelliJ based editors
Stars: ✭ 18 (-47.06%)
Mutual labels:  cdn
node-version-assets
Version your static assets with MD5 hashes using node.js
Stars: ✭ 65 (+91.18%)
Mutual labels:  cdn
go-fastly-cli
CLI tool for interacting with Fastly CDN services via official REST API.
Stars: ✭ 14 (-58.82%)
Mutual labels:  cdn
create-optimize-images
♻️ Reusable, scalable, bash scripts to create and optimize images.
Stars: ✭ 39 (+14.71%)
Mutual labels:  image-optimization
cdnupload
Upload your site's static files to a directory or CDN, using content-based hashing
Stars: ✭ 41 (+20.59%)
Mutual labels:  cdn
2dimagefilter
A collection of image filters, some especially suited to scale-up low res computer graphics.
Stars: ✭ 32 (-5.88%)
Mutual labels:  image-manipulation
kap-cloudinary
Kap plugin - Share on Cloudinary
Stars: ✭ 14 (-58.82%)
Mutual labels:  cloudinary
media-delivery
This collection of samples demonstrates best practices to achieve optimal video quality and performance on Intel GPUs for content delivery networks. Check out our demo, recommended command lines and quality and performance measuring tools.
Stars: ✭ 26 (-23.53%)
Mutual labels:  cdn
apollo-instagram-clone
Apollogram | A place where you could share photos, like media, and follow peoples.
Stars: ✭ 24 (-29.41%)
Mutual labels:  cloudinary
sic
🦜 Accessible image processing and conversion from the terminal. Front-end for image-rs/image.
Stars: ✭ 96 (+182.35%)
Mutual labels:  image-manipulation
cloudinary-microurl
A tiny (346B), 0 dependency, fully-tested Cloudinary URL generator for JS
Stars: ✭ 14 (-58.82%)
Mutual labels:  cloudinary

Cloudinary Auto-Upload for WordPress

GitHub Actions

Download the WP Plugin

This plugin provides a super simple Cloudinary auto-upload implementation for WordPress.

It is inspired by Photon and Tachyon.

Cloudinary will automatically fetch and serve the images from your media library like a CDN, without you having to worry about the complicated upload API! Just set up auto-upload in your Cloudinary settings, enter the details in the plugin's options, and you're all set!

Easy peasy 😎

Important

This plugin is incompatible with the official Cloudinary plugin. You'd need to disable that plugin first before using this one.

Quick Links

Setup | Issues | Functions | Filters | Best Practices

Why did you build this plugin?

There already is an official Cloudinary plugin available. But in my opinion, it's a bit of an overkill and takes over the admin UI. This plugin aims to be:

  • Super simple and light-weight
  • Totally seamless and out of the way
  • A flexible tool for WordPress developers

What is Cloudinary Auto-Upload?

Cloudinary gives you two options to upload files to it's servers:

  1. The complicated Upload API 😱
  2. The super easy and magical Fetch API 🎩

Upload API

TL;DR: Too complicated and in the way 👎

Cloudinary gives you an API, using which, you can manually upload the images to Cloudinary. So you'd need an API key, etc. The official plugin uses this method. When you upload an image to the media library, it in turn, uploads it to Cloudinary. This could be a problem if you have thousands of existing images, and might not be flexible enough to support custom architecture.

Fetch API

TL;DR: Magical 👍

This plugin uses the super easy Auto-Upload feature in the Fetch API. We just tell Cloudinary where to find the files on our server (or on S3 or anywhere on the Internet), and it automatically downloads it from there and saves it on to it's servers the first time you ask for it, like a CDN would!

What does this plugin do?

This plugin does two main things:

  1. Provides a simple function cloudinary_url() to get a Cloudinary auto-upload URL for any image in your media library, with all the Cloudinary transformations, so you can dynamically manipulate an image on the fly.
  2. Attempts to automatically convert all image URLs on the front-end into a Cloudinary auto-upload URL, so you can use Cloudinary as an image CDN.

The magical function 🎩

cloudinary_url( $identifier, $args )

This function returns a Cloudinary Auto Upload URL for an image. Please read the Best Practices page before using this.

Parameters

  • identifier (integer/string)(required) : Either the ID of the attachment, or a full image URL.
  • args (array)(optional) : Arguments to manipulate the image.

Return Value

Returns a URL (string):

'https://res.cloudinary.com/cloud-name/auto-mapping-folder/2017/12/your-image.jpg'

Arguments

You can optionally send an array of arguments which can transform the image, and set a dynamic file name. Ex:

array(
	'transform' => array( // Optional. All transformations go here.
		'width'   => 300,
		'height'  => 200,
		'crop'    => 'fill',
		'quality' => '80',
		'gravity' => 'face',
	),
	'file_name' => 'whatever-file-name-you-want', // Optional. If you want to use a dynamic file name for SEO. Don't use the file extension!
);

Here's a full list of transformations you can achieve with Cloudinary.

Examples:

<?php
$url_1 = cloudinary_url( 123, array(
	'transform' => array(
		'width'   => 300,
		'height'  => 200,
		'crop'    => 'fill',
		'quality' => '80',
		'gravity' => 'face',
	),
	'file_name' => 'dynamic-file-name',
) );

$url_2 = cloudinary_url( 'https://www.yourwebsite.com/wp-content/uploads/2017/12/my-image.jpg', array(
	'transform' => array(
		'width'   => 100,
		'height'  => 100,
	),
) );

// $url_1 : https://res.cloudinary.com/cloud-name/images/w_300,h_200,c_fill,q_80,g_face/auto-mapping-folder/2017/12/my-image/dynamic-file-name.jpg
// $url_2 : https://res.cloudinary.com/cloud-name/w_100,h_100/auto-mapping-folder/2017/12/my-image.jpg
?>

<img src="<?php echo esc_url( $url_1 ); ?>" width="300" height="200" alt="">
<img src="<?php echo esc_url( $url_2 ); ?>" width="100" height="100" alt="">
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].