[Plugin: Weather Forecast – WP Wunderground] Patch to make godaddy hosting work without a php5.ini
-
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)) {
- The topic ‘[Plugin: Weather Forecast – WP Wunderground] Patch to make godaddy hosting work without a php5.ini’ is closed to new replies.