Skip Navigation

[Resolved] honeypot dosent work

This support ticket is created 3 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 5 replies, has 2 voices.

Last updated by Shane 3 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#2417549

i am trying to make a Honeypot to prevent spam-emails.
i tried to use the following filter, which i found on your support Blog.
//##
function loadtime_func() {
return time();
}
add_shortcode('loadtime', 'loadtime_func');

add_filter('cred_form_validate','honeypot_func',10,2);
function honeypot_func($field_data, $form_data)
{
list($fields,$errors)=$field_data;

if ($form_data['id']==2079)
{
//print_r($fields);
//$loadtime = $_POST["loadtime"];
$loadtime = $fields['loadtime']['value'];
$totaltime = time() - $loadtime;

if($totaltime< 5) {
$errors['loadtime'] = 'Please fill in the form before submitting!';
}
}
//return result
return array($fields,$errors);
}

//##

i used this code but it still sending the mails when i change the honeypot.

thank u in advanced

#2417671

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Mohammed,

Thank you for getting in touch.

Can you point me to the thread where you originally got this code so I can get some context on the use case?

Thanks,
Shane

#2417677
#2417689

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Mohammed,

I would not recommend the use of this code for the spam protection given that this was done perhaps at a time when we didn't have the spam protection integrated into our form.

I would recommend following the instructions below in order to protect your form from spam.

Thanks,
Shane

#2418009

Hi Shane,
which instructions you mean?
i do not see any instructions below.
Thanks

#2418243

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Mohammed,

My Apologies here is the link.
https://toolset.com/course-lesson/protecting-forms-from-spam/
Thanks,
Shane