You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 16, 2024. It is now read-only.
Refactors the remove-user command to bring it in line with the commands added in the last 9 months or so thus removing the dependency on the deprecated API_Helperand making use of more reusable functions.
At the same time, provides a warning for when a WPCOM site could not be queried as suggested by #162.
@ahegyes This looks and works great, though I did come across a warning, and there was one slightly confusing bit in the output, not a big deal, but bringing it up anyways.
First, I tested with --list, then without --list and aborting, and finally without --list and confirming removal.
The confusing part:
I added my personal email as a collaborator on tumblr-swag-store-development.mystagingwebsite.com via Pressable without WP Access. I was already a "customer" on the site, but the command reports me as a "collaborator". It was confusing since the site shows up twice, once as a pressable site ID, and then again as a wpcom site ID. I understand why it shows up twice, it just took me a couple minutes to understand why.
Now, this is probably not a big deal for our 51 sites, but in a perfect world we could check for type of access before removing the user, and only remove users with a certain level of access. Having said, we probably couldn't check for custom roles or permissions and it's probably better to just nuke the user anyways (and add them back later if needed).
Overall though, it works perfectly as intended.
The PHP warning:
This showed up on the confirmation run: PHP Warning: Undefined property: stdClass::$email in /Users/nickp/team51-cli/src/commands/remove-user.php on line 128
I think line 128 should be $this->user, or, add 'email' in the returned array on line 215. I didn't fully debug though, so not 100% sure on what's included in that object.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactors the
remove-usercommand to bring it in line with the commands added in the last 9 months or so thus removing the dependency on the deprecatedAPI_Helperand making use of more reusable functions.At the same time, provides a warning for when a WPCOM site could not be queried as suggested by #162.