It appears that this issue with password reset emails being sent when simply clicking “Update User” can occur for two possible reasons (both related to the WP 4.3 update):
If an installed plugin is unnecessarily calling wp_update_user()
:
The password change email is triggered any time that the wp_update_user() function is called with a user_pass argument. If the plugin is not actually changing the password, then it needs to not update the user with a password field in the arguments array.
This is because whether or not you change the password, even to the same password, the database will be changed. WordPress doesn’t know the password, only a hash of it. And the same password can be hashed pretty much an infinite number of ways. So if you send it a user_pass, then it actually is rehashing it and updating the entry in the database.
So, please stop calling wp_update_user() with a user_pass field over and over again. Then no more emails will be sent. Instead, consider checking if the user password has actually changed before trying to change it. You can use the wp_check_password() function for that. – quoted from this post
Or, if you have ever used a “save passwords” or “remember passwords” feature in your web browser (issue observed in Firefox and Chrome):
The WordPress v4.3 update changed the way passwords are reset on the Edit User panel: the “new password” fields are now hidden behind the “Generate Password” button. When you click that button, a text field appears with an auto-generated password. However, in some cases with Chrome and Firefox, the browser will covertly fill in that (now hidden) change password field (pass1
). When you click “Update User”, the browser sends a POST
with the pass1
and/or pass2
values set to whatever password you had previously saved with your browser. As a result, WordPress thinks you’re changing the users password and then sends the password reset email.
Here’s how you can test to determine if your browser is sending pass1
or pass2
with values filled in (note this requires PHP debugging to be enabled; if you’re not comfortable with PHP, I don’t recommend making these changes as modifying core files for any reason is not recommended):
After this line (Line 41 in wp-admin/includes/user.php
) in WordPress core, add the following, to help debug:
header('Content-Type: text/plain');
print_r($_POST); exit;
Now attempt to reproduce the issue by updating a user. Observe the debug output and see what pass1
and/or pass2
are set to.
I have observed that Google Chrome is autofilling my own password at times, and pass1
and pass2
are in fact POSTd without any interaction on my part.