Tagged: ,

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #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?

    #533507

    I 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’)

    #533859

    Hi,

    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,
    Rikard

    #595526

    hi,

    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

    #597633

    Hi!

    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,
    Ismael

    #607001

    Hi,

    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

    #607177

    Hi TJ,

    Thanks for sharing, much appreciated :-)

    Best regards,
    Rikard

    #660361

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

    #661406

    Hi @IanWorthington,

    Thanks for the feedback, we’ll have a look if this is something we can get into the theme in the future.

    Regards,
    Rikard

    #680334

    Thanks for the easy fix Ian. This was driving me bonkers for a few hours.

    #681137

    Hi @prompos1234,

    Glad you found a solution :-)

    Regards,
    Rikard

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Enfold + LayerSlider WP with https issue’ is closed to new replies.