• Resolved Erik Tadevosyan

    (@eriktadevosyan)


    Hello

    I have some errors in woo-rfq-for-woocommerce.php on line 273 and
    gpls_woo_rfq_functions.php on line 2111.

    Undefined index: HTTP_HOST.This error I resave in wp-cli. You use $_SERVER[‘HTTP_HOST’] variable, which is undefined in CLI.

    Thank you!!!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Erik Tadevosyan

    (@eriktadevosyan)

    You can use this code fragment in the plugin init action

    if ( defined(‘WP_CLI’) ) {
    return;
    }

    and we can define WP_CLI in config file and resolve notice

    Thread Starter Erik Tadevosyan

    (@eriktadevosyan)

    Or like this code, you can find a better way. Thank you!

    Plugin Author Neah Plugins

    (@gplsaver)

    Please replace $_SERVER[‘HTTP_HOST’] with

    global $wp;
    $http_host = home_url( $wp->request );

    I will replace in the next update

    Plugin Author Neah Plugins

    (@gplsaver)

    Also, I am not sure why it was causing a crashing error. It should have caused a warning

    • This reply was modified 5 years, 4 months ago by Neah Plugins.
    Thread Starter Erik Tadevosyan

    (@eriktadevosyan)

    Thank you very much,
    You are completely right, it generates warning message, but we are monitoring our logs, so, it’s annoying to see them every time.

    I agree that using $wp->request will stop generating warning, however, I assume that it will be better to not run part of codes in WP CLI, if they are address to end user (i.e. cart, product single page etc).

    Anyway, you know better than me, so, just to have that warning fixed will be huge improvment for us.

    Plugin Author Neah Plugins

    (@gplsaver)

    I have removed all references to $_SERVER[‘HTTP_HOST’].

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘WP_CLI : Undefined index HTTP_HOST’ is closed to new replies.