10up / wp-hammer

ARCHIVED: Please see https://github.com/10up/wp-scrubber as replacement.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix PHP warning when there are no user IDs to keep

JPry opened this issue · comments

I ran the following command to eliminate all users from an install:

wp ha -l users=0

For each user that was deleted, the following PHP warning appeared:

Warning: min(): Array must contain at least one element in /home/vagrant/.wp-cli/packages/vendor/ivankruchkoff/wp-hammer/includes/pruners/users.php on line 55
commented

So I don't know whether or not it's possible to have a site with no users, but if it is as a workaround do wp ha -l users=1 and remove the last user yourself. I'll put out a workaround when I can (PRs are always welcome though)