{"id":1804538,"date":"2010-12-08T13:31:03","date_gmt":"2010-12-08T13:31:03","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/plugin-weather-forecast-wp-wunderground-patch-to-make-godaddy-hosting-work-without-a-php5ini\/"},"modified":"2016-08-19T20:58:02","modified_gmt":"2016-08-19T20:58:02","slug":"plugin-weather-forecast-wp-wunderground-patch-to-make-godaddy-hosting-work-without-a-php5ini","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/plugin-weather-forecast-wp-wunderground-patch-to-make-godaddy-hosting-work-without-a-php5ini\/","title":{"rendered":"[Plugin: Weather Forecast &#8211; WP Wunderground] Patch to make godaddy hosting work without a php5.ini"},"content":{"rendered":"<p>GoDaddy hosting is fairly particular about how you connect to other systems. I&#8217;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<\/p>\n<pre><code>--- wunderground.php\t2010-12-08 07:28:20.000000000 -0600\n+++ wunderground.php.new\t2010-12-08 07:29:09.000000000 -0600\n@@ -422,7 +422,8 @@\n \t\t}\n\n \t    if(!$table || !$cache || isset($_REQUEST[&#039;cache&#039;])) {\n-\t\t\tif(!$xml=simplexml_load_file($this-&gt;url.$location)){\n+                        $xmlStr = wp_remote_fopen($this-&gt;url.$location);\n+\t\t\tif(!$xml=simplexml_load_string($xmlStr)){\n \t\t\t\ttrigger_error(&#039;Error reading XML file&#039;,E_USER_ERROR);\n \t\t\t\treturn &#039;&lt;!-- WP Wunderground Error : Error reading XML file at &#039;.$this-&gt;url.$this-&gt;location.&#039; --&gt;&#039;.$content;\n \t\t\t} elseif(empty($xml-&gt;simpleforecast-&gt;forecastday)) {<\/code><\/pre>\n<p>https:\/\/wordpress.org\/extend\/plugins\/wunderground\/<\/p>\n","protected":false},"template":"","class_list":["post-1804538","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1804538","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1804538\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=1804538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}