Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #26415

    Lee G
    Participant

    My website has no errors on any page when visiting it via http.

    If I visit any page on the site via https, the only error is based on the logo (confirmed via Firebug).

    If I remove the logo using the customizer, save, hit refresh on the https page, the website has no errors.

    It seems when using the customizer to add a logo, it is an absolute reference rather than a relative reference.

    To clarify, I used customizer to add my logo (png), then https shows an error due to an absolute reference to the logo, but this should be a relative reference, once removing the logo (png), https works with no problems.

    Please advise.

    Thanks! 🙂

    #26734

    Christian
    Moderator

    Hey Lee,

    You might want to read through the articles below.

    http://make.wordpress.org/support/user-manual/web-publishing/https-for-wordpress/
    https://yoast.com/wordpress-ssl-setup/

    Hope that helps. 🙂

    #28691

    Lee G
    Participant

    1. I’m not using Yoast.

    2. The wordpress.org link isn’t relevant.

    Surfers visit the site and surf using http. During checkout, the site is https.

    The template is using an absolute reference to the logo which breaks on https.

    #29008

    Christian
    Moderator

    Hey Lee,

    In that case, you need to setup your WordPress Media folder to run on SSL. This is simply setting up your directories to be secured if you use https for certain areas of your site only.

    We’d love to help you on this but this is a general WordPress setup and falls beyond our scope of support.

    Thank you for understanding.

    #29065

    Lee G
    Participant

    Hello and thanks for your prompt reply.

    The x theme customizer links the logo via http:// rather than “protocol relative” such as //.

    How can I fix the customizer to make the logo image protocol relative?

    https://yoast.com/wordpress-ssl-setup/:

    “I was loading that font file over http, instead of using what’s called a protocol relative link. Every time you’re embedding images, javascript or CSS files, you should be using a protocol relative link. Instead of linking to:
    http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600

    I’m now linking to:

    //fonts.googleapis.com/css?family=Source+Sans+Pro:400,600

    As you can see, I left out the http:, this will make the browser use the current protocol to fetch that file. This means that when a user is on plain http, it’ll use that, which is faster, but if the user is on https, it’ll use the safe https link.”

    To clarify, all images on the site work perfectly via http and https except when using the customizer and adding a logo.

    If you view source code when accessing via https, everything is perfect, except for the customizer added logo:

    Professional Service and More

    As you can see, the customizer doesn’t use a protocol relative link and forces the http://.

    How can I fix the customizer to make the logo image protocol relative?

    Thank you for any help you can provide.

    #29536

    Alexander
    Keymaster

    Hi Lee,

    We should be able to fix this by adding an SSL check. We need to add the following code in views/global/_navbar.php

    if (is_ssl()){
        $x_logo = str_replace("http", "https", $x_logo, 1);
    }

    It would need to be at the top, around here:

    $get_name          = get_bloginfo( 'name' );
    $get_description   = get_bloginfo( 'description' );
    $x_logo            = get_theme_mod( 'x_logo' );
    $has_primary_nav   = has_nav_menu( 'primary' );
    $one_page_nav_meta = get_post_meta( get_the_ID(), '_x_page_one_page_navigation', true );
    $one_page_nav      = ( $one_page_nav_meta == '' ) ? 'Deactivated' : $one_page_nav_meta;
    
    if (is_ssl()){
        $x_logo = str_replace("http", "https", $x_logo, 1);
    }

    If you’d like, I can add this for you if you provide FTP credentials. To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply to ensure that your data remains hidden

    Once that’s added, we can see how the logo looks both in the customizer, and on the front end after it’s saved.

    #29651

    Lee G
    Participant
    This reply has been marked as private.
    #29653

    Lee G
    Participant

    Please let me know any changes necessary, so that I can keep X updated and reapply the code.

    #29904

    Alexander
    Keymaster

    Hi Lee,

    I’m having issues getting your site to load. I was getting “Bad Gateway” from nginx. This usually means there’s an issue with PHP-FPM, and that it can’t accept a connection.

    After trying again a couple times, I got it to start outputting the page, but eventually timed out with this message “Error establishing a database connection” This means the MySQL server isn’t responding, or your wp-config.php file has the wrong credentials (probably the former)

    I’d recommend troubleshooting your server to see what’s up with performance. You may need to contact your web host. Let us know when we can take another look.

    It sounds like your server is overpopulated, or something is eating up all the resources creating a bottleneck.

    FTP worked, so I still added the modification for you. However, I left it “commented out” so it’s not yet implemented

    You’ll see this code in x/framework/views/global/_navbar.php

    /*
    if (is_ssl()){
        $x_logo = str_replace("http", "https", $x_logo, 1);
    }
    */

    You can just remove the /* and */ to enable the code once your site is back up.

    Looking forward to seeing how this goes!