Title: Undefined array key
Last modified: May 29, 2023

---

# Undefined array key

 *  Resolved [Josh_A](https://wordpress.org/support/users/josh_a/)
 * (@josh_a)
 * [3 years ago](https://wordpress.org/support/topic/undefined-array-key-25/)
 * When using wp cli I’m seeing the following warnings:
 *     ```wp-block-code
       PHP Warning:  Undefined array key "SERVER_NAME" in /sites/mysite.com/files/wp-content/plugins/use-clients-time-zone/use-clients-timezone-class.inc.php on line 15
   
       Warning: Undefined array key "SERVER_NAME" in /sites/mysite.com/files/wp-content/plugins/use-clients-time-zone/use-clients-timezone-class.inc.php on line 15
       ```
   

Viewing 1 replies (of 1 total)

 *  Plugin Author [drmikegreen](https://wordpress.org/support/users/drmikegreen/)
 * (@drmikegreen)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/undefined-array-key-25/#post-16777709)
 * This plugin retrieves the time zone of the client using “Automatic Timezone Detection
   Using JavaScript” ([http://pellepim.bitbucket.org/jstz/](http://pellepim.bitbucket.org/jstz/))
   the first time that a client accesses the site, sets a cookie containing the 
   client’s time zone on the client, and reloads the page.
 * It cannot, therefore, be used with wp cli.
 * The line referenced (line 15 of the use-clients-timezone-class.inc.php file) 
   happens to be a coding “artifact” (something left there when a coding change 
   makes it unused). If it were removed, however, the plugin would still not work
   with wp cli. It is meant to get the time from the end user’s computer and uses
   coding which will only work in the context of a web browser on their computer.

Viewing 1 replies (of 1 total)

The topic ‘Undefined array key’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/use-clients-time-zone.svg)
 * [Use Client's Time Zone](https://wordpress.org/plugins/use-clients-time-zone/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/use-clients-time-zone/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/use-clients-time-zone/)
 * [Active Topics](https://wordpress.org/support/plugin/use-clients-time-zone/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/use-clients-time-zone/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/use-clients-time-zone/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [drmikegreen](https://wordpress.org/support/users/drmikegreen/)
 * Last activity: [2 years, 12 months ago](https://wordpress.org/support/topic/undefined-array-key-25/#post-16777709)
 * Status: resolved