• Hello,

    I’ve installed Awesome Weather Widget and obtained an API key from Open Weather, but am receiving the following Notice:

    Notice: Undefined property: stdClass::$deg in /path/to/wp-content/plugins/awesome-weather/awesome-weather.php on line 277

    It may or may not be worth mentioning that the site is installed at a sub-directory (for development), though the API key is for the domain and not its subdirectory. (domain.com vs domain.com/sub)

    https://wordpress.org/plugins/awesome-weather/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Hal Gatewood

    (@halgatewood)

    This looks like an issue with the data provided. That line is checking for the wind speed which should be there but it probably empty. I’ll add more error checking in a future version to minimize these errors.

    It will most likely fix itself when the weather updates. If you could post the city or city id you are using it would help me debug a bit more.

    Thanks.

    Thread Starter wmaurojr

    (@wmaurojr)

    Thanks Hal,

    It’s a great plugin and we really love using it. Any way to hide PHP Notices (as opposed to errors)?

    The City we’re using is Avoca, PA 5178741.

    Thanks again.

    Hi Hal

    Same problem here:

    Notice: Undefined property: stdClass::$deg in /…/plugins/awesome-weather/awesome-weather.php on line 273

    City is Vaison-la-Romaine (France), 2971154

    Widget displays fine, but with the error message above which is a petty. May be error messages could be suppressed ?

    Cheers, Marc

    Plugin Author Hal Gatewood

    (@halgatewood)

    @wmaurojr this page shows how you can turn off PHP notices: http://stackoverflow.com/questions/2867057/how-do-i-turn-off-php-notices

    @marc.fries I looked at the weather data and the error should be gone. If not try adding ?clear_awesome_widget to the end of your URL.

    I have a note for a future release to better check if the variables exist before trying to use them.

    Thread Starter wmaurojr

    (@wmaurojr)

    Hello again,

    Getting this now:

    Notice: Undefined property: stdClass::$name in /home/…/…/…/wp-content/plugins/awesome-weather/awesome-weather.php on line 267

    Notice: Undefined property: stdClass::$list in /home/…/…/…/wp-content/plugins/awesome-weather/awesome-weather.php on line 379

    I saw you mentioned turning off php notices–if possible I’d prefer to turn them off for the plugin but not the rest of the site (ie not via php.ini). Would you suggest editing the plugin file and adding the code back each time there’s an update?

    Thanks

    Plugin Author Hal Gatewood

    (@halgatewood)

    Hi @wmaurojr
    Are you on version 1.5.7 of my plugin?

    I guess if you don’t want to turn off the display of notices then that would be your best bet.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Notice: Undefined property: stdClass::$deg’ is closed to new replies.