前言介紹
- 這款 WordPress 外掛「Auto Cloudinary」是 2017-11-13 上架。
- 目前有 200 個安裝啟用數。
- 上一次更新是 2024-06-26,距離現在已有 312 天。
- 外掛最低要求 WordPress 4.4 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 5.6 以上。
- 有 14 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
cdn | cloudinary | dynamic images | image manipulation | image optimization |
內容簡介
前往 Github 儲存庫 ♥
此外掛會為 WordPress 提供一個非常簡單的Cloudinary自動上傳功能,讓使用者無需擔心繁瑣的上傳API,就可以讓 Cloudinary 自動得從媒體庫中取得及伺服圖片,就好像 CDN 一樣!插件的設置也十分容易,只需要在 Cloudinary 設定上啟用自動上傳,並根據設定要求在Cloudinary 取得權限,最後在外掛的選項中輸入詳細資料即可。
簡單易操作 😎
重要
此外掛無法與官方 Cloudinary 外掛共用,使用本外掛前須先將 Cloudinary 官方外掛停用。
快速連結
設定 | 問題 | 功能 | 篩選 | 最佳實務
為什麼建立這個外掛?
其實已經有一個官方 Cloudinary 外掛了。但我認為那個外掛有點過於龐大,掠取了 UI 的控制權。本外掛希望可以達到以下目標:
極簡且輕量化
完全無縫整合
讓 WordPress 開發人員可以灵活運用
什麼是 Cloudinary 自動上傳?
Cloudinary 給你兩個將檔案上傳至其伺服器的選擇:
繁複的上傳 API 😱
超簡單、神奇的 Fetch API 🎩
上傳 API
簡述:過於複雜及繁琐 👎
Cloudinary 提供 API,讓你可以手動將圖片上傳至其伺服器。以此方法所需的 API金鑰等步驟繁琐,而官方外掛也是使用此方法進行操作。當你上傳一張圖片至媒體庫後,它也會上傳至 Cloudinary,對於擁有成千上萬個現存圖片的使用者而言,這可能會成為問題,並且可能不足以支援自訂架構。
Fetch API
簡述:神奇好用 👍
本外掛使用了 Fetch API 中自動上傳的超簡單功能。我們只需要告訴 Cloudinary 圖片在我們的伺服器上 (或在S3上或任何位於互聯網上的位置),然後 Cloudinary 會自動從該處下載並在您第一次要求它時保存在其伺服器中,就像CDN一樣!
這個外掛做了什麼?
本外掛會做以下兩件主要的事情:
提供了一個簡單的函數cloudinary_url(),可以為媒體庫中的任何圖片取得Cloudinary自動上傳URL,以及Cloudinary轉換,這樣你就可以動態的在任何時候任何地方改變圖片。
會自動更換前端中所有圖片的 URL 給 Cloudinary 自動上傳的 URL,這樣你就可以將 Cloudinary 作為圖片 CDN 使用。
神奇的函數 🎩
cloudinary_url($identifier, $args)
此函數可為圖片取得Cloudinary自動上傳的URL。詳細情況請參考 最佳實務
原文外掛簡介
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:
The complicated Upload API 😱
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:
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.
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
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
?>
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Auto Cloudinary」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.0.0 | 1.0.1 | 1.0.2 | 1.0.3 | 1.1.0 | 1.1.1 | 1.2.0 | 1.2.1 | 1.2.2 | 1.2.3 | 1.3.0 | 1.3.1 | trunk |
延伸相關外掛(你可能也想知道)
ResizeFly 》這個外掛讓你只需要在需要的時候才建立圖片尺寸,而不是在上傳時就建立。, 通常,當你啟用一個新佈景主題或外掛,新增了新的圖片尺寸大小後,你必須使用像是 ...。