Title: Undefined variable
Last modified: August 30, 2016

---

# Undefined variable

 *  [martineva](https://wordpress.org/support/users/martineva/)
 * (@martineva)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/undefined-variable-23/)
 * Hello !
    I’m using successfully your plugin in several websites, but I have a
   problem with one of them … When i go to the “hnow my ranking” report, i get this
   error message : Notice: Undefined variable: label in /home/mywebsite database/
   www/wp-content/plugins/google-rank-tracker/includes/KnowMyRankingsAdmin.php on
   line 867 this message displays under each keyword I asked to check, and results
   are not showing, it just keeps searching infinitely.
 * Here is the part of the code that is in cause :
 *     ```
       public function position( $keyword ) {
   
       			if ( isset ( $keyword['last_7day'] ) && $keyword['last_7day'] != 0 ) {
   
       				$position = $keyword['last_7day'] - $keyword['current_rank'];
   
       				if ( $position > 0 ) {
       					$class = "up";
       					$label = "Up $position";
       				}
       				if ( $position < 0 ) {
       					$class = "down";
       					$label = "Down " . abs( $position );
       				}
       				if ( $position == 0 ) {
       					$label = "No change";
       				}
   
       				echo "<div class=\"position $class\">
       					<span class=\"triangle\"></span>
       					<span class=\"desc\">$label</span> "
       					.__( "since last week", "know-my-rankings" ).
       				"</div>";
       			}
       			else
       				echo "<div class=\"position\">
       					<span class=\"desc\">$label</span>&nbsp;</div>";
       		}
       ```
   
 * The 867 line is the last one :
    `<span class=\"desc\">$label</span>&nbsp;</div
   >";`
 * Do you have an idea what the problem could be ? thanks
 * [https://wordpress.org/plugins/google-rank-tracker/](https://wordpress.org/plugins/google-rank-tracker/)

Viewing 1 replies (of 1 total)

 *  [themesama](https://wordpress.org/support/users/themesama/)
 * (@themesama)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/undefined-variable-23/#post-6189156)
 * Try this line 😉
 *     ```
       <span class=\"desc\">".(!empty( $label ) ? $label : '')."</span>
       ```
   

Viewing 1 replies (of 1 total)

 The topic ‘Undefined variable’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/google-rank-tracker_798d9f.svg)
 * [Google Rank Tracker](https://wordpress.org/plugins/google-rank-tracker/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-rank-tracker/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-rank-tracker/)
 * [Active Topics](https://wordpress.org/support/plugin/google-rank-tracker/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-rank-tracker/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-rank-tracker/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [themesama](https://wordpress.org/support/users/themesama/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/undefined-variable-23/#post-6189156)
 * Status: not resolved