Protocol Relative Theme Assets

Protocol Relative Theme Assets Install Statistics

11
100%
Today: 11 Yesterday: 0 All-time: 2,314 downloads
Protocol Relative Theme Assets Icon

Try plugin: Protocol Relative Theme Assets

We'll create fresh WordPress site with Protocol Relative Theme Assets installed. You have 20 minutes to test the plugin after that site we'll be deleted.

Takes ~10 seconds to install.

About Protocol Relative Theme Assets

Transforms enqueued CSS and JavaScript theme URLs to use protocol-relative paths.

1


0


1


0


0

updated: 10 years ago
since: 10 years ago
author: Ryan J. Bonnell

Description

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 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.