• When wp-cassify is installed and I run any WP-CLI command, I get a number of spurious warnings, presumably because it’s not being run in a web context.

    PHP Warning: Undefined array key "SERVER_PORT" in /srv/napd-mygideon-wordpress/src/web/app/plugins/wp-cassify/classes/wp_cassify_utils.php on line 105

    (also occurs on wp_cassify_utils.php lines 98, 101, and 102)

    This doesn’t affect the functionality of the plugin or the rest of the site, it’s just a minor annoyance to have this noise printed in every command line we run.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    Can you tell me which WP-Cli command you are running ?

    Best regards

    Thread Starter jbeninger

    (@jbeninger)

    It doesn’t matter which command I run. A simple wp command with no arguments will produce a stream of warnings.

    Warning: Undefined array key “SERVER_PORT” in …/plugins/wp-cassify/classes/wp_cassify_utils.php on line 102
    PHP Warning: Undefined array key “SERVER_PORT” in …/plugins/wp-cassify/classes/wp_cassify_utils.php on line 105
    Warning: Undefined array key “SERVER_PORT” in …/plugins/wp-cassify/classes/wp_cassify_utils.php on line 105
    PHP Warning: Undefined array key “SERVER_NAME” in …/plugins/wp-cassify/classes/wp_cassify_utils.php on line 98
    Warning: Undefined array key “SERVER_NAME” in …/plugins/wp-cassify/classes/wp_cassify_utils.php on line 98

    I ran a a stack trace on line 102 to determine where it’s being called, and it’s in the wp_loaded hook, which calls wp_cassify_grab_service_ticket.

    #0 …/plugins/wp-cassify/classes/wp_cassify_plugin.php(1045): wp_cassify\WP_Cassify_Utils::wp_cassify_get_current_url()
    #1 …/plugins/wp-cassify/classes/wp_cassify_plugin.php(337): wp_cassify\WP_Cassify_Plugin->wp_cassify_is_gateway_request()
    #2 …/wp-includes/class-wp-hook.php(307): wp_cassify\WP_Cassify_Plugin->wp_cassify_grab_service_ticket()
    #3 …/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Spurious warnings when running WP-CLI commands’ is closed to new replies.