Support » Plugin: National Weather Service Alerts » Doesn't display any alerts when they are issued

  • Resolved smlombardi

    (@smlombardi)


    I have 1.3.1 installed and configured for Poughkeepsie, NY. No errors.

    In the past week the NWS issued a few alerts for severe thunderstorms and flash floodings, and when my client checked her site there were no alerts on the plugin.

    For now, I’ve disabled it since it’s embarrassing. Why is it not getting the alerts.

    I have it set to “county”

    https://wordpress.org/plugins/national-weather-service-alerts/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author John Russell

    (@laubsterboy)

    Hi, smlombardi. I’m sorry to hear that you’re having problems with the NWS Alerts plugin. Since it’s not reporting any errors, and I’ve verified that Poughkeepsie is in the locations database as being in Dutchess county, it seems most likely that there is either a problem retrieving the alerts from NWS or the alerts were not warnings, but rather watches or advisories.

    First, can you verify that alerts are being retrieved properly by changing the scope from “county” to “national”. This should list all NWS warnings for the entire U.S. If nothing shows up then we’ve likely found the problem. NWS Alerts uses CURL or simplexml_load_file to load the alert data from NWS, and these must be installed and setup (or allowed in the case of simplexml_load_file) by the web host or administrator.

    If alerts are showing up when the scope is set to “national”, then is it possible that the active alerts were only watches or advisories? By default the NWS Alerts plugin only shows warnings.

    -laubsterboy

    Yes, I’ve been reading other help posts here and now I see that it’s only warnings, and only the ones on the list.

    Hard to explain to a client when her iPhone shows “alerts”, “watches”, and “advisories” why the site is blank.

    You might want to add more options to the plugin. In our area (southeast NY state) we rarely get warnings. We often get the other types, which can also cause power outages (my client’s business is generators), for example thunderstorm watch, flash flood watch, etc.

    Perhaps add config settings to display these or all notifications?

    Plugin Author John Russell

    (@laubsterboy)

    I certainly understand, and do plan to add more options in the future, but haven’t had the time to implement them. I’m hoping to have a default option for which alerts (warnings, watches, and advisories) to show and then the same option per widget/shortcode so it can be customized to the needs of the area being observed.

    For now the only way to customize this is to use the ‘nws_alerts_allowed_alert_types’ filter, which can be added to a theme functions.php file.

    An example (based on your feedback) would be something like this:

    function custom_nws_alerts_allowed_alert_types($allowed_alert_types) {
        $allowed_alert_types[] = 'Tornado Watch';
        $allowed_alert_types[] = 'Severe Thunderstorm Watch';
        $allowed_alert_types[] = 'Flash Flood Watch';
        $allowed_alert_types[] = 'Flood Watch';
        $allowed_alert_types[] = 'High Wind Watch';
        $allowed_alert_types[] = 'Winter Storm Watch';
        $allowed_alert_types[] = 'Fire Weather Watch';
        $allowed_alert_types[] = 'Frost Advisory';
        $allowed_alert_types[] = 'Heat Advisory';
    
        return $allowed_alert_types;
    }
    add_filter('nws_alerts_allowed_alert_types', 'custom_nws_alerts_allowed_alert_types');

    You can remove any line that you don’t want to show. If there are any others that you want to show up, just add them in the same way. I plan to keep this filter in place indefinitely, at the widget/shortcode scope, so it’s safe to use through plugin updates.

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Doesn't display any alerts when they are issued’ is closed to new replies.