Tagged: x
-
AuthorPosts
-
May 12, 2016 at 7:05 am #987653
When I inspect this page: https://www.ploquickpro.com/win1kcheckout/
I show mixed content errors: http://prntscr.com/b357tz
The 2 in red are from my stylesheets so I followed the advice from a different thread and tried:
//Force SSL of Stylesheet function x_integrity_scripts() { //add the Javascript file //wp_enqueue_script('myscript', 'https://www.url/of/file/script.js'); //add the CSS file wp_enqueue_style('mystyle', 'https://www.ploquickpro.com/wp-content/themes/x/framework/css/site/stacks/integrity-light.css'); wp_enqueue_style('mystyle2', 'https://www.ploquickpro.com/wp-content/themes/x-child-integrity-light/style.css'); } add_action( 'wp_enqueue_scripts', 'x_integrity_scripts' );
But that didn’t solve the problem.
You can also see the Mixed content error in yellow that lists http://i.imgur.com/QJsFGSs.png but I can’t seem to find that image anywhere so I can’t force it to SSL.
I’m running the latest X & Cornerstone, but the second to last WordPress version (4.5.1).
May 12, 2016 at 7:08 am #987654By the way, my overall objective is to force SSL on select pages which I’m also not having any luck with. I’ve tried plugins but they generally break the site or pages I force SSL on. I’ve also tried to add this to my child functions.php with no luck:
//Force SSL On Checkout Pages function wp_secure_page_force_ssl( $force_ssl, $post_id = 0 ) { $force_ssl_on_these_posts = array(4729, 5547, 2493, 4679, 5454, 4192, 4750, 5473, 5344, 5183, 4222, 5135, 5492); if(in_array($id, $force_ssl_on_these_posts )) { return true; } return $force_ssl; } add_filter('force_ssl' , 'wp_secure_page_force_ssl', 1, 3);
May 12, 2016 at 10:16 am #987910Hey there,
You site is not in https (http://www.ploquickpro.com/). Please enable HTTPS for your whole site. You also have other items that are not loaded in https like the imgur image. Please check.
Thanks.
May 12, 2016 at 12:08 pm #988113I don’t want the whole site HTTPS. I only want SSL on my checkout pages (to preserve site speed on pages that don’t require encrypted transfers). Please look at the second post as well.
The imgur image is from a third-party app that I’ve contacted for them to resolve it on their end. So, if I can force HTTPS on those 2 stylesheets I will be 50% complete (the other 50% being the 3rd party resolution of imgur AND forcing SSL only on specific pages which is what the second post was about).
May 12, 2016 at 5:38 pm #988640Hi there,
What plugin you’re using to force SSL? Basically, it will only inherit the base URL you have at Admin > Settings > General. All Scripts and CSS URL are based on that setting, hence, you have to tell your plugin to force SSL on that area too. The theme only picks the URL provided by WordPress through its setting.
Thanks!
May 13, 2016 at 5:06 am #989452I have tried several plugins and they all break my site (or that particular page when I set it to only enforce it there). That’s why I tried to use the WordPress filter by applying this function:
//Force SSL On Checkout Pages function wp_secure_page_force_ssl( $force_ssl, $post_id = 0 ) { $force_ssl_on_these_posts = array(4729, 5547, 2493, 4679, 5454, 4192, 4750, 5473, 5344, 5183, 4222, 5135, 5492); if(in_array($id, $force_ssl_on_these_posts )) { return true; } return $force_ssl; } add_filter('force_ssl' , 'wp_secure_page_force_ssl', 1, 3);
Just so I understand Rad. The theme picks the URL as set by the General WordPress setting rather than the URL of the actual page being visited? If that’s true, then why are the images on the page being served via HTTP/HTTPS based on what I type in the address bar? Shouldn’t those also be dependent on the General setting since they were chosen in Cornerstone?
May 13, 2016 at 9:41 am #989759UPDATE: When I followed your suggestion Rad it broke the site and produced an infinite redirect loop error, so doing it that way is not an option.
There has to be a way to:
1) Only force SSL on specific pages using a function and WordPress filter (something like https://community.theme.co/forums/topic/my-stylesheets-refuse-to-load-over-https/#post-989452 above)
2) Force the stylesheets to enqueue using HTTPS no matter what (something like https://community.theme.co/forums/topic/my-stylesheets-refuse-to-load-over-https/#post-987653 in the first post)
May 13, 2016 at 10:14 am #989805UPDATE: This code allows me to force SSL just on certain pages without the need for a plugin:
function wp_secure_page_force_ssl( $force_ssl, $post_id = 0 ) { $force_ssl_on_these_posts = array(4729, 5547, 2493, 4679, 5454, 4192, 4750, 5473, 5344, 5183, 4222, 5135, 5492); if(in_array($post_id, $force_ssl_on_these_posts )) { return true; } return $force_ssl; } add_filter('force_ssl' , 'wp_secure_page_force_ssl', 1, 3);
But I still need help with number 2:
2) Force the stylesheets to enqueue using HTTPS no matter what (something like https://community.theme.co/forums/topic/my-stylesheets-refuse-to-load-over-https/#post-987653 in the first post)
May 13, 2016 at 11:40 am #989926One thing I also just noticed is that it shouldn’t be trying to load http://www.ploquickpro.com/wp-content/themes/x-child-integrity-light/style.css
Because I’m using /x-child/ (the new universal child theme), so it should actually be https://www.ploquickpro.com/wp-content/themes/x-child/style.css
May 13, 2016 at 3:16 pm #990262Hi there,
It could be cache, please try clearing your cache as I can’t find any issue with those stylesheet. They are loaded with https.
The only issue I could see is this image http://i.imgur.com/QJsFGSs.png, and it’s from the popup. Forcing SSL on it may not work since it could be part of popup template.
Thanks.
-
AuthorPosts