Project

General

Profile

Support #14439

Aprroved comments held for moderation

Added by Laurie Hurson 3 months ago. Updated about 3 hours ago.

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

0%

Estimated time:

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.

History

#1 Updated by Laurie Hurson 3 months ago

  • Tracker changed from Bug to Support

#2 Updated by Boone Gorges 3 months 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?

#3 Updated by Laurie Hurson 3 months ago

Hi Boone,

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

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

#4 Updated by Laurie Hurson 3 months 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.

#5 Updated by Boone Gorges 3 months ago

  • Assignee set to Raymond Hoh

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

#6 Updated by Raymond Hoh 3 months 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

#7 Updated by Syelle Graves 3 months 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!

#8 Updated by Syelle Graves 3 months 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.

#9 Updated by Raymond Hoh 3 months 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?

#10 Updated by Syelle Graves 3 months 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.

#11 Updated by Boone Gorges 3 months 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.

#12 Updated by Syelle Graves 3 months ago

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

#13 Updated by Raymond Hoh 3 months 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.

#14 Updated by Syelle Graves 3 months 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:

#15 Updated by Raymond Hoh 3 months 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.

#16 Updated by Boone Gorges 3 months 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.)

#17 Updated by Syelle Graves 3 months 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?

#18 Updated by Syelle Graves 3 months ago

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

#19 Updated by Syelle Graves 3 months 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?

#20 Updated by Syelle Graves 3 months 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?

#21 Updated by Raymond Hoh 3 months 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.

#22 Updated by Raymond Hoh 2 months 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.

#23 Updated by Boone Gorges 2 months ago

  • Target version changed from 1.18.11 to 1.18.12

#24 Updated by Boone Gorges about 2 months ago

  • Target version changed from 1.18.12 to 1.18.13

#25 Updated by Boone Gorges about 1 month ago

  • Target version changed from 1.18.13 to 1.18.14

#26 Updated by Boone Gorges 14 days ago

  • Target version changed from 1.18.14 to 1.18.15

#27 Updated by Boone Gorges about 3 hours ago

  • Target version changed from 1.18.15 to 1.18.16

Also available in: Atom PDF