Title: Undefined index: HTTP_USER_AGENT
Last modified: November 13, 2020

---

# Undefined index: HTTP_USER_AGENT

 *  Resolved [Clinton Blackburn](https://wordpress.org/support/users/ccb621/)
 * (@ccb621)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/undefined-index-http_user_agent-17/)
 * My error logs are being spammed by this message: Undefined index: HTTP_USER_AGENT.
   The plugin is being loaded during WP-CLI calls, so `$_SERVER['HTTP_USER_AGENT']`
   doesn’t exist.
 * This is specifically happening at in `Photonic_Plugin\Core\Photonic::__construct`
   in the file `Core/Photonic.php`, line 20. Please update this, and any other usages
   of `$_SERVER` to account for the fact that they may be running outside of the
   browser context.

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

 *  Plugin Author [Sayontan Sinha](https://wordpress.org/support/users/sayontan/)
 * (@sayontan)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/undefined-index-http_user_agent-17/#post-13658960)
 * Interesting – I wasn’t aware of a use case for accessing Photonic without a browser,
   but I see how that can happen.
 * I will patch this over the weekend.
 *  Plugin Author [Sayontan Sinha](https://wordpress.org/support/users/sayontan/)
 * (@sayontan)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/undefined-index-http_user_agent-17/#post-13793916)
 * Hi – can you see if you are still facing this problem (or similar problems) with
   the latest version of Photonic (2.60)?
 *  Thread Starter [Clinton Blackburn](https://wordpress.org/support/users/ccb621/)
 * (@ccb621)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/undefined-index-http_user_agent-17/#post-13800537)
 * I no longer see the error. Thanks for resolving!

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

The topic ‘Undefined index: HTTP_USER_AGENT’ is closed to new replies.

 * ![](https://ps.w.org/photonic/assets/icon.svg?rev=1972449)
 * [Photonic Gallery & Lightbox for Flickr, SmugMug & Others](https://wordpress.org/plugins/photonic/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/photonic/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/photonic/)
 * [Active Topics](https://wordpress.org/support/plugin/photonic/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/photonic/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/photonic/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Clinton Blackburn](https://wordpress.org/support/users/ccb621/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/undefined-index-http_user_agent-17/#post-13800537)
 * Status: resolved