{"id":2538205,"date":"2012-01-30T15:47:26","date_gmt":"2012-01-30T15:47:26","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/plugin-wp-manage-plugins-php-errors-patch-includes\/"},"modified":"2016-08-20T04:45:23","modified_gmt":"2016-08-20T04:45:23","slug":"plugin-wp-manage-plugins-php-errors-patch-includes","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/plugin-wp-manage-plugins-php-errors-patch-includes\/","title":{"rendered":"[Plugin: WP Manage Plugins] PHP errors (patch included)"},"content":{"rendered":"<p>As reported by various other users, there are some simple errors in this plugin causing error messages to print out in the footer, due to unassigned variables being accessed.<\/p>\n<p>(one of them gets assigned the first time you click on &#8220;ignore updates&#8221; on a plugin.   I&#8217;m not sure when the other one gets assigned).<\/p>\n<p>But, it is good practice to check whether a variable is null before doing an operation on it anyway.<\/p>\n<p>Here is the fix:<\/p>\n<pre><code>Index: inc\/admin.php\n===================================================================\n--- inc\/admin.php       (revision 12654)\n+++ inc\/admin.php       (working copy)\n@@ -194,11 +194,17 @@\n     }\n        \/\/BRM loop through $update_plugins pull out keys strip to 1st\/ match against new array count_arr2 built from keys of count_arr  striped to 1st \/\n        $count_arr = get_option(&#039;plugin_update_ignore&#039;);\n+       $count_arr2 = array();\n+       if(is_array($count_arr)){\n        foreach ($count_arr as $key =&gt; $value) {\n                $length=strpos($key,&quot;\/&quot;);\n                $result=substr($key,$start,$length);\n                $count_arr2[]=$result;\n        }\n+       }\n+       $unlocked_4_update = 0;\n+\n+       if(is_array($update_plugins)){\n        foreach ($update_plugins as $v) {\n        $i=$i+1;\n                $sub_arr=$v;\n@@ -212,6 +218,7 @@\n                        }\n                }\n        }\n+       }\n        $locked_count=$updates_4_locked;\n     $total_update_count = $update_count - $locked_count;\n     $js = array();<\/code><\/pre>\n<p>https:\/\/wordpress.org\/extend\/plugins\/wp-manage-plugins\/<\/p>\n","protected":false},"template":"","class_list":["post-2538205","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2538205","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\/2538205\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=2538205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}