http_status(), $e->remote_code() ) ) { return null; } return new WP_Error( self::ERROR_CODE, __( 'The other site no longer accepts this connection. This happens when Shiftora is reinstalled or its key is reset on either site. Delete this connection on both sites, then connect again with fresh Connection Info.', 'shiftora' ), [ 'status' => 502, 'connection_id' => $connection_id, 'hint' => __( 'If it still fails, clear any page or security cache on the other site (for example a caching or firewall plugin) and try again.', 'shiftora' ), ] ); } /** A 401 is always a rejection; a 403 only when it carries one of the auth layer's codes. */ public static function is_rejection( int $http_status, string $remote_code ): bool { return 401 === $http_status || ( 403 === $http_status && in_array( $remote_code, self::AUTH_CODES, true ) ); } }