#21243 closed enhancement (fixed)
move password hint text to a function
Reported by: | convissor | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 4.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Users | Keywords: | |
Focuses: | docs | Cc: |
Description
The password hint text, noted below, is hard coded in four places:
wp-admin/install.php wp-admin/user-edit.php wp-admin/user-new.php wp-login.php
Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ & ).
This approach is prone to mistakes when changes are made. In addition, plugins that want to override the text need to use the resource intensive and clumsy gettext filter.
Per nacin and westi, the attached patch moves the text to a function (wp_password_hint()
) in wp-includes/user.php
and adds a filter (password_hint
).
Attachments (7)
Change History (32)
#4
@
10 years ago
The minor grammar change in #26457 / r27246 "breaking" Login Security Solution reaffirms the need for this patch.
This ticket was mentioned in IRC in #wordpress-dev by DanielConvissor. View the logs.
10 years ago
#6
@
10 years ago
- Focuses docs added
- Milestone changed from Awaiting Review to 4.1
The filter needs to be documented as per the documentation standards.
#8
@
10 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 29962:
#9
follow-up:
↓ 11
@
10 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Let's rename the function to _wp_get_password_hint()
, for consistency with other functions like _wp_get_user_contactmethods()
or _get_additional_user_keys()
.
#11
in reply to:
↑ 9
;
follow-up:
↓ 12
@
10 years ago
Replying to SergeyBiryukov:
Let's rename the function to
_wp_get_password_hint()
, for consistency with other functions like_wp_get_user_contactmethods()
or_get_additional_user_keys()
.
Sergey,
why not use a shorter name _get_password_hint()
?
#12
in reply to:
↑ 11
@
10 years ago
Replying to ramiy:
Replying to SergeyBiryukov:
Let's rename the function to
_wp_get_password_hint()
, for consistency with other functions like_wp_get_user_contactmethods()
or_get_additional_user_keys()
.
Sergey,
why not use a shorter name
_get_password_hint()
?
We can use this. It is based on our choice. Let me know, what is the issue with longer name of the function ?
#13
follow-up:
↓ 14
@
10 years ago
- Resolution set to fixed
- Status changed from reopened to closed
In 30033:
#14
in reply to:
↑ 13
@
10 years ago
Replying to johnbillion:
In 30033:
Did you add my patch file ? As attached in comment 10 Or any issue in my patch file ?
Please confirm.
Thanks !
#16
@
10 years ago
- Keywords close added; has-patch commit removed
I'm not sure what you're asking, Ankit. The change was applied in r30033 and will be available in WordPress 4.1.
#17
@
10 years ago
- Keywords close removed
- Resolution set to fixed
- Status changed from reopened to closed
Ah I see. The function was renamed _wp_get_password_hint()
to bring it inline with other core function names.
#18
follow-up:
↓ 19
@
10 years ago
I guess, You forgot to mention the Props in this ticket after commit my patch.
#19
in reply to:
↑ 18
@
10 years ago
Replying to Ankit K Gupta:
I guess, You forgot to mention the Props in this ticket after commit my patch.
Just uploading a patch doesn't trigger any notifications - it is very likely johnbillion made the changes himself and committed them, as opposed to applying a patch that wasn't seen. In the future, please leave a comment about your patch, which also helps to explain what you're doing with it.
#21
in reply to:
↑ 20
@
10 years ago
Replying to johnbillion:
Nope I just missed the props. Sorry Ankit!
Hey johnbillion. It's fine.
It would be great if you can add props now. Otherwise it's ok.
#22
in reply to:
↑ 20
@
10 years ago
Replying to johnbillion:
Nope I just missed the props. Sorry Ankit!
It would be great if you can add props now.?
It would probably make sense to mark the function as private (21243.2.diff), similarly to
_wp_get_user_contactmethods()
.