Use user nicename, not user login
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start with includes/model/class-user.php and its get_preferred_username() method, then read includes/class-signature.php and get_signature_options_key_for(). Verify how ActivityPub currently derives the username and signature key from WordPress user data. Done means the ActivityPub username uses user_nicename consistently and the related unnecessary sanitization is no longer needed.
Written by the indexing model from the issue text.
Description
Quick summary
User nicename is a unique, sanitized version of user login. Since user login can be an email address and contain spaces or special characters, user nicename is used for creating permalinks etc. throughout the rest of WordPress. Therefore, it should be used as the ActivityPub user name string, rather than user login.
https://wordpress.stackexchange.com/questions/127905/user-login-vs-user-nicename
includes/model/class-user.php:
public function get_preferred_username() {
return \get_the_author_meta( 'nicename', $this->_id );
}
In fact there is some sanitization happening in includes/class-signature.php that shouldn't be necessary if using the nicename:
protected static function get_signature_options_key_for( $user_id ) {
$id = $user_id;
if ( $user_id > 0 ) {
$user = \get_userdata( $user_id );
// No need to sanitize nicename
$id = $user->user_nicename;
}
return 'activitypub_keypair_for_' . $id;
}
Similar to #141, but doesn't require complete user customization of ActivityPub user name.
Steps to reproduce
Install ActivityPub and see that it is using user_login, not user_nicename.
Site owner impact
More than 60% of the total website/platform users
Severity
Minor
What other impact(s) does this issue have?
No response
If a workaround is available, please outline it here.
No response
- Dominant language
- PHP
- Stars
- 582
- Forks
- 93
- Avg merge
- 20h 46m
- Merged PRs (30d)
- 100
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Automattic/wordpress-activitypub
-
Enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
Automattic/wordpress-activitypub#3795 ·
-
[Feature] Collections Enhancement
Automattic/wordpress-activitypub#3792 · 2 comments · 1 assignee ·
-
Question
Difficulty 5/5 Over a week Newbie friendliness 25/100
Automattic/wordpress-activitypub#3745 · 4 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Automattic/wordpress-activitypub#3736 · 1 comment ·
-
Enhancement
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Automattic/wordpress-activitypub#3683 · 1 reaction ·
All issues in Automattic/wordpress-activitypub
Similar issues
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nextcloud/fulltextsearch#1011 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
phpstan/phpstan-doctrine#794 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Automattic/static-site-importer#1767 ·