Support » Plugin: WP YouTube Lyte » Force to use https

  • Resolved alex1305

    (@alex1305)


    Good day! Is there a way to use only https? On server https made with 301 rules so your plugin think website is http and not show https link.

    • This topic was modified 6 years, 10 months ago by alex1305.
Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Frank Goossens

    (@futtta)

    well, lyte uses the wordpress is_ssl() function, so if wordpress doesn’t know it’s on https then lyte doesn’t either. you can try a code snippet like this one to hack your way around that;

    add_filter('lyte_settings','lyte_https');
    function lyte_https($in) {
      $in['scheme']="https://";
      return $in;
    }
    

    hope this helps,
    frank

    Thread Starter alex1305

    (@alex1305)

    Thanks for answer! But not helped, i edit code in plugin to
    $lyteSettings['scheme'] = "https" ;
    I deactivated and activated plugin after edit. But it not helped too.

    Plugin Author Frank Goossens

    (@futtta)

    can you share a URL where I can see what is going wrong @alex1305?

    Thread Starter alex1305

    (@alex1305)

    Plugin Author Frank Goossens

    (@futtta)

    hmm, the code I gave earlier was wrong (sorry bout that), should be:

    add_filter('lyte_settings','lyte_https');
    function lyte_https($in) {
      $in['scheme']="https";
      return $in;
    }

    can you change that + clear Lyte’s cache?

    Thread Starter alex1305

    (@alex1305)

    Not helped 🙁

    Plugin Author Frank Goossens

    (@futtta)

    ok;
    * can you make sure wp-youtube-lyte.php is back to it’s original state (you made a change there, right?)
    * can you change the video on that testpage, or add another one?

    frank

    Thread Starter alex1305

    (@alex1305)

    I deleted then installed plugin to be sure all by default and changed video to new one. But it not helped. Maybe i should change in DB options of plugin?

    Plugin Author Frank Goossens

    (@futtta)

    OK, the links in the noscript tags are not correctly HTTPS, so that works. now for the thumbnail URL, that is fetched from the YouTube API, I’ll have to chech under which conditions they are returned with HTTP vs HTTPS, I’ll report back here when I know more 🙂

    Plugin Author Frank Goossens

    (@futtta)

    OK, lets try enforcing HTTPS on youtube thumbnails this way;

    
    add_filter('lyte_match_thumburl','https_thumburl');
    function https_thumburl($thumb) {
            return str_replace("http://","https://",$thumb);
    }
    
    Thread Starter alex1305

    (@alex1305)

    Its working! You are really awesome! Big thanks. Autoptimize awesome plugin too. Using it and loving it.

    Plugin Author Frank Goossens

    (@futtta)

    great! have fun @alex1305 🙂

    Thread Starter alex1305

    (@alex1305)

    Looks like on mobiles not working:).
    I tryed to resolve by this code

    add_filter('lyte_do_mobile','lyte_on_mobile',10,0);
    function lyte_on_mobile(){
        return true;
    }

    but it not helped.

    • This reply was modified 6 years, 10 months ago by alex1305.
    Plugin Author Frank Goossens

    (@futtta)

    well, before playing with code; can you describe what is not working, what do you see?

    Thread Starter alex1305

    (@alex1305)

    Wow, crtr+shft+m allow to inspect in chrome mobile version. Problem was not in your plugin. I am sorry. All resolved!:))))

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Force to use https’ is closed to new replies.