Title: PHP error: Undefined array key &#8220;HTTP_USER_AGENT&#8221;
Last modified: December 6, 2021

---

# PHP error: Undefined array key “HTTP_USER_AGENT”

 *  Resolved [dcbuffalo](https://wordpress.org/support/users/dcbuffalo/)
 * (@dcbuffalo)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/php-error-undefined-array-key-http_user_agent/)
 * I’m getting the following error consistently in our php error logs, a number 
   of times per day – anywhere from just a couple times a day to as much as 50 as
   far as I can tell:
 * PHP Warning: Undefined array key “HTTP_USER_AGENT” in /home/xxxxxxxx/public_html/
   wp-content/plugins/mad-mimi-wp/includes/classes/RobotDetector/RobotDetector.php
   on line 307
 * I’m not sure what is triggering it. Can anyone offer any insight into the cause
   of this error, and a solution?
 * Thanks,
    David
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-error-undefined-array-key-http_user_agent%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [gavinohanlon](https://wordpress.org/support/users/gavinohanlon/)
 * (@gavinohanlon)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/php-error-undefined-array-key-http_user_agent/#post-15141557)
 * Hi Dcbuffalo,
 * Thanks for reaching out to us.
 * Are your optin forms working ?
 * With regard to the error message, we will look to get that fixed on the next 
   version release.
 * Thank you again for reporting it.
 * All the best.
 *  Thread Starter [dcbuffalo](https://wordpress.org/support/users/dcbuffalo/)
 * (@dcbuffalo)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/php-error-undefined-array-key-http_user_agent/#post-15141667)
 * It has been tested before and it worked. I will get confirmation of recent sign-
   ups and let you know.
 * Thanks for looking into it!
 *  Thread Starter [dcbuffalo](https://wordpress.org/support/users/dcbuffalo/)
 * (@dcbuffalo)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/php-error-undefined-array-key-http_user_agent/#post-15143851)
 * It is actually not working. If you enter a valid email address and click the 
   submit button, the button says “Failed to add user – 401”.
 *  Plugin Support [gavinohanlon](https://wordpress.org/support/users/gavinohanlon/)
 * (@gavinohanlon)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/php-error-undefined-array-key-http_user_agent/#post-15143904)
 * Hi Dcbuffalo,
 * Thanks for getting back to me.
 * Sometimes, the API keys can go stale after a while. We would recommend going 
   in and getting a new API key to try and clear all your cache from both the browser
   and server if you are using any caching plugins.
 * You could also check that you don’t have any conflicting plugins doing a similar
   action. Like another optin form plugin that is using MadMimi on your site. You
   would turn those other plugins off and see if the form then works.
 * Feel free to get back to us if there is anything else.
 * All the best.
 *  Thread Starter [dcbuffalo](https://wordpress.org/support/users/dcbuffalo/)
 * (@dcbuffalo)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/php-error-undefined-array-key-http_user_agent/#post-15143917)
 * I just discovered that the email address for the Mad Mimi account had been updated
   but I wasn’t aware. However, even after updating that, I still get an error that
   now reads “Failed to add user – 400”.
 *  Plugin Support [gavinohanlon](https://wordpress.org/support/users/gavinohanlon/)
 * (@gavinohanlon)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/php-error-undefined-array-key-http_user_agent/#post-15143936)
 * Hi again,
 * I tried the optin form at the bottom of your main page. This time the email was
   accepted. It did not show a similar error message as before.
 * The email I tested with ended with [1234@gmail.com](https://wordpress.org/support/topic/php-error-undefined-array-key-http_user_agent/1234@gmail.com?output_format=md)
 * If you are testing the form, just make sure you are using an email address that
   is different to one that might already be in your list.
 * Feel free to get back to us if there is anything else.
 * All the best.
 *  Thread Starter [dcbuffalo](https://wordpress.org/support/users/dcbuffalo/)
 * (@dcbuffalo)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/php-error-undefined-array-key-http_user_agent/#post-15143943)
 * I refreshed the API key and set the list appropriately. It now works perfectly
   again – thanks!
 *  Plugin Support [gavinohanlon](https://wordpress.org/support/users/gavinohanlon/)
 * (@gavinohanlon)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/php-error-undefined-array-key-http_user_agent/#post-15143965)
 * Hi there,
 * That’s good to hear. Happy to hear you got it working now.
 * Feel free to get back to us if there is anything else.
 * All the best.
 *  Thread Starter [dcbuffalo](https://wordpress.org/support/users/dcbuffalo/)
 * (@dcbuffalo)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/php-error-undefined-array-key-http_user_agent/#post-15382618)
 * So the same php error is still occurring. I refreshed the API key, and now the
   interface doesn’t allow me to set a list for the optin form, which seems problematic.
   Any thoughts?
 *  Thread Starter [dcbuffalo](https://wordpress.org/support/users/dcbuffalo/)
 * (@dcbuffalo)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/php-error-undefined-array-key-http_user_agent/#post-15382634)
 * Also FYI – the error started back up on December 9, pretty much after I cleared
   out the error log, and it’s logged almost every day since, usually several times.
 *  Thread Starter [dcbuffalo](https://wordpress.org/support/users/dcbuffalo/)
 * (@dcbuffalo)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/php-error-undefined-array-key-http_user_agent/#post-15382639)
 * I don’t believe it’s sending the confirmation email properly, but that’s probably
   an SMTP issue I’m working on separately.
 *  Plugin Support [gavinohanlon](https://wordpress.org/support/users/gavinohanlon/)
 * (@gavinohanlon)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/php-error-undefined-array-key-http_user_agent/#post-15393672)
 * Hi Dcbuffalo,
 * Thanks for your patience with this.
 * Is it the same error message as before ? This one – PHP Warning: Undefined array
   key “HTTP_USER_AGENT” in /home/xxxxxxxx/public_html/wp-content/plugins/mad-mimi-
   wp/includes/classes/RobotDetector/RobotDetector.php on line 307
 * We are trying to track down what is causing the API key not to be accepted with
   Mad Mimi. The developer is looking into the issue now to diagnose it.
 * If I hear anything back about fixing it, I will certainly reach out to you again.
 * In the meantime, don’t hesitate to let us know if there is anything else.
 * All the best.

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

The topic ‘PHP error: Undefined array key “HTTP_USER_AGENT”’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/mad-mimi-wp_f7f7f7.svg)
 * [Mad Mimi Forms by Optin Cat](https://wordpress.org/plugins/mad-mimi-wp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mad-mimi-wp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mad-mimi-wp/)
 * [Active Topics](https://wordpress.org/support/plugin/mad-mimi-wp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mad-mimi-wp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mad-mimi-wp/reviews/)

 * 12 replies
 * 2 participants
 * Last reply from: [gavinohanlon](https://wordpress.org/support/users/gavinohanlon/)
 * Last activity: [4 years, 3 months ago](https://wordpress.org/support/topic/php-error-undefined-array-key-http_user_agent/#post-15393672)
 * Status: resolved