diff --git a/includes/Core/Util/Migration_1_0_0.php b/includes/Core/Util/Migration_1_0_0.php index 8a1c59c6e10..ea325d0c842 100644 --- a/includes/Core/Util/Migration_1_0_0.php +++ b/includes/Core/Util/Migration_1_0_0.php @@ -13,6 +13,7 @@ use Google\Site_Kit\Context; use Google\Site_Kit\Core\Authentication\Authentication; use Google\Site_Kit\Core\Authentication\Clients\OAuth_Client; +use Google\Site_Kit\Core\Authentication\Verification_Tag; use Google\Site_Kit\Core\Authentication\Credentials; use Google\Site_Kit\Core\Storage\Encrypted_Options; use Google\Site_Kit\Core\Storage\Options; @@ -116,9 +117,26 @@ private function disconnect_users() { $key_prefix = $this->context->is_network_mode() ? '' : $wpdb->get_blog_prefix(); $user_ids = ( new \WP_User_Query( array( - 'fields' => 'id', - 'meta_key' => $key_prefix . OAuth_Client::OPTION_ACCESS_TOKEN, - 'compare' => 'EXISTS', + 'fields' => 'id', + 'meta_query' => array( + 'relation' => 'OR', + array( + 'key' => $key_prefix . Verification_Tag::OPTION, + 'compare' => 'EXISTS', + ), + array( + 'key' => $key_prefix . OAuth_Client::OPTION_ACCESS_TOKEN, + 'compare' => 'EXISTS', + ), + array( + 'key' => $key_prefix . OAuth_Client::OPTION_PROXY_ACCESS_CODE, + 'compare' => 'EXISTS', + ), + array( + 'key' => $key_prefix . OAuth_Client::OPTION_ERROR_CODE, + 'compare' => 'EXISTS', + ), + ), ) ) )->get_results(); diff --git a/includes/Core/Util/Reset.php b/includes/Core/Util/Reset.php index 8ebbdff4179..47bd408dc8c 100644 --- a/includes/Core/Util/Reset.php +++ b/includes/Core/Util/Reset.php @@ -143,9 +143,26 @@ private function delete_all_user_metas() { $key_prefix = $this->context->is_network_mode() ? '' : $wpdb->get_blog_prefix(); $user_query = new \WP_User_Query( array( - 'fields' => 'id', - 'meta_key' => $key_prefix . OAuth_Client::OPTION_ACCESS_TOKEN, - 'compare' => 'EXISTS', + 'fields' => 'id', + 'meta_query' => array( + 'relation' => 'OR', + array( + 'key' => $key_prefix . Verification_Tag::OPTION, + 'compare' => 'EXISTS', + ), + array( + 'key' => $key_prefix . OAuth_Client::OPTION_ACCESS_TOKEN, + 'compare' => 'EXISTS', + ), + array( + 'key' => $key_prefix . OAuth_Client::OPTION_PROXY_ACCESS_CODE, + 'compare' => 'EXISTS', + ), + array( + 'key' => $key_prefix . OAuth_Client::OPTION_ERROR_CODE, + 'compare' => 'EXISTS', + ), + ), ) );