Hi, please help!
I’m getting the following error displaying in place of the weather plugin on my homepage. The plugin was working until I updated to WordPress 4.4.2 but now the plugin fails 80%-90% of the time, every now and then I load the page and it works fine, but the rest of the time I see only the error message
Fatal error: Call to a member function get_forecasts() on a non-object in /home/wwwgreys/public_html/wp-content/plugins/yahoo-weather-forecasts/yahoo!-wheather.php on line 61
I have access to the site files but I am not the one who installed the plugin or setup the site originally. The cod referenced in the error is as follows. Hope you can help, thanks.
LINE 28 – 66
function yahoo_weather_simplepie( $woeid, $temperature = ‘c’, $show_credit = true ) {
if( empty( $woeid ) )
return __(‘Please provide the WOEID.’, ‘yahoo-weather’);
if( function_exists(‘fetch_feed’) ) {
require_once ( ABSPATH . WPINC . ‘/class-simplepie.php’ );
require_once ( trailingslashit( YAHOO_WEATHER_DIR ) . ‘simplepie_yahoo_weather.inc’);
$feed = new SimplePie();
/* specify the feed source */
$param = ‘https://weather.yahooapis.com/forecastrss?w=’ . $woeid . ‘&u=’ . $temperature;
//$param = YAHOO_WEATHER_URL . ‘forecastrss.xml’;
$feed->set_feed_url( $param );
$feed->set_cache_location( YAHOO_WEATHER_DIR . ‘cache’);
$feed->set_item_class(‘SimplePie_Item_YWeather’);
// Initialize the feed
$feed->init();
// Since Y! Weather feeds only have one item, we’ll base everything around that.
$weather = $feed->get_item(0);
/**
* if the feed is broken, or having problem to get the feed
* and maybe there is no item in the feed then print the ‘content’
*/
foreach ( $weather->get_forecasts() as $forecast ) {
$date = $forecast->get_date(‘l, F jS’);
$low = $forecast->get_low();
$high = $forecast->get_high();
$label = $forecast->get_label();
}
https://www.ads-software.com/plugins/yahoo-weather-forecasts/
]]>Plugin is broken and created error in website core file.
https://www.ads-software.com/plugins/yahoo-weather-forecasts/
]]>hi
the Yahoo! Weather Forecasts does work for the past few days on my end
any ideas why?
thanks
https://www.ads-software.com/plugins/yahoo-weather-forecasts/
]]>Unit signs are missing from several places.
For example the temperature should be:
$content .= ‘<p class=”temperature”>’ . $weather->get_temperature() . ‘ °’ . $weather->get_units_temp() . ‘</p>’;
(the “$weather->get_units_temp()”) was missing.
https://www.ads-software.com/extend/plugins/yahoo-weather-forecasts/
]]>Well, that’s odd – the forums seem to have marked my post as closed before it’s even been opened.
So, reposting my simple bug report:
On line 96 of yahoo!-wheather.php, if credits are not shown, $credit is undefined, throwing a “Notice: Undefined variable” when WP_DEBUG is set to true.
The simple fix is to define it as empty on the previous line, ie:
$credit = '';
if ( $show_credit ) $credit = ' & <a href="https://zourbuth.com/plugins/yahoo-weather/">zourbuth.com</a>';
Cheers,
Christian
https://www.ads-software.com/extend/plugins/yahoo-weather-forecasts/
]]>Great plugin. The only question I have can I display the forecast for a day or two ahead rather than just the current day? Thanks.
https://www.ads-software.com/extend/plugins/yahoo-weather-forecasts/
]]>Hi,
can your plugin be modified to only show the weather forecast for a specific date/weekend, as soon as there are some informations available?
https://www.ads-software.com/extend/plugins/yahoo-weather-forecasts/
]]>Hello,
This plugin doesn’t seem to be updating very often. I’d like to change the settings so that it’s getting cached every 5, or maybe 10 minutes. Where do I specify this in the php?
Thanks,
-Brian
https://www.ads-software.com/extend/plugins/yahoo-weather-forecasts/
]]>This plugin would be awesome, except for the lack of GeoIP abilities, to autodetect a visitor’s location.
Weather apps, without this ability are useless. Why would anyone want to set the weather for a specific city, when the people visiting their website can be from all over the world?
Check out https://www.ads-software.com/extend/plugins/weather-for-us-widget/
…for how GeoIP should be integrated into a weather app. Though there are still some very basic, functional issues with this plugin, too, they are working to improve on it.
https://www.ads-software.com/extend/plugins/yahoo-weather-forecasts/
]]>