Codeless
  • Support Home
  • Themes
  • Support
  • WordPress Tutorials
    • How to Start a Blog
    • Best Website Builders
    • Best Small Business Hosting
    • Email Marketing Services
    • Cheap WordPress Hosting
  • Video Tutorials

Community Forums

Logo does not support SSL

logoSSL
    • 6 years, 11 months ago solicall
      Participant

      Expired

      Hi,

      I have installed SSL certificate on the site.

      When browsing to the secured site (https://solicall.com)  I do not get the green lock.

      When analyzing this problem with whynopadlock, the problem is:

      An image with an insecure url of “https://solicall.com/wp-content/uploads/2017/06/solicall-logo.jpg” was loaded on line: 447 of https://solicall.com/

      How could this be fixed? Maybe we can force the logo to use relative path so the prefix (https://solicall.com or https://solicall.com) will change based on the caller context ?

      Thank you in advance for your support.

    • 6 years, 11 months ago Mirela
      Participant

      Hello,

      Please check this article for this.

      Best regards!

    • 6 years, 11 months ago solicall
      Participant

      Expired

      Thank you for you answer.

      Analyticalally I looked at this article before posting the question.

      The problem I am facing “The active theme loading an insecure image file”

      The recommended solution in this article is:

      “Edit the current theme’s files (hint: start looking in functions.php)”

      Could you please advise? All other images are loaded correctly using a relative path. Only the logo URL could not be changed to a relative path.

       

    • 6 years, 11 months ago Mirela
      Participant

      Hello,

      Actually that is just one of the scenarios.
      1-Did you check the situation in Settings > General? Do you have set secure link here?
      2-Check in database that all links are changed succesfully to https after the installation of ssl. One of the mentioned plugins can help with this.

      3-The logo code is present in file specular\header.php. It’s called dynamically. While the function is present in file functions-specular.php:

      /* -------------------- Get Logo Image ------------------------------------------ */
      
      if(!function_exists('codeless_logo'))
      {
      
          function codeless_logo($default = "")
          {
              global $cl_redata;
              $output = '';
              if(!empty($cl_redata['logo']['url']) || !empty($cl_redata['logo_light']['url']) )
              {
      
                  if(!empty($cl_redata['logo']['url']))
                    $logo = "<img class='dark' src=".esc_url($cl_redata['logo']['url'])." alt='' />";
                  if(!empty($cl_redata['logo_light']['url']))
                    $logo_light = "<img class='light' src=".esc_url($cl_redata['logo_light']['url'])." alt='' />";
                  
                  $logo = "<a href='".esc_url(home_url('/'))."'>".$logo.$logo_light."</a>";
              }
              else
              { 
                  $logo = get_bloginfo('name');
                  if($default != '') $logo = "<img src=".esc_url($default)." alt='' title='$logo'/>";
                  $logo = "<a href='".esc_url(home_url('/'))."'>".$logo."</a>";
              }
          
              return $logo;
          }
      }

      The link is generated dynamically from home url.

      Best regards!

    • 6 years, 11 months ago solicall
      Participant

      Expired

      Thank you Mihaila for your dedication, support and information. As described in the good article you sent me,  I want to keep both http and https working. If a user is browsing via https then “https://solicall.com&#8221; will be appended to all the image URLs. If a user is browsing via http then “https://solicall.com&#8221; will be appended to all the image URLs.

      Today, when a user a browsing via https he is getting the following HTML result:

      <pre id=”line1″> <<span class=”start-tag”>div</span> <span class=”attribute-name”>id</span>=”logo” <span class=”attribute-name”>class</span>=””>
      <span id=”line450″></span> <<span class=”start-tag”>a</span> <span class=”attribute-name”>href</span>=’https://solicall.com/‘><<span class=”start-tag”>img</span> <span class=”attribute-name”>class</span>=’dark‘ <span class=”attribute-name”>src</span>=https://solicall.com/wp-content/uploads/2018/08/solicall-logo.jpg <span class=”attribute-name”>alt</span>=” /><<span class=”start-tag”>img</span> <span class=”attribute-name”>class</span>=’light‘ <span class=”attribute-name”>src</span>=https://solicall.com/wp-content/uploads/2018/08/solicall-logo.png <span class=”attribute-name”>alt</span>=” /></<span class=”end-tag”>a</span>>
      <span id=”line451″></span> </<span class=”end-tag”>div</span>>

       

      As we can see the the command home_url('/') in your source code is working fine and it is directing to https. But the “src” of the two logo images is using http and not https.

      Again this problem only happens for the logo images. All other images are working fine and they start with either https or http depending if the user is browsing via https or http.

       

      I am wondering how is the content of cl_redata['logo'] been created? Could it be that there is some hard code usage of “http” ? Why it is behaving differently from all other images?

       

      Thank again for your support.

      • This reply was modified 6 years, 11 months ago by solicall.
      • This reply was modified 6 years, 11 months ago by solicall.
      • This reply was modified 6 years, 11 months ago by solicall.
    • 6 years, 11 months ago Mirela
      Participant

      Hello,

      The logo by default will take the image url set up in the logo option in General Options. This option settings are set up in file include/core/codeless_options.php. See the section for logo:

      array(
              'id' => 'logo',
              'type' => 'media',
              'title' => __('Upload Logo', 'codeless'),
              'desc' => __('Upload here the logo that is placed in top of the page ', 'codeless'),
              'subtitle' => __('Upload any media using the WordPress native uploader', 'codeless'),
               'default' => array('url' => get_template_directory_uri().'/img/logo.png'),
      ),

      The url is gotten by wordpress function get_template_directory_uri().

      Best regards!

    • 6 years, 11 months ago solicall
      Participant

      Expired

      Thank you very much for the support during your weekend.

      I think the code you refer to is for the “default logo” of the Specular theme and not my logo. The default logo of Specular is:

      https://solicall.com/wp-content/themes/specular/img/logo.png

      But, I am looking for my site logo. Could you please help me locate where my site logo is being set in the parameters:

      cl_redata['logo']['url']
      cl_redata['logo_light']['url']

      Hopefully there is an easy way to change its URL to be relative.

    • 6 years, 11 months ago Mirela
      Participant

      Hello,

      The logo url is being generated automatically from get_template_directory_uri() and home_url() functions. See the function in file functions-specular.php. See screenshot: https://postimg.cc/image/ftju5l1jr/

      To force the https in logo url, in the same function, edit this line:
      $logo = "<a href='".esc_url($url = home_url( '/'))."'>".$logo.$logo_light."</a>";
      to this:
      $logo = "<a href='".esc_url($url = home_url( '/', 'https' ))."'>".$logo.$logo_light."</a>";

      Best regards!

      • This reply was modified 6 years, 11 months ago by Mirela.
    • 6 years, 11 months ago solicall
      Participant

      Expired

      Hi Mihaila,

      Thank you for all the effort.

      I do not want to force https or http. I want the protocol to be selected dynamically. I have made the following change in functions-specular.php and it solves the logo problem.

      As you can see, I first made the URL relative (using wp_make_link_relative) and then I use the function home_url() to set the correct protocol (http or https).

      Does this look good for you?  Could you incorporate it in your next version?

      Thanks.

      • This reply was modified 6 years, 11 months ago by solicall.
      • This reply was modified 6 years, 11 months ago by solicall.
      • This reply was modified 6 years, 11 months ago by solicall.
    • 6 years, 11 months ago Mirela
      Participant

      Hello,

      Thank you for sharing your solution with the community!
      As for incorporating this in the next update, this is not my decision to make. I have notified the developers for this. They will check it and add the proper solution for ssl.
      I can not guarantee this exact code will be included. So i suggest you save the edited file in order to not have to redo the changes in case of future theme update.

      Best regards!

    • 6 years, 11 months ago solicall
      Participant

      Expired

      Thanks.

Viewing 10 reply threads

You must be logged in to reply to this topic.

Login

Log In
Register

Renew Support

  • Renew Specular Support
  • Renew Tower Support
  • Renew Folie Support
  • Renew Handel Support
  • Renew June Support
  • Renew Picante Support
  • Renew Thype Support
  • Renew Regn Support

Search Forums

Forums

  • Bygge – Construction Theme
  • Converta – Software Theme
  • Folie – The WordPress Website Builder
  • Handel – Responsive Multi-Purpose Business Theme
  • June WooCommerce WordPress Theme
  • Livecast – Podcast Theme
  • Picante – Restaurant & Food WordPress Theme
  • Regn | Agency & Business WordPress Theme
  • Remake – Minimal Portfolio & Agency Theme
  • Specular – Multi-Purpose WordPress Theme
  • Suggest us Features
  • Tower – Business-Driven Multipurpose WP Theme
  • Vibrance – Photography Theme

Site Links

  • Support Policy
  • Specular Support Forum
  • Video Tutorials
  • Knowledge Base
  • Guides and Reviews

Useful Articles

  • Build a Website
  • Web Design & Development
  • Hosting
  • WordPress

Login

Log In
Register Lost Password