Hi,
Thanks for your input. This issue has been resolved. Please update the plugin to version 1.2.0.
Kind regards.
The Alfie Team
Hi,
Thanks for your answer. But now there’s new issue at alfie.weather.min.js?ver=3.9:22. Same “Cannot read property ‘indexOf’ of null” error.
Thanks in advance 😉
Hi,
Where do you see this error, on site or on admin?
Thanks.
On site. This is the site: http://velikakladusa.gov.ba/
The Weather widget should be under “Vrijeme” title in the right sidebar.
Hi,
This is a documented issue, please make sure your server has allow_url_fopen enabled.
More on this here -> http://wordpress.org/support/topic/widget-only-displaying-title?replies=10
Hope this helps.
Best regards.
The Alfie Team
I’ve replaced part of your getfeed.php file, and now it’s ok. The problem was with allow_url_fopen. I’ve replaced file_get_contents with curl and now it’s ok. Here’s the code:
// Get the JSON encoded response from Yahoo! API. (added cURL)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) user/2010 Firefox/1.0");
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
$json = curl_exec($ch);
curl_close($ch);
error_log($json);
//$json = file_get_contents( $api, 0, null, null ); // This is the old line
// Decode the response so we can translate the condition codes and week days
$decoded = json_decode( $json );
Hi,
That will be a temporary fix, which will be overwritten if you update the plugi-in. We’ll probably add a “plan B” solution involving cURL, in case allow_url_fopen is not enabled, but still, there are less chances for cURL to be installed on a budget server than allow_url_fopen enabled.
We will try to implement this in the next version.
Best regards.
The Alfie Team