Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

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

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

Build custom WP THEMES, without
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
Old Mar 9, 2010, 10:59 PM
2 posts · Mar 2010
Portland, OR
Send a message via MSN to craig0927 Send a message via Skype™ to craig0927
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.


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.


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.

<?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.

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 } 

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.

<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"));
Modified for my purposes, it ends up looking like this.

For the CSS reference in header.php:

<?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"));
<?php } ?>
For the JS reference in functions.php:
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"));
	<?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.
Old Nov 27, 2011, 04:53 AM
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!
Old Nov 27, 2011, 05:06 AM
juggledad's Avatar
23,390 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
Old Nov 27, 2011, 05:21 AM
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.
Old Nov 27, 2011, 06:44 AM
lmilesw's Avatar
10,172 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.


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 09:04 PM.

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