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

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


  #1  
Old May 16, 2011, 04:03 PM
mdmower's Avatar
mdmower
 
76 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
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
I've passed this on to the developer.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
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 02:38 AM.


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