Project

General

Profile

Actions

Support #14439

closed

Aprroved comments held for moderation

Added by Laurie Hurson almost 3 years ago. Updated over 1 year ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
Spam/Spam Prevention
Target version:
Start date:
2021-05-10
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

Hi All,

The ILETC team is a hosting thier conference on the commons this week. There will be a lot of commenting happening on the site. They are hoping to have commenters approved after the first comment so all subsequent comments from a person can skip moderation. A description if their issue is below.

From Syelle:

A question about commenting: I have settings > discussion > Before a comment appears
set to "Comment author must have a previously approved comment."

However, it appears that comments by previously approved posters are still being held in moderation. Does that setting >only apply to members of the Commons, somehow, and not to all site traffic? (screenshot attached)

Is it the case that a previously approved comment skipping moderation only applies to CAC users since the platform verifies against login info? Maybe my understanding is wrong and if someone had a previously approved comment and submitted email, we can verify if they submit again with same email or username?

Let me know if this makes sense. I have added Syelle as a watcher on this ticket so she can provide more info if needed.


Files

Actions #1

Updated by Laurie Hurson almost 3 years ago

  • Tracker changed from Bug to Support
Actions #2

Updated by Boone Gorges almost 3 years ago

  • Status changed from New to Reporter Feedback

It's possible that the comment is being held in moderation for some other reason, like perhaps a spam blocker thought it looked suspicious.

Has the team tested only with this single comment, or are there multiple instances?

Can I please get the URL of the site so that I can have a direct look at the settings?

Actions #3

Updated by Laurie Hurson almost 3 years ago

Hi Boone,

Sorry, URL is: https://8nsshl2021.commons.gc.cuny.edu/

Have not tested on my own site but I will right now.

Actions #4

Updated by Laurie Hurson almost 3 years ago

I was able to recreate this issue here: https://blahblah.commons.gc.cuny.edu/wp-admin/edit-comments.php

A non-logged in user comments with email and then admin approves first comment associated with that email. Next comment with same email submission is still sent to moderation. Screenshot attached.

Actions #5

Updated by Boone Gorges almost 3 years ago

  • Assignee set to Raymond Hoh

Thanks, Laurie. Ray, could you poke at this please?

Actions #6

Updated by Raymond Hoh almost 3 years ago

I can't duplicate this on another test site: https://raytest.commons.gc.cuny.edu/2018/10/18/hello-world/#comment-2

If the "Comment author must have a previously approved comment" option is enabled, it's worth noting that if the user isn't logged in, the comment username and email address must be the same as the previously-approved comment in order to pass this check and that the email address does not match a keyword from the "Comment Moderation" textarea field:
https://github.com/WordPress/WordPress/blob/9ec439903de15fc9ad5e4fbb4be377c24d1089a6/wp-includes/comment.php#L134-L140

Actions #7

Updated by Syelle Graves almost 3 years ago

On our site, the name and email are definitely the same; it shows that the commenter has already-approved comments. Plus, the column for "Akismet suspects spam" was not filled in, so I don't think that was it. See screenshot.

And yes, it happened with all non-Commons commenters so far, but we only had two.

I'll test it out more this week and let you know if I get more data/case studies.

Thanks!

Actions #8

Updated by Syelle Graves almost 3 years ago

A development: Today, the site flagged a comment as spam even though it acknowledges that the commentor had been previously approved. Strange. See screenshot. I found this comment in the spam folder. Not sure if this is expected behavior? The comment does not have any links, so it can't be that.

Actions #9

Updated by Raymond Hoh almost 3 years ago

A development: Today, the site flagged a comment as spam even though it acknowledges that the commentor had been previously approved. Strange. See screenshot. I found this comment in the spam folder. Not sure if this is expected behavior? The comment does not have any links, so it can't be that.

I think this is expected behavior by Akismet. Akismet will run for logged-out users regardless of whether a user's comment was previously approved or not.

Also due to the nature of the comment content (discussion about writing and tutoring, which is often used by SEO spammers), Akismet is having a hard time disguishing between spam and legitimate content.

Boone, do you think we should bypass Akismet if the "Comment author must have a previously approved comment" option is enabled?

On our site, the name and email are definitely the same; it shows that the commenter has already-approved comments. Plus, the column for "Akismet suspects spam" was not filled in, so I don't think that was it. See screenshot.

