WP_CONTENT_URL should use site_url() to support HTTPS / SSL
|Reported by:||micropat||Owned by:||johnbillion|
On HTTPS pages, users sometimes get 'insecure content' warnings from their browser. This is commonly caused by plugins which use the WP_PLUGIN_URL constant to get the full plugin directory URL for the sake of loading static content.
The problem is that WP_PLUGIN_URL will always return the siteurl (as specified in Settings > General) and thus does not adjust from http:... to https:... when needed.
WP_PLUGIN_URL is dependent on WP_CONTENT_URL, and WP_CONTENT_URL is derived from get_option('siteurl'), which only returns the siteurl and does not adjust for HTTPS pages. However, the site_url() function does adjust for HTTPS pages.
So, to fully support HTTPS and directives such as FORCE_SSL_LOGIN and FORCE_SSL_ADMIN, WP_CONTENT_URL needs to use the site_url() function as proposed in my riveting one-liner patch.
Change History (37)
- Cc pauli.price@… added
5 years ago
- Cc jer@… added
- Keywords 3.2-early removed
17 months ago
- Keywords needs-patch added; has-patch removed
- Type changed from enhancement to defect (bug)
17 months ago
- Keywords has-patch 4.5-early added; needs-patch removed
- Priority changed from normal to low
15 months ago
- Keywords has-patch removed
- Resolution fixed deleted
- Status changed from closed to reopened