pluck-cms / pluck

Central repo for pluck cms
http://www.pluck-cms.org
56 stars 39 forks source link

How can you realize Antispam Protection at Pluck comments #36

Closed ghost closed 5 years ago

ghost commented 8 years ago

Hello Developers,

I have now installed Pluck and wonder how to implement anti-spam protection for comments on the blog.

I fear that it will come to spam if the blog has become known.

I can not find anywhere a Captcha Module for comments.

Do you know a protection for comments or can you help me differently?

Thank you in advance.

billcreswell commented 8 years ago

Managing Spam is Tuff. There may be some ideas in https://github.com/pluck-cms/pluck-cms-contactform_captcha

Or this is an old school solution.

check for post values, and timestamp of less than 20 minutes

if( isset( $_POST["First_Name"] ) && ($_POST["First_Name"] != "") && ($_POST["First_Name"] != $_POST["Last_Name"]) && ($timestamp - $_REQUEST["t"] < 1200) ) {

// check for spam $_http = 0; $_href = 0; foreach ($_POST as $key => $value){ $key = $value; // Annoying URL spams in comments any field $_http += substr_count($value, "http"); $_href += substr_count($value, "href"); } if ($_http > 1 OR $_href > 1){ die("Sorry, contains too many links or banned words."); }

ghost commented 8 years ago

Thank you for your advice and assistance.

But in what file I need to include this code? Captcha for Contact Form I set ever.

BSteelooper commented 5 years ago

In the contact form for captcha you should not have to add this code. it is an or. You can add the code to the contact_form_admin in the send comment part of the code.