WPIntell

Source evidence

Undefined Variable Error (Version 3.0)

Weather Atlas Widget · support · 2024-04-30T05:43:00+00:00

mixedsentiment
mediumseverity
0.84relevance
3replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

3 / 28 rows with source links

10.7% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

25 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
farnely resolved
Latest version is throwing the following error:- PHP Warning: Undefined variable $url_units in /wp-content/plugins/weather-atlas/includes/class-weather-atlas.php on line 1020 Same problem here unfortunately. Giving the variable a default value if no value is set resolves the error. Steps to Resolve the Issue: weather-atlas/includes/class-weather-atlas.php Edit this file right above the 1020 line. // Steps to Resolve the Issue: Define $url_units Early in the Code: Before the snippet you posted, ensure that $url_units is defined. This might be based on a setting in the plugin or a default value: if ( !isset($url_units) ) { $url_units = '?units=metric'; // Or whatever default makes sense } // Add the link or branding to the footer if ( $random_url <= 4 ) { echo "<a href='" . esc_url( $url . $url_units ) . "' title='" . esc_attr( ${'city_name_' . $language_root_wp} ) . ", " . esc_attr( $country_name_abbr ) . " - " . esc_attr( $title ) . "' style='color:" . esc_attr( $text_color ) . "'>"; echo "<span class='weather-atlas-footer-block'>"; echo esc_html( ${'city_name_' . $language_root_wp} ) . ", " . esc_html( $country_name_abbr ); echo "</span>"; echo " " . esc_html( strtolower( $title ) ) . " ▸"; echo "</a>"; } This reply was modified 2 years ago by Kristof Loyens Quantum Leap . @quantum-leap This isn’t the first time the developer/s have released a version containing basic coding errors and I doubt it will be the last. I got fed up of waiting for them to acknowledge the issue when I reported it let alone put it right and have now removed the plugin from my site. But thanks to you for sharing the solution. The bug has been fixed. Update to 3.0.1 Note: the bug does not appear in all WP versions/locations. Pls notify if more bugs appear, or this issue persists with your version.

Comments

3 shown
Kristof Loyens Quantum Leap 2024-05-06T11:54:00+00:00

Same problem here unfortunately. Giving the variable a default value if no value is set resolves the error. Steps to Resolve the Issue: weather-atlas/includes/class-weather-atlas.php Edit this file right above the 1020 line. // Steps to Resolve the Issue: Define $url_units Early in the Code: Before the snippet you posted, ensure that $url_units is defined. This might be based on a setting in the plugin or a default value: if ( !isset($url_units) ) { $url_units = '?units=metric'; // Or whatever default makes sense } // Add the link or branding to the footer if ( $random_url <= 4 ) { echo "<a href='" . esc_url( $url . $url_units ) . "' title='" . esc_attr( ${'city_name_' . $language_root_wp} ) . ", " . esc_attr( $country_name_abbr ) . " - " . esc_attr( $title ) . "' style='color:" . esc_attr( $text_color ) . "'>"; echo "<span class='weather-atlas-footer-block'>"; echo esc_html( ${'city_name_' . $language_root_wp} ) . ", " . esc_html( $country_name_abbr ); echo "</span>"; echo " " . esc_html( strtolower( $title ) ) . " ▸"; echo "</a>"; } This reply was modified 2 years ago by Kristof Loyens Quantum Leap .

farnely 2024-05-06T14:31:00+00:00

@quantum-leap This isn’t the first time the developer/s have released a version containing basic coding errors and I doubt it will be the last. I got fed up of waiting for them to acknowledge the issue when I reported it let alone put it right and have now removed the plugin from my site. But thanks to you for sharing the solution.

Weather Atlas 2024-05-07T15:44:00+00:00

The bug has been fixed. Update to 3.0.1 Note: the bug does not appear in all WP versions/locations. Pls notify if more bugs appear, or this issue persists with your version.