{"id":12369187,"date":"2020-01-27T14:43:50","date_gmt":"2020-01-27T14:43:50","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/php-errors-in-wp-cli\/"},"modified":"2020-01-27T14:43:50","modified_gmt":"2020-01-27T14:43:50","slug":"php-errors-in-wp-cli","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/php-errors-in-wp-cli\/","title":{"rendered":"PHP Errors in WP-CLI"},"content":{"rendered":"<p>I use the <a href=\"https:\/\/wp-cli.org\/\" rel=\"noopener noreferrer\" target=\"_blank\">WordPress CLI<\/a> to manage and deploy sites. When I have WP_DEBUG enabled and this plugin activated I consistently get noise in the responses around the following PHP notices from lines in your function <code>current_page_url()<\/code><\/p>\n<pre><code>Notice: Undefined index: SERVER_PORT in \/Users\/me\/Sites\/site\/wp-content\/plugins\/ajax-search-lite\/includes\/functions\/functions.php on line 570\nNotice: Undefined index: SERVER_PORT in \/Users\/me\/Sites\/site\/wp-content\/plugins\/ajax-search-lite\/includes\/functions\/functions.php on line 571<\/code><\/pre>\n<p>It would be great if you could wrap those references to <code>$_SERVER[&quot;SERVER_PORT&quot;]<\/code> with an <code>isset()<\/code> or <code>array_key_exists()<\/code> in a future version.<\/p>\n","protected":false},"template":"","class_list":["post-12369187","topic","type-topic","status-publish","hentry","topic-tag-wp-cli"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/12369187","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\/12369187\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=12369187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}