Auto Cloudinary

Por Junaid Bhura
(14 avaliações)
Baixar

Hospedagem WordPress com plugin Auto Cloudinary

Onde posso hospedar o plugin Auto Cloudinary?

Este plugin pode ser hospedado em qualquer provedor que possua WordPress configurado. Recomendamos optar por uma hospedagem seguro, com servidores especializados para WordPress, como o serviço de hospedagem WordPress da MCO2.

Hospedando o plugin Auto Cloudinary em um provedor seguro

A MCO2, além de configurar e instalar o WordPress na versão mais nova para seus clientes, fornece o plugin WP SafePress, um mecanismo exclusivo que protege e aumenta a performance do seu site simultaneamente.

Por que a Hospedagem WordPress funciona melhor na MCO2?

A Hospedagem WordPress funciona melhor pois a MCO2 possui servidores otimizados para WordPress. A instalação de WordPress é diferente de uma instalação trivial, pois habilita imediatamente recursos como otimização automática de imagens e fotos, proteção da página de login, bloqueio de atividades suspeitas diretamente no firewall, cache avançado e HTTPS ativado por padrão. São recursos que potencializam seu WordPress para a máxima segurança e o máximo desempenho.

Check out the Github Repository ♥

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 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="">

Capturas de tela

WordPress Options

WordPress Options

Cloudinary Cloud Name

Cloudinary Cloud Name

Cloudinary Auto Upload Setup

Cloudinary Auto Upload Setup

Plugins semelhantes

Smush Image Optimization – Optimize Images | Compress & Lazy Load Images | Convert WebP & AVIF | Image CDN
(6.017 avaliações)

Optimize images & bulk compress images with lossless compression, lazy load, convert to WebP or AVIF, and properly size images via CDN for incredi …

W3 Total Cache
(5.407 avaliações)

Search Engine (SEO) & Performance Optimization (WPO) via caching. Integrated caching: CDN, Page, Minify, Object, Fragment, Database support.

Image Optimizer – Optimize Images and Convert to WebP or AVIF
(57 avaliações)

Automatically resize, optimize, and convert images to WebP and AVIF. Compress images in bulk or on upload to boost your WordPress site performance.

Imagify Image Optimization – Optimize Images | Compress Images | Convert WebP | Convert AVIF
(1.576 avaliações)

Optimize images in 1-click: compress images, convert to WebP & AVIF, resize, and boost your site with the easiest WordPress image optimization plugin!

Converter for Media – Otimização de imagens | Conversão para WebP e AVIF
(1.052 avaliações)

Acelere seu site usando nosso WebP & AVIF Converter. Otimize imagens e forneça imagens WebP e AVIF em vez de formatos padrão!

SpeedyCache – Cache, Optimization, Performance
(27 avaliações)

SpeedyCache is a WordPress cache plugin that helps you improve performance of your WordPress site by caching, minifying, and compressing your website.