-
Notifications
You must be signed in to change notification settings - Fork 135
Allow author email addresses to stay private #577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
2317f77 to
a8723b8
Compare
|
Removing the email makes sense but I'd like to substitute the user role in it's place (which would be more helpful anyway). Let's remove the email and substitute it for the role in this PR, then it's good to merge. |
|
Let's add a filter for this value on the user list as well, in case folks want to substitute for some alternative (like username). |
To confirm, you're thinking the default behavior should be no email displayed but usernames instead? If so, I'm definitely not opposed - but do need to note that there is a "feature" removed, in that clicking on a commenters name currently opens up a mailto link to directly email them. Doesn't seem all the needed IMO, but I would need to defer to those using these in real editorial flows. Secondly, it could look a bit funny if the user has chosen their display name to be the username. That's fixable though.
I'd like to avoid more filters/actions in regards to the markup output. Integrating with the block editor in the future will probably mean a new UI, utilizing Gutenberg styles/components. Keeping compatibility with PHP-level custom markup will be tricky at that point, so ideally we keep things as light as possible moving forward. |
I was only thinking of the notifications panel. Swap the email with username or role (or both) to help with identification and make it filterable
Keep it filterable for comments, don't remove it. If you're commenting on a post it's because you've got access to it. As opposed to the notifications panel, where you can find folks emails regardless of whether you should have access to them. If Beyoncé contributed to my site, everyone who is a contributor or higher can find her email by creating a post and looking her up in the notifications panel. The only folks who could find her email through the editorial metadata are editors or higher, and only if she comments on the post. Editorial metadata needs rethinking, but the notifications panel is more problematic. |
True, though I think for the case in #264 the commenters don't necessarily want their email public either. I see what you're thinking now. Makes sense. I'll try out some variations of username / role and see what will make a good default.
One can only hope 😆. |
|
Hmm, so the more I look into this, the more it seems we should just leave it empty underneath the user's display name.
Whereas the display_name, what we are currently displaying, is a customizable value that the user has control over. Defaulting to the First + Last name. I'm definitely leaning towards "less is more" here. If we start with leaving it empty, we can see what happens. If no reports come in, then all is good. If there is a future report requesting more specific identifiers be shown, then we could act on that. |
|
Using just Email is the most useful information to show (as a unique identifier to help make "at a glance" and definitive determinations) but problematic from a privacy standpoint (see: Beyoncé). However, positively and absolutely identifying a user will be even more important for cases like #273 The concerns around |
|
Sorry I never replied, lol. FWIW I'd be fine with just names, though showing user_nicename would be apprciated as it would always be unique and help you differentiate two seemingly-identical accounts. |
Improve user privacy by no longer displaying email addresses in the notifications subscriber list and editorial comments. This addresses the concern that any user with post editing access could discover email addresses of all users who can publish posts. Changes: - Show user_nicename instead of email in notifications list (unique identifier) - Remove mailto: link from editorial comment authors - Add ef_user_secondary_identifier filter to customise what's shown - Add ef_editorial_comment_show_email_link filter to restore email links Both filters allow sites to restore the previous behaviour if needed. Fixes #264 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
a8723b8 to
7b9b93b
Compare
Implementation SummaryThis PR was reimplemented from scratch after 5 years, incorporating the feedback from the original discussion. Here's what we landed on: What changed
Why these decisionsWhy
Why hide email by default?
Why filters instead of removing email entirely?
Restoring previous behaviour// Show email in notifications list
add_filter( 'ef_user_secondary_identifier', function( $identifier, $user ) {
return $user->user_email;
}, 10, 2 );
// Show email links in editorial comments
add_filter( 'ef_editorial_comment_show_email_link', '__return_true' );Thanks to @WPprodigy for the original implementation work and to @cojennin and @jerclarke for the thoughtful discussion that shaped this solution. |
|
RIGHT ON! Love to see this, thanks Gary! |
Summary
Improve user privacy by hiding email addresses by default in the notifications subscriber list and editorial comments.
Problem: Any user with post editing access could discover email addresses of all users who can publish posts via the notifications panel. As noted in the original discussion: "If Beyoncé contributed to my site, everyone who is a contributor or higher can find her email."
Solution:
user_nicenameinstead of email in notifications list (provides unique identification without exposing email)mailto:link from editorial comment author namesChanges
user_nicename(e.g.,john-smith) below the display name instead of emailef_user_secondary_identifier: Customise what's shown below the display nameef_editorial_comment_show_email_link: Restore mailto: links in commentsRestoring previous behaviour
Test plan
Fixes #264
This is a fresh reimplementation based on the discussion in PR #577. The original PR was 5 years old and needed rebasing. This implementation follows the consensus from @cojennin and @jerclarke to hide emails by default and show an alternative unique identifier.
🤖 Generated with Claude Code