[WordPress] 外掛分享: Convert Media to EDD

首頁外掛目錄 › Convert Media to EDD
WordPress 外掛 Convert Media to EDD 的封面圖片
全新外掛
安裝啟用
尚無評分
3306 天前
最後更新
問題解決
WordPress 4.0+ v1.0.0 上架:2017-02-27

內容簡介

這個外掛需要先安裝 Easy Digital Downloads,才能安裝此外掛。這個外掛可以讓管理員從媒體庫中選擇要轉換成 EDD 下載的圖片。此外掛提供更多與 EDD 下載相關的選項。

在安裝後會創建一個名為「Convert Media to EDD」的新選單。

外掛選單頁面有以下欄位:

說明(完整 wysiwyg 編輯器)
下載類別
價格
下載限制
下載備註

這些欄位都很直觀,除了媒體附件欄位必填外,其他欄位都是可選的。

在外掛頁面上有兩個按鈕,分別為執行和重置。

執行

按一下後,它會立即發送請求以執行計劃工作。
在處理定期工作之前的任何錯誤(無效 nonce)都會在頁面頂部顯示通知。
在 Cron 成功執行後,更新的工作狀態將在頁面頂部顯示通知。

重置

當您想要再次運行 Cron 工作並清除先前的待處理/已完成工作時,此按鈕很重要。
只有任何先前的工作排程時,重置按鈕才會可點選。
當您重置先前的工作時,它的狀態項目(完成/處理狀態)將被刪除(不是已創建的下載),用於跟踪運行中的工作。
這允許在單擊執行時安排新工作。
注意:在重置後執行時,先前的下載文章將保留,下一次執行只會創建新的下載。

輪詢

在前端 ajax 每 2 秒進行輪詢,以查找工作狀態並在頁面頂部更新消息。當工作正在運行時,只有輪詢才會運行。

Cron 工作

成功從前端發出請求後,該工作立即運行。
該工作跟踪以下字段/值,以恢復或通知前端工作狀態。

狀態:已完成/進度

處理:已處理圖片數量

剩餘:尚未處理的圖片數量

總計:媒體庫圖片項目的總數(jpg、png、gif)
在這裡需要記住處理字段。因為這需要恢復和處理下一批圖片。
Cron 執行媒體庫中的前 10 張圖片,然後暫停 1 秒。(這樣可以防止伺服器負載),並將處理字段更新為圖片偏移量,即從 0 到 10。因此,在下一次迭代中,它將記住從哪裡繼續/恢復。

注意:當站點管理員在工作運行時上傳圖片到媒體庫時,它將更新傳媒體庫圖片數的總數,並處理新上傳的圖片。
如果在給定(已處理的總數)偏移量上找不到圖片,則假定該工作已完成,因為沒有更多圖片可用於進一步操作。(狀態將在前端更新)

日誌

日誌文件位於 wp-content/cmedd_cron/cmedd.log

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Convert Media to EDD」→ 直接安裝(推薦)

原文外掛簡介

This addon depends on Easy Digital Downloads, so It must be installed first before installing this addon. This addons enables the admin to select the images from media library which should be converted into EDD downloads. The addon offers more options to associate with the EDD downloads.
A new menu is created after install by the name Convert Media to EDD
Plugin menu page has following fields:

Description (full wysiwyg editor)
Download categories
Price
Download Limit
Download notes

These fields are self explanatory and all fields are optional except the Media attachment field, which is required.
There are two buttons on the plugin page execute and reset
Execute
Once clicked, it will send request to execute cron job immediately.
Any errors before processing cron job (invalid nonce) will be displayed on top of the page as notice.
After Cron successfully executed, the updated job status will be displayed on top of the page as notice.
Reset
This button is important when you want to run the cron job again and clear out the previous pending/completed job.
The reset button will only be clickable when any previous job was scheduled.
When you Reset the previous job, it’s status entries (total/processed/status) will be removed (not the downloads that’s been created), which is used to track running job.
This allows to schedule new job when clicked on Execute
Note: When you Execute after Reset, the previous download posts will be preserved and the next Execute will just create new downloads.
Polling
On Frontend ajax polls every 2 seconds to find out the job status and update message on top of the page. Polling will only runs when job is running.
Cron Job
The job runs immediately on successful request from frontend.
The job keep track of the following field/values to resume or notify job status in frontend.
Status: completed/progress
Processed: number of images has been processed
Remaining: number of images remains to be processed
Total: total number of media library image items (jpg,png,gif)
The processed field is main key here to remember. As this required for resume and next batch of images to process.
The cron executes first 10 images from the media library and then pause for 1 second. (This prevents load on server) and the processed field is updated with image offset i.e. from 0 to 10. So on next iteration it will remember where to continue/resume from.
Note: When site admin upload images to media library while job is running, it will update the total count the images on Media library and processed the new uploaded images as well.
If no images are found on given (total number of processed) offset, it will be assumed that the job is completed, because there are no more images found for further operation. (Status will be updated on frontend)
Logs

Log file is located in wp-content/cmedd_cron/cmedd.log

延伸相關外掛

文章
Filter
Apply Filters
Mastodon