
內容簡介
曾經想過讓你的媒體真正的私人嗎?通過特定設置的權限,確保圖片、視頻和其他文件僅對選定角色可訪問,或不能使用熱鏈。
此外掛將以下主要功能添加到 WordPress:
媒體隱私:通過阻止熱鏈或僅限於選定的用戶角色來限制文件訪問,從而鎖定媒體庫中的項目的訪問權限。
用戶友好的禁止處理器:私有設置的圖像不會在前端中斷。相反,它們將被一個簡單的訪問被拒絕的 SVG 圖片替換-被禁止的處理程序可以使用過濾鉤代碼 pvtmed_forbidden_response_content(apply_filters( 'pvtmed_forbidden_response_content', $forbidden_response_content, $file );)和 pvtmed_forbidden_mimetype(apply_filters( 'pvtmed_forbidden_mimetype', 'image/svg+xml' );)替換。
可自定義以獲得更多綜合性:受限制的媒體將進行授權檢查-插件開發人員可以鉤入 pvtmed_is_authorized 過濾器(apply_filters( 'pvtmed_is_authorized', $authorized, $attachment_id );)以應用更複雜的授權條件。
優化的私人媒體交付:具有訪問限制的文件使用流進行傳送,而不是在交付之前完全加載文件,並且 WordPress 文件以盡可能輕的方式加載,從而適當使用服務器內存。
降級:受限制的文件存儲在備用的 wp-content/pvtmed-uploads 文件夾中(如果 WP_CONTENT_DIR 不是默認的話則等效);回退措施確保:
將媒體變為私有不會破壞以前嵌入媒體(使用動態回退和在發布編輯屏幕上提供通知-僅限經典編輯器)。
停用插件不會破壞以前嵌入媒體(數據庫更新)。
刪除插件不會破壞以前嵌入媒體(數據庫更新)。
自動安裝一個名為 Must Use Plugin 的 pvtmed-endpoint-optimizer.php,以確保當請求受限制的媒體時,WordPress 可以盡可能輕鬆地加載。如果需要,開發人員可以安全地編輯它,以在此類請求期間執行其插件。
媒體隱私策略是根據每個媒體項目設置的-因此,此插件不是一個通用圖像熱鏈防止插件的替代品,但對於任何想要根據特定條件防止直接連接到文件的人來說是理想的。
外掛標籤
開發者團隊
📦 歷史版本下載
原文外掛簡介
Ever wanted to make your media truely private? Make sure images, videos and other files are only accessible to chosen roles, or cannot be hotlinked, with permissions specifically set per item.
This plugin adds the following major features to WordPress:
Media Privacy: Lock access to items in the Media Library by preventing hotlinks only or by limiting access to files to selected user roles.
User-friendly forbidden handler: Images set to private do not break on the frontend. Instead, they are replaced by a simple access denied SVG picture – the forbidden handler can be replaced using the filter hooks pvtmed_forbidden_response_content (apply_filters( 'pvtmed_forbidden_response_content', $forbidden_response_content, $file );) and pvtmed_forbidden_mimetype (apply_filters( 'pvtmed_forbidden_mimetype', 'image/svg+xml' );).
Customizable for more granularity: Restricted media will be checked for autorization – plugin developers can hook into the pvtmed_is_authorized filter (apply_filters( 'pvtmed_is_authorized', $authorized, $attachment_id );) to apply more complex conditions for authorization.
Optimized private media delivery: Files with access restriction are served using streams without loading the file entirely in memory before delivery, and WordPress files are loaded as lightly as possible for an optimised server memory usage.
Fallbacks: Restricted files are kept in an alternate wp-content/pvtmed-uploads folder (or equivalent if WP_CONTENT_DIR is not the default) ; fallbacks are in place to make sure:
moving a media to private does not break previously embedded media (javascript dynamic fallback with notice on post edit screen – Classic Editor only).
deactivating the plugin does not break previously embedded media (database update).
deleting the plugin does not break previously embedded media (database update).
A Must Use Plugin pvtmed-endpoint-optimizer.php is installed automatically to make sure WordPress is loaded as lightly as possible when requesting restricted media items. Developers can safely edit it to enable their plugin to execute during such request if necessary.
The media privacy policy is set per media item – therefore, this plugin is not a replacement for general image hotlink prevention plugins, but is ideal for anyone looking for preventing direct links to files depending on specific conditions.
