Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   New Versions, & Updating (http://forum.bytesforall.com/forumdisplay.php?f=12)
-   -   RFE: Replace iframe update check with non-iframe based check (http://forum.bytesforall.com/showthread.php?t=14190)

mdmower May 16, 2011 04:03 PM

RFE: Replace iframe update check with non-iframe based check
 
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';
?>


juggledad May 16, 2011 05:44 PM

I've passed this on to the developer.


All times are GMT -6. The time now is 01:57 AM.

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