Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » eCommerce & Atahualpa »

Atahualpa, WHMCS, Iframe, SSL, and SEO, oh my...


  #1  
Old Mar 9, 2010, 10:59 PM
craig0927
 
2 posts · Mar 2010
Portland, OR
Send a message via MSN to craig0927 Send a message via Skype™ to craig0927
Information Atahualpa, WHMCS, Iframe, SSL, and SEO, oh my...

I just spent about the last 5 hours of my life trying to figure this out...so I thought I'd be a nice guy and share what I learned.

Scenario

As the post title suggest, I'm using the Atahualpa theme with WHMCS in an Iframe for my web hosting site. Naturally, I wanted to encrypt the WHMCS checkout process, but I didn't want to encrypt every page on the site either.

Getting WHMCS to render in an Iframe actually wasn't too bad. I needed to configure WHMCS to use my https URL for encrypted pages, etc. I also had to find some javascript that would automatically resize the Iframe to the correct height. So far, so good.

The real difficulty came whenever I started trying to SEO the site. By default, Atahualpa embeds all the CSS and javascript that it uses in the head, which isn't very SEO. Fortunately, there is a nice little option to move both of them to an external file. I also needed to move my Iframe javascript to an external file.

Problem

As anyone that has much experience with SSL has probably already figured out, this "broke" my encrypted pages making them show up as partially encrypted. Typically, this is a pretty straight forward fix...one just has to change any occurrences of http to https. However, in the Atahualpa theme, these references are dynamically generated by PHP...and it just looks at the blog home URL as configured in the WordPress settings page...so it will always be http://examplehost.com... regardless of your current URL.

For the CSS, these lines are found in the header.php file.

Code:
<?php if ( $bfa_ata['css_external'] == "External" ) { ?>
<link rel="stylesheet" href="<?php echo $bfa_ata['get_option_home']; ?>/?bfa_ata_file=css" type="text/css" media="all" />
<?php } ?>
The lines that generates the JS reference are buried a bit deeper in the functions.php file.

Code:
function add_js_link() {
	global $bfa_ata;
	if ( $bfa_ata['javascript_external'] == "External" ) { ?>
        <script type="text/javascript" src="<?php echo $bfa_ata['get_option_home']; ?>/?bfa_ata_file=js"></script>
	<?php } 
}
Solution

Rewrite the code to generate the correct URI scheme (http or https) based on the current page URL. And no...I could not just hard code the URLs with https since this would "break" my unencrypted pages causing them to show up as partially encrypted.

Since I'm not much a programmer, I borrowed some code from Google. Specifically, the javascript they use to reference their analytics script via http or https, as shown below.

Code:
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
Modified for my purposes, it ends up looking like this.

For the CSS reference in header.php:

Code:
<?php if ( $bfa_ata['css_external'] == "External" ) { ?>
<script type="text/javascript">
var JsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
document.write(unescape("%3Clink rel='stylesheet' href='" + JsHost + "craigshost.com/?bfa_ata_file=css' type='text/css' media='all'/%3E"));
</script>
<?php } ?>
For the JS reference in functions.php:
Code:
function add_js_link() {
	global $bfa_ata;
	if ( $bfa_ata['javascript_external'] == "External" ) { ?>
	  <script type="text/javascript">
            var JsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
            document.write(unescape("%3Cscript src='" + JsHost + "craigshost.com/wp-includes/js/iframe/iframe.js' type='text/javascript'%3E%3C/script%3E"));
          </script>
	<?php } 
}
Now, my pages are more SEO (since my JS and CSS are external and not cluttering up the top of my page) and my SSL shows as fully encrypted on all the correct pages.
  #2  
Old Nov 27, 2011, 04:53 AM
DBF
 
2 posts · Nov 2011
Hi there! Tried the solution also to solve partially encrypted errors on ssl checkout, but it didnīt work for me (same as before). I am using WP 3.2.1 and Atahualpa 3.5.3. Can anybody help out??!? Otherwise I donīt know how to get a secure checkout for our clients with a good feeling.Thanks!
  #3  
Old Nov 27, 2011, 05:06 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
you might try the 'WordPress HTTPS (SSL)' plugin
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #4  
Old Nov 27, 2011, 05:21 AM
DBF
 
2 posts · Nov 2011
Hello Juggledad,
thanks for the hint. I already use this one, but it seems not to be able to fix the dynamic call of CSS and JS of Atahualpa. Would be nice if thereīs a workaround. I crafted a really nice and complete Online Shop System SEO optimized with Wordpress / Atahualpa and the german Shop Plugin WPShopgermany …

Last edited by DBF; Nov 27, 2011 at 06:12 AM.
  #5  
Old Nov 27, 2011, 06:44 AM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
@craig0927... Did you ever look at the WHMCS Bridge plugin?
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.

Bookmarks

Tags
iframe, partially encrypted, seo, ssl, whmcs

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Atahualpa SEO or All in one SEO debeerj Plugins & Atahualpa 4 Apr 12, 2010 10:28 PM
Should I turn on Atahualpa's SEO? lmt Center area post/pages 0 Feb 11, 2010 05:36 AM
All In One SEO vs. Atahualpa Alone Webmason Plugins & Atahualpa 6 Oct 29, 2009 03:13 PM
Advice on Using All in One SEO with Atahualpa Built in SEO Fields Romeo Kilo Plugins & Atahualpa 3 Oct 15, 2009 06:10 AM
[SOLVED] Newbie question - SEO plug ins and Atahualpa built in SEO jkgourmet Plugins & Atahualpa 1 Sep 26, 2009 04:33 PM


All times are GMT -6. The time now is 02:37 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.