-
-
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.
-
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.
-
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!
-
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” will be appended to all the image URLs. If a user is browsing via http then “https://solicall.com” 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.
-
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!
-
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.
-
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 5 years, 8 months ago by Mirela.
-
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.
-
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!
-
-
You must be logged in to reply to this topic.