Automattic / Automattic/co-authors-plus

add_coauthors() deleting old users if user_login is email address

Open
#427 7 comments 0 reactions 0 assignees View on GitHub
status: needs investigation
Dominant language
PHP
Stars
322
Forks
218
Avg merge
7h 50m
Merged PRs (30d)
65

Description

I noticed this issue if the `user_login` is different from `user_nicename`. This occurs in the main file `co-authors-plus.php` on line `815`:

`if ( $append ) {
$existing_coauthors = wp_list_pluck( get_coauthors( $post_id ), 'user_login' );
} else {
$existing_coauthors = array();
}`
The problem is that my `user_login` is the same as `user_email` and `user_nicename` removes the `@` and `.` from the email address making it very different from the `user_login`. Also, if anywhere in the plugin it checks for `user_nicename` shouldn't this check for it too?

Contributor guide

Open the contributing guide

Research direction

Start in co-authors-plus.php around line 815 and trace how add_coauthors() compares existing authors with the supplied login values. Reproduce the case where user_login differs from user_nicename, then verify that existing coauthors are preserved and the requested authors are handled correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend, content
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.