Automattic / Automattic/co-authors-plus

Multiple undefined indexes during csv import

Open
#620 0 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
PHP
Stars
322
Forks
216
Avg merge
7h 50m
Merged PRs (30d)
65

Description

Not all of the columns are necessary, so these are often not defined: https://github.com/Automattic/Co-Authors-Plus/blob/master/php/class-wp-cli.php#L822-L828

Same for `$author['user_email']`, `$author['first_name']`, `$author['last_name']`, etc.

____

On another note, user_email is required, otherwise the checks after this fail because it thinks the current user being imported is the same as another user without an email: https://github.com/Automattic/Co-Authors-Plus/blob/master/php/class-wp-cli.php#L851. Should instead make sure it's not empty first.

Contributor guide

Open the contributing guide

Research direction

Inspect php/class-wp-cli.php around lines 822-828 and 851, starting with the CSV import handling and its author field checks. Confirm that optional author fields do not produce undefined-index notices and that empty user_email values do not trigger the duplicate-user check; verify the import behavior with the relevant CSV import tests or command.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.