cuny-academic-commons / cbox-theme

Default theme for Commons In A Box
GNU General Public License v2.0
20 stars 15 forks source link

Add password strength meter to registration and "Settings > General" page #268

Closed r-a-y closed 4 years ago

r-a-y commented 4 years ago

I'm going to port over the password strength meter from the BuddyPress Nouveau template pack to the registration and user "Settings > General" pages.

Strong passwords are happy passwords!

r-a-y commented 4 years ago

This is done.

Registration page screenshot:

2020-07-21_234337

User's "Settings > General" page:

password

One minor thing to note is a change to the submit button ID on the registration page. WP's password strength JS looks for a button ID of 'submit' or 'wp-submit' to ensure that if a weak password is entered, it will require the user's confirmation before the form can be submitted:

https://github.com/WordPress/WordPress/blob/e82a76b282c02121bf0f970cde96a1f523f9fac7/wp-admin/js/user-profile.js#L106

So I've changed the button ID on the registration page from 'signup_submit' to 'submit'. This shouldn't break anything unless a plugin has altered their registration page to rely on the #signup_submit ID (I'm thinking of a JS selector listener). If that's the case, it should be a simple one-line fix. Noted for future reference for anyone who stumbles upon this.