Title: FIX for PHP errors and wrong location
Last modified: October 14, 2016

---

# FIX for PHP errors and wrong location

 *  [Michael Kastler](https://wordpress.org/support/users/mkastler/)
 * (@mkastler)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/fix-for-php-errors-and-wrong-location/)
 * Developer seems absent from this forum, but this is for them or anyone using 
   this plugin – the fix for errors is super easy, and is just correcting a syntax
   error/typo.
 * If you want to avoid that and use the stormia shortcode, you’ll need to update
   a few lines of code in the stormia.php file. The dev incorrectly used the variable
   $attrs instead of the correct $atts six times, starting around line 30. Here 
   is the _incorrect_ code:
 *     ```
         if(array_key_exists('lat', $attrs) && array_key_exists('lon', $attrs)) {
           $latlong = '&lat='.$attrs['lat'].'&lon='.$attrs['lon'];
         } else {
           $latlong = '';
         }
   
       	$html .= '<iframe src="https://stormia.io/embed?l='.$attrs["layer"].'&z='.$attrs["zoom"].$latlong.'" style="width:100%;border:0;margin-bottom:0;" height="'.$atts["height"].'" frameborder="'.$atts["frameborder"].'"></iframe><div style="width:100%;text-align:right;">'; 
       ```
   
 * If you replace those $attrs with $atts everything will work fine.
 * As an aside, this plugin is essentially just a shortcode for an iframe embed;
   you can easily do this without a plugin with just a little effort.
 * Hope that helps someone!

Viewing 1 replies (of 1 total)

 *  Thread Starter [Michael Kastler](https://wordpress.org/support/users/mkastler/)
 * (@mkastler)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/fix-for-php-errors-and-wrong-location/#post-8307420)
 * ANOTHER problem/fix – you may have noticed that the rain layer doesn’t display
   on load unless you specify it in the shortcode. This is more typos from the dev.
   Line 19 defines the default layer variable, and includes a comma at the end which
   needs to be removed.
 * Here is the _incorrect_ code:
 *     ```
       function stormia_embed_shortcode( $atts, $content = null ) {
       	$defaults = array(
           'url' => 'map', // using geolocation (default behavior of no url is provided)
       		'width' => '800',
       		'height' => '500',
           'layer' => 'rain,',
           'zoom' => '8',
           'frameborder' => '0'
       	);
       ```
   
 * Simply remove that comma from rain and you’ll be good to go.

Viewing 1 replies (of 1 total)

The topic ‘FIX for PHP errors and wrong location’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/stormia-live-weather-radar-map_cbd2a6.
   svg)
 * [Stormia - Live Weather Radar](https://wordpress.org/plugins/stormia-live-weather-radar-map/)
 * [Support Threads](https://wordpress.org/support/plugin/stormia-live-weather-radar-map/)
 * [Active Topics](https://wordpress.org/support/plugin/stormia-live-weather-radar-map/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/stormia-live-weather-radar-map/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/stormia-live-weather-radar-map/reviews/)

## Tags

 * [errors](https://wordpress.org/support/topic-tag/errors/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [weather](https://wordpress.org/support/topic-tag/weather/)

 * 1 reply
 * 1 participant
 * Last reply from: [Michael Kastler](https://wordpress.org/support/users/mkastler/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/fix-for-php-errors-and-wrong-location/#post-8307420)
 * Status: not resolved