Title: Protocol Relative Theme Assets
Author: ryanjbonnell
Published: <strong>2014 年 5 月 21 日</strong>
Last modified: 2014 年 5 月 21 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/protocol-relative-theme-assets.svg)

# Protocol Relative Theme Assets

 作者：[ryanjbonnell](https://profiles.wordpress.org/ryanjbonnell/)

[下载](https://downloads.wordpress.org/plugin/protocol-relative-theme-assets.zip)

 * [详情](https://cn.wordpress.org/plugins/protocol-relative-theme-assets/#description)
 * [评价](https://cn.wordpress.org/plugins/protocol-relative-theme-assets/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/protocol-relative-theme-assets/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/protocol-relative-theme-assets/#developers)

 [支持](https://wordpress.org/support/plugin/protocol-relative-theme-assets/)

## 描述

This plugin transforms any registered, enqueued CSS or JavaScript URLs into their“
protocol-relative” equivalent.

Consider the following examples:

**Protocol Relative CSS URL**

    ```
    <link href="//example.com/wp-content/themes/twentytwelve/style.css" />
    ```

**Protocol Relative Javascript URL**

    ```
    <script src="//example.com/wp-includes/js/jquery/jquery.js"></script>
    ```

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](http://paulirish.com/2010/the-protocol-relative-url/)
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._

## 安装

 1. Activate the plugin through the Plugins menu in the WordPress admin.

## 评价

![](https://secure.gravatar.com/avatar/83ef055bef15d30db182397f553017f10b84c5dea03f0b493c2b013f8bb7a2f9?
s=60&d=retro&r=g)

### 󠀁[Still works with 4.3.](https://wordpress.org/support/topic/still-works-with-43/)󠁿

 [massafiri](https://profiles.wordpress.org/massafiri/) 2016 年 9 月 3 日

Life saving plugin. After moving to HTTPs, a lot of the assets from Masterslider
broke and caused very broken looking homepages. Installation of this plugin fixed
that, no configuration required. As fabian mentioned, this won’t update the images
on the site to pull from HTTPs.. but it’s not designed to do that, and many images
are hard coded by your CSS; so it’s hardly fair to give this plugin less than 5 
stars as it does exactly as it promises.

 [ 阅读所有2条评价 ](https://wordpress.org/support/plugin/protocol-relative-theme-assets/reviews/)

## 贡献者及开发者

「Protocol Relative Theme Assets」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ ryanjbonnell ](https://profiles.wordpress.org/ryanjbonnell/)

[帮助将「Protocol Relative Theme Assets」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/protocol-relative-theme-assets)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/protocol-relative-theme-assets/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/protocol-relative-theme-assets/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/protocol-relative-theme-assets/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/protocol-relative-theme-assets/)。

## 更新日志

#### 1.0

 * Initial release

## 额外信息

 *  版本 **1.0**
 *  最后更新：**12 年前**
 *  活跃安装数量 **20+**
 *  WordPress 版本 ** 3.6 或更高版本 **
 *  已测试的最高版本为 **4.0.38**
 *  语言
 * [English (US)](https://wordpress.org/plugins/protocol-relative-theme-assets/)
 * 标签
 * [javascript](https://cn.wordpress.org/plugins/tags/javascript/)[Protocol](https://cn.wordpress.org/plugins/tags/protocol/)
   [relative](https://cn.wordpress.org/plugins/tags/relative/)[script](https://cn.wordpress.org/plugins/tags/script/)
   [stylesheet](https://cn.wordpress.org/plugins/tags/stylesheet/)
 *  [高级视图](https://cn.wordpress.org/plugins/protocol-relative-theme-assets/advanced/)

## 评级

 4 星（最高 5 星）。

 *  [  1 条 5 星评价     ](https://wordpress.org/support/plugin/protocol-relative-theme-assets/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/protocol-relative-theme-assets/reviews/?filter=4)
 *  [  1 条 3 星评价     ](https://wordpress.org/support/plugin/protocol-relative-theme-assets/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/protocol-relative-theme-assets/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/protocol-relative-theme-assets/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/protocol-relative-theme-assets/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/protocol-relative-theme-assets/reviews/)

## 贡献者

 *   [ ryanjbonnell ](https://profiles.wordpress.org/ryanjbonnell/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/protocol-relative-theme-assets/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://www.gittip.com/ryanjbonnell/)