This one is harder to explain. From looking at the comment history of the comment from the screenshot, it looks like Akismet cleared the comment and did not mark it as spam, but the comment was still pending afterwards.

Syelle, for an incorrectly-spammed comment, are you clicking on the "Not spam" link to indicate that the comment isn't spam like the following:

The reason I ask is if you did click on "Not spam", Akismet should have recorded an entry in the comment's history, but I did not see it. It should look like this: https://8nsshl2021.commons.gc.cuny.edu/wp-admin/comment.php?action=editcomment&c=77#akismet-status. For now, I've manually marked each incorrectly-spammed comment as "Not spam" programatically. I'm going to do some more testing to see if this is a bug or not.

If this happens again, Syelle, can you leave the comment in the pending queue so we can take a look at the database?

Actions #10

Updated by Syelle Graves almost 3 years ago

Thanks, Ray. I do mark the test comments as "not spam," but I put that "test spammer" comment in spam for the purposes of training our comment moderators.

Unfortunately, no, we can't leave any real comments in moderation right now, because this is the week of the symposium, and comments need to show as soon as possible.

However, after about five more real comments went straight to spam a couple days ago, it does all seem to be working now; previously approved commenters have been leaving comments that do bypass moderation. I can let you know if it reverts.

Actions #11

Updated by Boone Gorges almost 3 years ago

Boone, do you think we should bypass Akismet if the "Comment author must have a previously approved comment" option is enabled?

This seems reasonably risk-free to me, if it's easy to do.

Actions #12

Updated by Syelle Graves almost 3 years ago

One of our comment moderators reports new cases of a comment previously approved as getting that akismet "_flagged as spam_" message; see screenshot:

Actions #13

Updated by Raymond Hoh almost 3 years ago

One of our comment moderators reports new cases of a comment previously approved as getting that akismet "_flagged as spam_" message

Thanks for the new report, Syelle.

I've submitted an additional seven comments as not spam to Akismet manually. (Boone, I'm using this function call Akismet::submit_nonspam_comment( $comment_id ) via WP-CLI.)

This seems reasonably risk-free to me, if it's easy to do.

I forgot that Akismet doesn't have any filters to disable any of their calls, so this might be a little harder to accomplish.

I think the main thing we need to get working is when marking a comment as "Not spam", it should submit a nonspam report to Akismet. Right now, that doesn't seem to be triggering properly. I'm going to see what might be causing this.

Actions #14

Updated by Syelle Graves almost 3 years ago

Raymond Hoh wrote:

One of our comment moderators reports new cases of a comment previously approved as getting that akismet "_flagged as spam_" message

Thanks for the new report, Syelle.

No problem!

I've submitted an additional seven comments as not spam to Akismet manually. (Boone, I'm using this function call Akismet::submit_nonspam_comment( $comment_id ) via WP-CLI.)

This seems reasonably risk-free to me, if it's easy to do.

I forgot that Akismet doesn't have any filters to disable any of their calls, so this might be a little harder to accomplish.

I think the main thing we need to get working is when marking a comment as "Not spam", it should submit a nonspam report to Akismet. Right now, that doesn't seem to be triggering properly. I'm going to see what might be causing this.

Thanks for explaining this! Hope it gets resolved.

I have one more update from a moderator, just in case; she says: "I think the system is flagging the messages that contain Spanish and English. It appears the system doesn’t like code-switching, even if there is only one word in the other language." I'm doubt that's it, because the other messages were in English only, but here is the screenshot from her:

Actions #15

Updated by Raymond Hoh almost 3 years ago

I think the main thing we need to get working is when marking a comment as "Not spam", it should submit a nonspam report to Akismet. Right now, that doesn't seem to be triggering properly. I'm going to see what might be causing this.

Figured the problem out. We previously disabled Akismet for logged-in users in #11313. This also disabled Akismet in the administration area, which prevented the "not spam" reports from sending to Akismet. I've addressed this in https://github.com/cuny-academic-commons/cac/commit/2254028d2449ddef75ce77ab9088b63116ff0098 and pushed the fix to production.


As to what happens when you unspam a comment, it appears that WordPress will move the comment to "Pending" status instead of "Approved" if the comment wasn't originally trashed. This is default behavior. (Boone, see: https://github.com/WordPress/WordPress/blob/a6e6e4f93565e9858f7d5cd0b346ef68bb70dc1f/wp-includes/comment.php#L1717-L1720.)

I can write some code so that if a comment is flagged as spam by Akismet, when an administrator unspams the comment, I can automatically change the comment's status to Approved. Before I do this, I just wanted to check in with Boone and the rest of the team to see if this is something we want to do. There must be a valid reason why WordPress defaults an unspammed comment to Pending status and why Akismet does not change this behavior in their plugin.

Actions #16

Updated by Boone Gorges almost 3 years ago

I can write some code so that if a comment is flagged as spam by Akismet, when an administrator unspams the comment, I can automatically change the comment's status to Approved. Before I do this, I just wanted to check in with Boone and the rest of the team to see if this is something we want to do. There must be a valid reason why WordPress defaults an unspammed comment to Pending status and why Akismet does not change this behavior in their plugin.

That's a good question. There's more than one reason why you might want to moderate a comment. Spam is just one of those reasons, and this is the one that Akismet focuses on. But you might also hold comments in moderation for inappropriateness etc. So I guess, to play it safe, Akismet figures that marking "not spam" should only clear the comment from the spam queue, not from the pending queue.

That being said, it feels like this behavior should be sensitive to the more general moderation settings on the site. For example, if you've configured your installation so that comments are automatically approved if they come from a known commenter, then Akismet-flagged comments from users in this category that are marked as 'Not Spam' should presumably bypass moderation. Doesn't that seem to you like the logical behavior? (See

wp_unspam_comment()
, which shows that the comment is always released to the
_wp_trash_meta_status status.)

Actions #17

Updated by Syelle Graves almost 3 years ago

Thanks, Boone.

I actually think that un-spamming a comment should not make it bypass moderation. For example, on the site we have now, we are only accepting comments from specific people who have registered for our event. So we would either not approve or delete certain comments that come from outsiders, even if they are not spam. It would be a problem if unspamming a comment also approved it, in one go. The comment would show on our site until we had time to un-approve it, which would be confusing on the front end.

So to me, the opposite problem is the one that would be great to solve: When a comment comes in from a commenter who has already been approved, those comments should bypass spam completely; Akismet should know that if we approved the commenter, the commenter is not a spammer.

What do you both think?

Actions #18

Updated by Syelle Graves almost 3 years ago

(And I agree: appropriateness is another reason we would not approve, but also not mark-as-spam a comment)

Actions #19

Updated by Syelle Graves almost 3 years ago

Raymond Hoh wrote:

I think the main thing we need to get working is when marking a comment as "Not spam", it should submit a nonspam report to Akismet. Right now, that doesn't seem to be triggering properly. I'm going to see what might be causing this.

Figured the problem out. We previously disabled Akismet for logged-in users in #11313. This also disabled Akismet in the administration area, which prevented the "not spam" reports from sending to Akismet. I've addressed this in https://github.com/cuny-academic-commons/cac/commit/2254028d2449ddef75ce77ab9088b63116ff0098 and pushed the fix to production.


And I see here it looks like you solved the issue, Ray. I'll keep an eye out for that behavior over the next three days/I can update the ticket on how it goes?

Actions #20

Updated by Syelle Graves almost 3 years ago

I'm so sorry for the consecutive messages.

Today, two comments came in through moderation, despite having six or seven approved comments. They were not flagged as spam or put in the spam folder.

Is it possible something changed on your end?

Actions #21

Updated by Raymond Hoh almost 3 years ago

For example, if you've configured your installation so that comments are automatically approved if they come from a known commenter, then Akismet-flagged comments from users in this category that are marked as 'Not Spam' should presumably bypass moderation. Doesn't that seem to you like the logical behavior?

Yes, I agree with this. Just wanted someone else to confirm this is what we wanted. I'm also curious why Akismet did not implement this themselves.

I'm going to proceed with marking unspammed comments as approved if the site has "Comment author must have a previously approved comment" enabled and if the comment author has a previously-approved comment.


Today, two comments came in through moderation, despite having six or seven approved comments. They were not flagged as spam or put in the spam folder.

Is it possible something changed on your end?

I didn't change anything here. This appears to be related to how Akismet handles certain comments after their auto-check:

I've added a debug logger to see exactly what Akismet is returning in their response to see if my theory is correct.

Actions #22

Updated by Raymond Hoh almost 3 years ago

  • Category name set to Spam/Spam Prevention
  • Status changed from Reporter Feedback to Assigned
  • Target version set to 1.18.11

I'm going to proceed with marking unspammed comments as approved if the site has "Comment author must have a previously approved comment" enabled and if the comment author has a previously-approved comment.

I've committed this for the 1.18.11 minor release: https://github.com/cuny-academic-commons/cac/commit/4b05278ada2a3f7d4cf8d3128751ecc46c849ddd

I still want to look into what Syelle mentioned in comment 20, but the new commit should handle the main problem in this ticket.

I've also opened an issue on WP Trac to see whether this should be something that should be addressed in WordPress: https://core.trac.wordpress.org/ticket/53228.

Actions #23

Updated by Boone Gorges almost 3 years ago

  • Target version changed from 1.18.11 to 1.18.12
Actions #24

Updated by Boone Gorges almost 3 years ago

  • Target version changed from 1.18.12 to 1.18.13
Actions #25

Updated by Boone Gorges almost 3 years ago

  • Target version changed from 1.18.13 to 1.18.14
Actions #26

Updated by Boone Gorges over 2 years ago

  • Target version changed from 1.18.14 to 1.18.15
Actions #27

Updated by Boone Gorges over 2 years ago

  • Target version changed from 1.18.15 to 1.18.16
Actions #28

Updated by Boone Gorges over 2 years ago

  • Target version changed from 1.18.16 to 1.18.17
Actions #29

Updated by Boone Gorges over 2 years ago

  • Target version changed from 1.18.17 to 1.18.18
Actions #30

Updated by Boone Gorges over 2 years ago

  • Target version changed from 1.18.18 to 1.18.19
Actions #31

Updated by Boone Gorges over 2 years ago

  • Target version changed from 1.18.19 to 1.18.20
Actions #32

Updated by Boone Gorges over 2 years ago

  • Target version changed from 1.18.20 to 1.18.21
Actions #33

Updated by Boone Gorges over 2 years ago

  • Target version changed from 1.18.21 to 1.18.22
Actions #34

Updated by Boone Gorges over 2 years ago

  • Target version changed from 1.18.22 to 1.18.23
Actions #35

Updated by Boone Gorges over 2 years ago

  • Target version changed from 1.18.23 to 1.18.24
Actions #36

Updated by Boone Gorges over 2 years ago

  • Target version changed from 1.18.24 to 1.18.25
Actions #37

Updated by Boone Gorges about 2 years ago

  • Target version changed from 1.18.25 to 1.19.1
Actions #38

Updated by Boone Gorges about 2 years ago

  • Target version changed from 1.19.1 to 1.19.2
Actions #39

Updated by Boone Gorges about 2 years ago

  • Target version changed from 1.19.2 to 1.19.3
Actions #40

Updated by Boone Gorges about 2 years ago

  • Target version changed from 1.19.3 to 1.19.4
Actions #41

Updated by Boone Gorges about 2 years ago

  • Target version changed from 1.19.4 to 1.19.5
Actions #42

Updated by Boone Gorges about 2 years ago

  • Target version changed from 1.19.5 to 1.19.6
Actions #43

Updated by Boone Gorges about 2 years ago

  • Target version changed from 1.19.6 to 1.19.7
Actions #44

Updated by Boone Gorges almost 2 years ago

  • Target version changed from 1.19.7 to 1.19.8
Actions #45

Updated by Boone Gorges almost 2 years ago

  • Target version changed from 1.19.8 to 1.19.9
Actions #46

Updated by Boone Gorges almost 2 years ago

  • Target version changed from 1.19.9 to 1.19.10
Actions #47

Updated by Boone Gorges almost 2 years ago

  • Target version changed from 1.19.10 to 2.0.1
Actions #48

Updated by Boone Gorges almost 2 years ago

  • Target version changed from 2.0.1 to 2.0.2
Actions #49

Updated by Raymond Hoh over 1 year ago

  • Status changed from Assigned to Resolved

Hi Syelle, I'm going to close this ticket out.

If you are still encountering issues with approved comments being held for moderation. Please feel free to open a new ticket.

Actions

Also available in: Atom PDF