• Resolved Menno van den Ende

    (@mennoll)


    Dear developer,

    I’ve got an issue where the plugin is attempting to perform a redirect while running WP-CLI commands.

    This will cause a redirect and most important an exit; to happen, which stops all CLI commands from running.

    To prevent this, inside the IP2LocationRedirection::redirect() function, a check should be added to see if WP-CLI is currently running a command.

    	public function redirect()
    {
    // Disable redirection for WP-CLI
    if ( defined( 'WP_CLI' ) && WP_CLI ) {
    return;
    }

    // Rest of the code here ...
    }

    If a CLI command is running, the function should be aborted, and no redirect logic should be triggered.

    Would you be able to see if this fix can be applied in a new plugin version?
    Thanks in advance!

    Kind regards,
    Menno

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.