Skip to content

The "wp user reset-password" command doesn't send the email with the password reset link #249

@amieiro

Description

@amieiro

I am checking the "wp user reset-password" command. The official description of the command is "Resets the password for one or more users".

First I check the users in my site:

$ wp user list 
+----+---------------------+---------------------+-------------------+---------------------+---------------+
| ID | user_login          | display_name        | user_email        | user_registered     | roles         |
+----+---------------------+---------------------+-------------------+---------------------+---------------+
| 1  | mysite1_manager     | mysite1_manager     | myemail@gmail.com | 2018-08-21 10:51:51 | administrator |
+----+---------------------+---------------------+-------------------+---------------------+---------------+

Then I try to reset the password for the user "mysite1_manager":

$ wp user reset-password mysite1_manager 

Reset password for mysite1_manager.
Success: Password reset.

Then I received an email with this text:

[My site 1] Notice of Password Change

Hi mysite1_manager,

This notice confirms that your password was changed on My site 1.

If you did not change your password, please contact the Site Administrator at
myemail@gmail.com

This email has been sent to myemail@gmail.com

Regards,
All at My site 1
https://www.mysite1.com

The password has been reset (I can't log in into my site), but I don't get a new password as the output of the command and I don't get a link in the email with a password reset link.

This site is configured in English. I have made the same test in another site configured in Spanish and I have received an email in Spanish, so I suppose that the WP-CLI command is executing some wrong WordPress core function that should send the reset link but instead it is changing the password.

[Mi sitio 2] Aviso de cambio de contraseña

Hola misitio2_manager,

Este aviso confirma que tu contraseña ha cambiado en Mi sitio 2.

Si no has cambiado la contraseña, contacta con el administrador del sitio en
myemail@gmail.com

Este correo ha sido enviado a myemail@gmail.com

Saludos,
El equipo de Mi sitio 2
https://www.misitio2.com

If the command works fine I expect:

  • That the password doesn't change.
  • A new email with a link where I can change the password.

My "wp cli info" is:

$ wp cli info
OS:     Linux 4.15.0-38-generic #41-Ubuntu SMP Wed Oct 10 10:59:38 UTC 2018 x86_64
Shell:  /bin/bash
PHP binary:     /usr/bin/php7.2
PHP version:    7.2.11-4+ubuntu18.04.1+deb.sury.org+1
php.ini used:   /etc/php/7.2/cli/php.ini
WP-CLI root dir:        phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:      phar://wp-cli.phar/vendor
WP_CLI phar path:       /home/vagrant/Code/web/extension-command
WP-CLI packages dir:    /home/vagrant/.wp-cli/packages/
WP-CLI global config:
WP-CLI project config:  /home/vagrant/Code/web/extension-command/wp-cli.yml
WP-CLI version: 2.1.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions