Title: PHP Notice: Undefined index: error_code
Last modified: November 27, 2024

---

# PHP Notice: Undefined index: error_code

 *  Resolved [breckf](https://wordpress.org/support/users/breckf/)
 * (@breckf)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/php-notice-undefined-index-error_code/)
 * Hi,
 * I’ve just started implementing your plugin as a malicious bot was bypassing reCaptcha
   to place orders and create accounts. Somewhat surpringly, the bot was still able
   to bypass the Turnstile challenge after implementation, so I need to look further
   into things.
 * However, using the latest version 1.27.1 I’m seeing this notice pop-up in our
   debug logs so thought I’d raise it to you. Occurring relatively infrequently (
   I’ve since used geoblocking to stop the attack), but still enough to be noticeable.
 * PHP Notice: Undefined index: error_code in /home/***/public_html/wp-content/plugins/
   simple-cloudflare-turnstile/inc/turnstile.php on line 227

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [alissit](https://wordpress.org/support/users/alissit/)
 * (@alissit)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/php-notice-undefined-index-error_code/#post-18179192)
 * **Bumping this for visibility** – Any update or solution to this?
   Our error_logs
   are also filling up with the same issue:PHP Warning: Undefined array key “error_code”
   in /xxxx/xxxx/public_html/wp-content/plugins/simple-cloudflare-turnstile/inc/
   turnstile.php on line 227
 *  Thread Starter [breckf](https://wordpress.org/support/users/breckf/)
 * (@breckf)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/php-notice-undefined-index-error_code/#post-18200148)
 * *bump*
 * Any word of a fix for this issue?
 *  [sgeithman1ecos](https://wordpress.org/support/users/sgeithman1ecos/)
 * (@sgeithman1ecos)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/php-notice-undefined-index-error_code/#post-18241290)
 * This is happening a lot in our logs also. This is such an easy fix (just check
   if ‘error_code’ is set first), and it is still happening in v1.28.0 …
 * All that needs to happen is to change this:
   `$error_code = $results['error_code'];`
   to something like this:`$error_code = 'n/a' // or empty or whateverif ( isset(
   $results['error_code']) ) { $error_code = $results['error_code'];}
 *  Plugin Author [Elliot Sowersby / RelyWP](https://wordpress.org/support/users/elliotvs/)
 * (@elliotvs)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/php-notice-undefined-index-error_code/#post-18241293)
 * Hi,
 * This should now be fixed in the latest update.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘PHP Notice: Undefined index: error_code’ is closed to new replies.

 * ![](https://ps.w.org/simple-cloudflare-turnstile/assets/icon-128x128.gif?rev=
   2937121)
 * [Simple CAPTCHA with Cloudflare Turnstile](https://wordpress.org/plugins/simple-cloudflare-turnstile/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-cloudflare-turnstile/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-cloudflare-turnstile/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-cloudflare-turnstile/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-cloudflare-turnstile/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-cloudflare-turnstile/reviews/)

## Tags

 * [PHP Notice](https://wordpress.org/support/topic-tag/php-notice/)

 * 5 replies
 * 4 participants
 * Last reply from: [Elliot Sowersby / RelyWP](https://wordpress.org/support/users/elliotvs/)
 * Last activity: [1 year, 7 months ago](https://wordpress.org/support/topic/php-notice-undefined-index-error_code/#post-18241293)
 * Status: resolved