Title: Bug: Check trap fields doesn&#8217;t work
Last modified: May 21, 2020

---

# Bug: Check trap fields doesn’t work

 *  Resolved [Gytis Repečka](https://wordpress.org/support/users/kelmas/)
 * (@kelmas)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/bug-check-trap-fields-doesnt-work/)
 * Found one use-case when trap (`captcha` and `captcha_confirm` check) in function`
   ajdg_nobot_filter` doesn’t work: in case correct answer is provided (9 for default
   question) check trap part is never triggered:
 *     ```
       	// Check trap fields
       	$trap_captcha = $trap_confirm = null;
       	if(isset($_POST['captcha'])) $trap_captcha = strip_tags($_POST['captcha']);
       	if(isset($_POST['captcha_confirm'])) $trap_confirm = strip_tags($_POST['captcha_confirm']);
   
       	if($trap_captcha != "" OR $trap_confirm != " ") {
       		wp_die("<p class=\"error\">$security_message</p>");
       	}
       ```
   
 * As I understand, because as soon as question is answered correctly, `$user_login`
   is returned and function completes it’s job. But if there is still default question
   in config, trap then makes no sense.
 * `// Check trap fields` should go before `// Verify the answer.` – in such case
   plugin would first check if trap is passed and only then check answer.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Arnan](https://wordpress.org/support/users/adegans/)
 * (@adegans)
 * [5 years, 12 months ago](https://wordpress.org/support/topic/bug-check-trap-fields-doesnt-work/#post-12871333)
 * I’ll look into that and fix/change it for the next version.
 * Thanks for your report.

Viewing 1 replies (of 1 total)

The topic ‘Bug: Check trap fields doesn’t work’ is closed to new replies.

 * ![](https://ps.w.org/no-bot-registration/assets/icon-256x256.jpg?rev=3113674)
 * [No-Bot Registration](https://wordpress.org/plugins/no-bot-registration/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/no-bot-registration/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/no-bot-registration/)
 * [Active Topics](https://wordpress.org/support/plugin/no-bot-registration/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/no-bot-registration/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/no-bot-registration/reviews/)

## Tags

 * [trap](https://wordpress.org/support/topic-tag/trap/)

 * 1 reply
 * 2 participants
 * Last reply from: [Arnan](https://wordpress.org/support/users/adegans/)
 * Last activity: [5 years, 12 months ago](https://wordpress.org/support/topic/bug-check-trap-fields-doesnt-work/#post-12871333)
 * Status: resolved