{"id":6188851,"date":"2015-06-02T07:23:18","date_gmt":"2015-06-02T07:23:18","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/undefined-variable-23\/"},"modified":"2016-08-30T14:00:25","modified_gmt":"2016-08-30T14:00:25","slug":"undefined-variable-23","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/undefined-variable-23\/","title":{"rendered":"Undefined variable"},"content":{"rendered":"<p>Hello !<br \/>\nI&#8217;m using successfully your plugin in several websites, but I have a problem with one of them &#8230; When i go to the &#8220;hnow my ranking&#8221; report, i get this error message :<br \/>\nNotice: Undefined variable: label in \/home\/mywebsite database\/www\/wp-content\/plugins\/google-rank-tracker\/includes\/KnowMyRankingsAdmin.php on line 867<br \/>\nthis message displays under each keyword I asked to check, and results are not showing, it just keeps searching infinitely.<\/p>\n<p>Here is the part of the code that is in cause :<\/p>\n<pre><code>public function position( $keyword ) {\n\n\t\t\tif ( isset ( $keyword[&#039;last_7day&#039;] ) &amp;&amp; $keyword[&#039;last_7day&#039;] != 0 ) {\n\n\t\t\t\t$position = $keyword[&#039;last_7day&#039;] - $keyword[&#039;current_rank&#039;];\n\n\t\t\t\tif ( $position &gt; 0 ) {\n\t\t\t\t\t$class = &quot;up&quot;;\n\t\t\t\t\t$label = &quot;Up $position&quot;;\n\t\t\t\t}\n\t\t\t\tif ( $position &lt; 0 ) {\n\t\t\t\t\t$class = &quot;down&quot;;\n\t\t\t\t\t$label = &quot;Down &quot; . abs( $position );\n\t\t\t\t}\n\t\t\t\tif ( $position == 0 ) {\n\t\t\t\t\t$label = &quot;No change&quot;;\n\t\t\t\t}\n\n\t\t\t\techo &quot;&lt;div class=\\&quot;position $class\\&quot;&gt;\n\t\t\t\t\t&lt;span class=\\&quot;triangle\\&quot;&gt;&lt;\/span&gt;\n\t\t\t\t\t&lt;span class=\\&quot;desc\\&quot;&gt;$label&lt;\/span&gt; &quot;\n\t\t\t\t\t.__( &quot;since last week&quot;, &quot;know-my-rankings&quot; ).\n\t\t\t\t&quot;&lt;\/div&gt;&quot;;\n\t\t\t}\n\t\t\telse\n\t\t\t\techo &quot;&lt;div class=\\&quot;position\\&quot;&gt;\n\t\t\t\t\t&lt;span class=\\&quot;desc\\&quot;&gt;$label&lt;\/span&gt;&amp;nbsp;&lt;\/div&gt;&quot;;\n\t\t}<\/code><\/pre>\n<p>The 867 line is the last one :<br \/>\n <code>&lt;span class=\\&quot;desc\\&quot;&gt;$label&lt;\/span&gt;&amp;nbsp;&lt;\/div&gt;&quot;;<\/code><\/p>\n<p>Do you have an idea what the problem could be ? thanks<\/p>\n<p>https:\/\/wordpress.org\/plugins\/google-rank-tracker\/<\/p>\n","protected":false},"template":"","class_list":["post-6188851","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/6188851","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/6188851\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=6188851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}