Opened 4 years ago

Last modified 9 months ago

#9775 reopened enhancement

Duplicate comment check is too strict

Reported by: scribu Owned by:
Priority: normal Milestone: Awaiting Review
Component: Comments Version: 2.7.1
Severity: normal Keywords:
Cc: scribu@…, skithund

Description

The duplicate comment detection mechanism doesn't allow duplicate comments on the same post, even from the post author. That's not good.

The duplicate comment check should only block the new comment if there is no other comment posted between the new comment and the old comment.

Change History (14)

  • Summary changed from Duplicate comment not allowed on same post to Improve duplicate comment detection
  • Summary changed from Improve duplicate comment detection to Duplicate comment check is too strict

It would depend on the purpose.

As I understand things, its main purpose is to make sure that double clicking the publish comment button won't output two comments. Adding a unique ID for each comment, that gets passed into the comment form, and that expires upon the comment being saved, would easily defeat this (it would probably cut a lot of spam, too). The duplicate-comment check could then be rendered obsolete, in favor of redirecting to the newly published comment itself.

  • Milestone changed from 2.8 to Future Release

punting to future, pending patch

comment:5 in reply to: ↑ 3   scribu4 years ago

Replying to Denis-de-Bernardy:

As I understand things, its main purpose is to make sure that double clicking the publish comment button won't output two comments.

Yes, I think that's it's main purpose too.

Adding a unique ID for each comment, that gets passed into the comment form, and that expires upon the comment being saved, would easily defeat this (it would probably cut a lot of spam, too). The duplicate-comment check could then be rendered obsolete, in favor of redirecting to the newly published comment itself.

The unique ID could use a mechanism similar to post-new.php that assigns a neggative ID to a post, before it is saved.

Also, this plugin implements a similar technique: http://wordpresssupplies.com/wordpress-plugins/captcha-free/

it might interfere with caching plugins however.

comment:7 in reply to: ↑ 6   scribu4 years ago

Replying to Denis-de-Bernardy:

it might interfere with caching plugins however.

Not if you add it dynamically through JS. But then users with JavaScript disabled can't comment.

Therefore, I still think it's a more robust ideea to check for intermediate comments before blocking.

  • Type changed from defect (bug) to enhancement

Why would you ever want to post two identical comments, even if there were other comments between them?

I think this should be closed as invalid. Providing a way to get around the duplicate comment check is asking for problems.

  • Cc skithund added

How about making the duplicate check pluggable, so people (like me) could get around it with a plugin if necessary?

  • Keywords needs-patch removed
  • Milestone changed from Future Release to 3.0
  • Resolution set to fixed
  • Status changed from new to closed
  • Version changed from 2.7.1 to 3.0

This has been fixed by making duplicate comment check pluggable.

From #12188:
(In [13434]) Add comment_duplicate_trigger hook that is fired when a duplicate comment is detected. Fixes #12188

  • Milestone changed from 3.0 to Awaiting Review
  • Resolution fixed deleted
  • Status changed from closed to reopened

You can use 'comment_duplicate_trigger' only to customize the message that the user sees, after it has been decided that the comment is a dup.

Related: #21609

  • Version changed from 3.0 to 2.7.1
Note: See TracTickets for help on using tickets.