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 » New Versions, & Updating »

RFE: Replace iframe update check with non-iframe based check


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old May 16, 2011, 04:03 PM
mdmower's Avatar
mdmower
 
71 posts · Jul 2010
Missouri, USA
Atahualpa 3.6.7

In bfa_ata_admin.php, it is evident that the update check sits in an iframe. Running the Theme Check plugin returns this:
Code:
INFO: iframe was found in the file functions/bfa_ata_admin.php iframes are sometimes used to load unwanted adverts and code on your site.
Line 10: <iframe src='http://wordpress.bytesforall.com/update.php?theme=Atahualpa&ver
Line 11: echo $bfa_ata_version; ?>' width='98%' height='40' scrolling='no' frameborder='0'></iframe></td>
I have faced a problem where spam html and image files were magically appearing on my server (under wp-admin/js/tags and wp-content/plugins/index.php). Since this iframe sits inside the options editor, I understand it is unlikely to be the culprit. Regardless, wouldn't it be best to replace this iframe and kill off one more warning?

Below is an example of one way to accomplish the goal.

Styles which should be available to bfa_ata_admin.php:
Code:
<style>
	div#updateDivBox {background: #eaf7e1; font-size: 14px; font-family: "Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif; color: #555555; padding: 5px 10px 5px 10px; margin: 10px 0 0 0; border: solid 1px #83d04f; -moz-border-radius: 5px; -khtml-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px;}
	div#updateDivBox a:link, div#updateDivBox a:active, div#updateDivBox a:visited {color: #487630;}
	div#updateDivBox a:hover {color: #900;}
</style>
Javascript which should be available to bfa_ata_admin.php, and which should be executed via onLoad:
Code:
<script type="text/javascript">
	function checkForUpdate() {
		var bfa_ata_version = "<?php echo $bfa_ata_version; ?>";
	
		var update_url = "http://wordpress.bytesforall.com/update_check.php";
		if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } // IE7+, Firefox, Chrome, Opera, Safari
		else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } // IE5, IE6
		
		xmlhttp.open("GET",update_url,false);
		xmlhttp.send();
		var bfa_ata_latest_version = xmlhttp.responseText;
		
		if ( bfa_ata_version != bfa_ata_latest_version ) {
			var htmlReplacement = "Atahualpa version " + bfa_ata_latest_version + " is available. <a href=\"http://wordpress.bytesforall.com\" target=\"_top\">Have a look</a>";
			document.getElementById("updateDivBox").innerHTML=htmlReplacement;
		} else {
			var htmlReplacement = "You have the latest version of Atahualpa.";
			document.getElementById("updateDivBox").innerHTML=htmlReplacement;
		}
	}
</script>
Replacement for what is currently at Lines 10 & 11 in bfa_ata_admin.php:
Code:
<div id="updateDivBox" >Automatic update check did not succeed. Visit <a href="http://wordpress.bytesforall.com" target="_top">this website</a> to check for the latest version.</div></td>
New update_check.php file which should be hosted on your server:
Code:
<?php
	echo '3.6.8';
?>

Last edited by mdmower; Jun 11, 2011 at 09:21 AM. Reason: css wasn't quite right
  #2  
Old May 16, 2011, 05:44 PM
juggledad's Avatar
juggledad
 
22,186 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
I've passed this on to the developer.
__________________
Give a person a solution, you fix one issue, teach a person how to solve their problem you enable them forever.
Juggledad | Forum Moderator/Support

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check if input in fields are the same Zenman Plugins & Atahualpa 1 Mar 5, 2011 03:36 AM
3.6.1 gets a blank page - check this out paul_williams New Versions, & Updating 22 Feb 5, 2011 08:45 AM
Problem with google map iframe, IE scrolls down to post with iframe Björn Palovaara Center area post/pages 1 Apr 9, 2010 02:32 PM


All times are GMT -6. The time now is 11:57 PM.


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