WordPress.org

Ready to get started?Download WordPress

Forums

Weather Forecast - WP Wunderground
[resolved] Patch to make godaddy hosting work without a php5.ini (1 post)

  1. rjune
    Member
    Plugin Author

    Posted 3 years ago #

    GoDaddy hosting is fairly particular about how you connect to other systems. I've found that using wp_remote_fopen to pull in the text of a remote URL, then acting on that string is generally more reliable than using other PHP functions on remote URLs

    --- wunderground.php	2010-12-08 07:28:20.000000000 -0600
    +++ wunderground.php.new	2010-12-08 07:29:09.000000000 -0600
    @@ -422,7 +422,8 @@
     		}
    
     	    if(!$table || !$cache || isset($_REQUEST['cache'])) {
    -			if(!$xml=simplexml_load_file($this->url.$location)){
    +                        $xmlStr = wp_remote_fopen($this->url.$location);
    +			if(!$xml=simplexml_load_string($xmlStr)){
     				trigger_error('Error reading XML file',E_USER_ERROR);
     				return '<!-- WP Wunderground Error : Error reading XML file at '.$this->url.$this->location.' -->'.$content;
     			} elseif(empty($xml->simpleforecast->forecastday)) {

    http://wordpress.org/extend/plugins/wunderground/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic