Tagged: https, LayerSlider
-
AuthorPosts
-
November 10, 2015 at 4:41 pm #533418
Hi,
today I switched our page https://www.cloudboxtogo.com from HTTP to HTTPS.
There is no option to switch enfold from HTTP to HTTPS, therefore we use the plugin wordpress-https to force HTTPS links.The problem is, that there are HTTP links left in combination with LayerSlider WP and the browser blocks loading this resources:
http://www.cloudboxtogo.com/wp-content/themes/enfold/config-layerslider/LayerSlider/static/skins/fullwidth/skin.css
or
skinsPath: ‘http://www.cloudboxtogo.com/wp-content/themes/enfold/config-layerslider/LayerSlider/static/skins/Can anybody help me?
- This topic was modified 9 years ago by BugfreeSystems.
November 10, 2015 at 5:59 pm #533507I found a quick and dirty solution:
go to: /wp-content/themes/enfold/config-layerslider/LayerSlider/classes/class.ls.sources.php
into: function urlForSkin (line 127)
and add before: return str_replace(‘\\’, ‘/’, $url);
this: $url = str_replace(‘http:’, ‘https:’, $url);In my case I used this condition:
if (isset($_SERVER[‘HTTP_X_FORWARDED_PROTO’]) && $_SERVER[‘HTTP_X_FORWARDED_PROTO’] == ‘https’)November 11, 2015 at 7:04 am #533859Hi,
Glad you found a fix and thanks for sharing the solution. Please let us know if you should have any further problems on the topic.
Best regards,
RikardMarch 9, 2016 at 12:50 pm #595526hi,
I am having the same issue, but not quite sure how/where to include the ‘if condition’ in /wp-content/themes/enfold/config-layerslider/LayerSlider/classes/class.ls.sources.php
The first part of BugfreeSystem’s solution I can follow:
into: function urlForSkin (line 127)
and add before: return str_replace(‘\\’, ‘/’, $url);
this: $url = str_replace(‘http:’, ‘https:’, $url);But not sure how to proceed after that with the condition. And maybe I need to change the condition?
In any case, in Chrome I have no problem with the http in the skinsPath name. It’s in Firefox that the http gives a security problem.
Or maybe there is an alternative to change the path from http to https ?
Thanks,
Nicholas
March 14, 2016 at 10:04 am #597633Hi!
Change the whole function with this:
public static function urlForSkin($handle) { $path = self::$skins[ strtolower($handle) ]['dir']; $url = content_url() . str_replace(realpath(WP_CONTENT_DIR), '', $path).'/'; if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') $url = str_replace('http:', 'https:', $url); return str_replace('\\', '/', $url); }
Best regards,
IsmaelApril 2, 2016 at 4:53 pm #607001Hi,
it’s better to use
if (isset($_SERVER[‘SERVER_PORT’]) && $_SERVER[‘SERVER_PORT’] == ‘443’)
$url = str_replace(‘http:’, ‘https:’, $url);because HTTP_X_FORWARDED_PROTO is not sent by every server.
Regards,
TJ- This reply was modified 8 years, 7 months ago by BugfreeSystems.
April 3, 2016 at 9:15 am #607177July 13, 2016 at 1:14 pm #660361I really hate the idea of editing those files and then having to maintain them myself.
I found that installing the really-simple-ssl plugin rather than wordpress-https, which is over 2 years old now, fixed these issues without the tinkering.
BUT, if would be much better if the fix were rolled into the base code so that this problem never arose in the first place.
July 15, 2016 at 4:09 pm #661406Hi @IanWorthington,
Thanks for the feedback, we’ll have a look if this is something we can get into the theme in the future.
Regards,
RikardAugust 31, 2016 at 9:38 pm #680334Thanks for the easy fix Ian. This was driving me bonkers for a few hours.
September 2, 2016 at 6:42 am #681137 -
AuthorPosts
- The topic ‘Enfold + LayerSlider WP with https issue’ is closed to new replies.