[WordPress] 外掛分享: Protocol Relative Theme Assets

前言介紹

  • 這款 WordPress 外掛「Protocol Relative Theme Assets」是 2014-05-20 上架。
  • 目前有 30 個安裝啟用數。
  • 上一次更新是 2014-05-21,距離現在已有 4001 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3.6 以上版本才可以安裝。
  • 有 2 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

ryanjbonnell |

外掛標籤

script | Protocol | relative | javascript | stylesheet |

內容簡介

這個外掛將註冊、佇列的 CSS 或 JavaScript URL 轉換成它們的「協定相對」等效URL。

考慮以下示例:

協議相對 CSS URL

協議相對 JavaScript URL

更合適地稱為「網路路徑參考」或「協議相對路徑」,協議相對 URL 有助於避免常見的情況,例如:

瀏覽器地址欄中顯示混合的HTTP/HTTPS內容時,SSL鎖定圖示出現問題
Internet Explorer 出現錯誤訊息,顯示「此頁面包含安全及非安全項目」
檢視HTTPS頁面時提供HTTP資源

協定相對 URL 的使用觀念是由 Paul Irish 推廣,隨著站點在 HTTP 和 HTTPS 資源之間切換,已成為常見的解決方案。

此外掛會將所有正確佇列的主題檔案標準化為使用協定相對路徑,即使這些檔案由第三方外掛程式新增。

注意:此外掛目前僅適用於註冊、佇列的 CSS/JavaScript 檔案,並不會轉換嵌入WordPress編輯器中或在主題其他位置上作為特色圖片輸出的任何圖像路徑。

原文外掛簡介

This plugin transforms any registered, enqueued CSS or JavaScript URLs into their “protocol-relative” equivalent.
Consider the following examples:
Protocol Relative CSS URL

Protocol Relative Javascript URL

More appropriately called a “network-path reference” or “scheme-relative path”, a protocol-relative URL helps to avoid common scenarios such as:

Broken SSL padlock icon in browser’s address bar when showing mixed HTTP/HTTPS content
Error message in Internet Explorer saying, “This Page Contains Both Secure and Non-Secure Items”
Serving HTTP assets when viewing HTTPS pages

The idea of using protocol-relative URLs was popularized by Paul Irish and has become common as sites switch between serving HTTP and HTTPS assets.
This plugin will standardize all properly enqueued theme files to use protocol-relative paths, even those added from third-party plugins.
Note: This plugin does not transform any image paths that may be embedded in the WordPress editor or output as featured images or elsewhere in the theme — it presently only works on enqueued CSS/JavaScript files.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Protocol Relative Theme Assets」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


最新版本

延伸相關外掛(你可能也想知道)

  • Head & Footer Code 》Head & Footer Code 插件可以讓你在不是開發人員的情況下,添加自定義代碼片段(JavaScript、CSS 或 HTML)到網頁中。您可以將代碼放置在 (...。
  • LuckyWP Scripts Control 》「LuckyWP Scripts Control」外掛允許您將自訂代碼插入和管理網站。例如,您可以插入 Google Analytics 代碼、Google Search Console 驗證元標記、Facebook ...。
  • Unfiltered MU 》Unfiltered MU 提供給管理者和編輯者 unfiltered_html 功能。這可避免 WordPress MU/WordPress 3.0 多站點從這些使用者的文章中刪除