q2a / question2answer

Question2Answer is a free and open source platform for Q&A sites, running on PHP/MySQL.
http://www.question2answer.org/
GNU General Public License v3.0
1.63k stars 628 forks source link

Adding new features to Anti-Spam section of core? #684

Open q2apro opened 5 years ago

q2apro commented 5 years ago

We could add some new helpful features to the Anti-Spam section of the core. From https://github.com/q2apro/q2apro-stop-spam for instance:

  1. List domains (or part of their names) that prevent user registration: ...

  2. Spam words that prevent the posting to be submitted (separate with comma): ...

  3. Number of allowed links per post: [ ... ]

  4. Prevent user with same IP from voting for his own posts and selecting his answers as best. [ yes/no ]

And it's missing in the plugin and in the core:

  1. Usernames (or parts of usernames) to block from registration: ...

Thanks for considering.

svivian commented 5 years ago

Do you get any spam actually on your site? As in, visible to everyone. For me it’s always caught by the moderation option so it needs to be approved.

What exactly does your plugin do if it detects spam? Does it put the post in the moderation queue, or completely reject it?

I’ve been playing around with some filter plugins for handling spam on the Q2A site. However, I’m not sure sure it’s making much difference as there is still spam coming in constantly.

q2apro commented 5 years ago

Spam is quite low. No, I do not use moderation, my moderator users do the sorting out.

The plugin throws back an error message, rejecting the post/registration.

MichaelTunnell commented 5 years ago

@svivian my site gets a minimum of 20 spam registrations and submissions every day. Manual approval of accounts is NOT a reasonable method in my opinion because in many cases if I don't know then I will default to approval and even if I know that still takes a considerable amount of time for zero benefit.

If there was a better method of spam blocking such as domains, I could block specific domains that I know for a fact is spam source. The vast majority of the spam is made by 4 specific domains but having that information is worthless at this point. Integration with better anti-spam stuff like askimet or recaptcha v3. Anything would be appreciated.

In regards to the domains, I would like to have a level of "send to queue for approval" for domains that are sketchy like certain TLDs and another level that is "automatic blocking" such as specific domains. This would make moderation so much easier.

svivian commented 5 years ago

@MichaelTunnell Yes, this is something I have been researching into. Akismet is a good option but that does add the overhead of an API call for every post.

It is possible to block domains using a filter plugin. I don't know how well-versed you are in PHP but something like this would work in the filter class:

public function filter_question(&$question, &$errors, $oldquestion)
{
    if (!isset($question['content']))
        return;

    $blockedWords = ['domain1', 'domain2'];

    foreach ($blockedWords as $word) {
        if (stripos($question['content'], $word) !== false) {
            $errors['content'] = 'Error';
            return;
        }
    }
}

See the docs for more

QROkes commented 4 years ago

I made these two Anti-Spam plugins, maybe you should give it a try:

Block some domains and check StopForumSpam API: https://gist.github.com/QROkes/38845477e4f4674cb5a78d48939214a0

And this check posted content in Akismet, you need an Akismet-Key and also it only check posted content from users with less than "xx" points, you need to enter this two values in your code in order to get it to work: https://gist.github.com/QROkes/bcf30838339aa2e8f188f290092ba21d

At least for me, it really solved the SPAM problem.

ryanbekabe commented 3 years ago

@MichaelTunnell I made a few changes to the program code to deal with bots that automatically register an account, maybe you can use it on your website, here's GitHub I mean: https://github.com/ryanbekabe/Stop-Bot-Auto-Register-Question2Answer

ftoledo commented 2 years ago

@MichaelTunnell I made a few changes to the program code to deal with bots that automatically register an account, maybe you can use it on your website, here's GitHub I mean: https://github.com/ryanbekabe/Stop-Bot-Auto-Register-Question2Answer

i'm interested, my site blow of spam register accounts, captchas area clean bypassed by these bots... please, can you translate doc to english?

ryanbekabe commented 2 years ago

@MichaelTunnell I made a few changes to the program code to deal with bots that automatically register an account, maybe you can use it on your website, here's GitHub I mean: https://github.com/ryanbekabe/Stop-Bot-Auto-Register-Question2Answer

i'm interested, my site blow of spam register accounts, captchas area clean bypassed by these bots... please, can you translate doc to english?

That's right, I've added an English translation, please check again.