• Resolved Becc

    (@superbecc)


    Hey dude. I’ve got the following Notices coming up in the terminal when I have WP_DEBUG set to true in my wp-config:

    Notice: Undefined index: SERVER_PORT in /sites/it/www/htdocs/wp-content/plugins/simple-side-tab/simple_side_tab.php on line 106
    Notice: Undefined index: SERVER_NAME in /sites/it/www/htdocs/wp-content/plugins/simple-side-tab/simple_side_tab.php on line 107

    Obviously it’s no biggie and not a show-stopper but would appreciate if you could take a look at this when you get a chance? It’s making the results of updating via WP-CLI (which logs debug stuff to the terminal window) look far more ominous than it really ought to! ??

    https://www.ads-software.com/plugins/simple-side-tab/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author srumery

    (@srumery)

    Hi Becc,

    I have not seen this error on my development machine or any staging environment either. What is the address of the site so I can take a look at it?

    I think I can check isset() in the code on those lines to check the variables. They should be there but maybe there are cases where they are not available. I will do that I can to test this out. If you have code to fix it, please submit it and I’ll test it out.

    I have opened a GitHub issue to get to the bottom of this. Here it is for your reference:
    https://github.com/rumspeed/simple-side-tab/issues/10

    Thank you for using Simple Side Tab.

    Thread Starter Becc

    (@superbecc)

    Hey Scot, thanks for responding. Looking at it again, I’ve realised it’s only going to be a WP-CLI problem, so you may or may not want to do anything about it: sorry to have jumped the gun and gotten you concerned. It’s because it’s command line PHP I’m using (WP-CLI being a command line interface to WordPress); the $_SERVER array isn’t getting set because there is no web server invoking it. Hence the PHP notices on the command line as I attempt to perform updates using WP-CLI. I’ve found a few other reports of people using WP-CLI and having similar issues where the $_SERVER array is referenced, eg https://github.com/wp-cli/wp-cli/issues/1734 and https://github.com/wp-cli/wp-cli/issues/785#issuecomment-138040347

    You’re right, checking isset() would solve them. When I wrapped everything in the rum_get_full_url() function with ‘if(isset($_SERVER[“SERVER_NAME”]))’, the notices ceased.

    I’ll copy this reply over at the github issue for if you want to go ahead with the change you suggested, though totally understand if you don’t. Thanks again for getting back to me about it!

    Plugin Author srumery

    (@srumery)

    Thank you for the great follow up, Becc. I have implemented the change and it will be available on the next release. I’m planning on having it completed within the week. It’s currently fixed on GitHub on a branch but not rolled into master and tagged just yet.

    Thread Starter Becc

    (@superbecc)

    Awesome! Thanks again!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP notices: Undefined index SERVER_PORT and SERVER_NAME’ is closed to new replies.