Make WordPress Core

Opened 4 years ago

Last modified 4 years ago

#53228 new defect (bug)

Unspamming a comment should respect `comment_previously_approved` setting

Reported by: r-a-y's profile r-a-y Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Comments Keywords:
Focuses: Cc:

Description

On the "Settings > Discussion" page, the "Comment author must have a previously approved comment" setting (comment_previously_approved) allows a user's comments to be automatically set to approved status (a.k.a. comment_approved = 1).

However, if a comment from a previously-approved author is incorrectly-marked as spam (either internally via check_comment() or from an anti-spam plugin like Akismet) and later, a moderator marks the comment as "Not spam", this comment is not automatically approved. Instead, the comment is placed in the moderation queue (comment_approved = 0).

WordPress makes this determination during unspamming here: https://github.com/WordPress/WordPress/blob/f4631a98f50f6275d0284527cf9fd7009e439e55/wp-includes/comment.php#L1717-L1722

Specifically, if the comment has a previously-trashed status from the _wp_trash_meta_status meta value, WordPress will use it. Otherwise, an unspammed comment's status will be marked as pending or 0.

Our users believe this is a UX issue. Previously-approved authors should not have their comments placed in pending after the comments are unspammed.

We're working around this issue at the moment, but thought we would ask if this is a bug or if this is by design.

Change History (1)

#1 @r-a-y
4 years ago

Correction:

if a comment from a previously-approved author is incorrectly-marked as spam (either internally via check_comment() or from an anti-spam plugin like Akismet).

check_comment() doesn't set spam status, so ignore that part. The "anti-spam plugin like Akismet" portion is correct though.

Note: See TracTickets for help on using tickets.