JezK
Edit File: wp-admin-context.php
<?php /** * Make is_admin() true under WP-CLI, so update systems which only register * their updater in wp-admin stay visible and installable. */ if ( defined( 'WP_CLI' ) && WP_CLI && ! defined( 'WP_ADMIN' ) ) { define( 'WP_ADMIN', true ); /** * Admin context makes login-security plugins treat every WP-CLI call as an * unauthenticated wp-admin request, so they call auth_redirect(). WP-CLI * turns the redirect into a warning and stops, and the command exits 0 with * no output at all - a list that cannot be parsed, a get that reads as "not * installed", an update that changes nothing and says nothing. Measured on * Box b8jci2ss4 with change-wp-admin-login: `plugin list --format=json` * returned 3041 bytes without this file and 0 bytes with it. * * auth_redirect() is pluggable and this file is required before WordPress * loads pluggable.php, so defining it here wins. There is no HTTP request * to protect under WP-CLI - the caller already has shell access - so doing * nothing is the correct behaviour rather than a workaround. */ if ( ! function_exists( 'auth_redirect' ) ) { function auth_redirect() {} } }