Title: PHP Warning: Undefined array key 0 in Has_Multiple_Admins.php line 93 (multisite
Last modified: May 8, 2026

---

# PHP Warning: Undefined array key 0 in Has_Multiple_Admins.php line 93 (multisite

 *  [svenms](https://wordpress.org/support/users/svenms/)
 * (@svenms)
 * [1 month ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-0-in-has_multiple_admins-php-line-93-multisite/)
 * Hello,
 * I’m reporting a PHP warning triggered by Site Kit on a multisite installation.
 * Environment
    - WordPress: 6.9.4
    - Site Kit: 1.178.0
    - PHP: 8.2.28
    - Multisite: yes
 * Warning (full message)
 * PHP Warning: Undefined array key 0 in /home/jzv4lkm/public_html/wp-content/plugins/
   google-site-kit/includes/Core/Authentication/Has_Multiple_Admins.php on line 
   93
 * _(Adjust the filesystem path if you paste this on a different server.)_
 * What happens
   When Site Kit evaluates whether the site has multiple administrators,
   it calls <code class=””>get_super_admins() and then, inside the multisite branch,
   accesses <code class=””>$super_admins[0] after only checking <code class=””>!
   empty( $super_admins ).
 * In PHP 8+, that triggers “Undefined array key 0” when the array is non-empty 
   but does not have a <code class=””>0 key (e.g. a sparse / non–zero-indexed array),
   which can occur depending on how the super admin list is stored or filtered.
 * Suggested direction
   Before using <code class=””>$super_admins[0], the code could
   guard with <code class=””>isset( $super_admins[0] ) or normalize with something
   like <code class=””>$login = reset( $super_admins ); / <code class=””>array_values(
   $super_admins ) so the first login is read safely.
 * Expected behavior
   No PHP warnings when counting administrators on multisite.
 * Thank you for considering a fix in a future release.

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

 *  Thread Starter [svenms](https://wordpress.org/support/users/svenms/)
 * (@svenms)
 * [1 month ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-0-in-has_multiple_admins-php-line-93-multisite/#post-18902454)
 * Hello, and thanks again for confirming this is a plugin-side edge case.
 * I ran the checks you suggested and validated the result directly in our multisite
   environment.
 * Codebase checks:
 * I searched our codebase under wp-content (active plugins, mu-plugins, and theme
   functions.php files) for anything that might modify the super admin list before
   Site Kit reads it.
    - No filters found for:
       * site_admins
       * pre_option_site_admins
       * pre_site_option_site_admins
       * site_option_site_admins
    - No custom assignments to global $super_admins found outside WordPress core.
    - Only read-only consumers of get_super_admins() were found (for example Wordfence,
      Freemius-based plugins, and Site Kit itself).
 * Runtime verification (WP-CLI):
 * get_super_admins() returned: type=array count=1 keys=[5] key0_exists=no
 * Raw multisite option value: site_admins = {“5″:”svenms”}
 * Conclusion:
 * This confirms the edge case:
    - The array is non-empty, so !empty($super_admins) is true.
    - But index 0 does not exist (sparse/non-zero-based keys).
    - Therefore $super_admins[0] triggers “Undefined array key 0” on PHP 8+.
 * Additional check (2FA plugin):
 * We also reviewed the active 2FA plugin (wp-2fa). It does not reference site_admins,
   get_super_admins, or related site_admins filters, so it does not appear to be
   causing this condition.
 * Safer access pattern suggestion:
 * Option 1: $login = reset($super_admins);
 * Option 2: $super_admins = array_values($super_admins); $login = $super_admins[
   0] ?? null;
 * Thank you.
    -  This reply was modified 1 month ago by [svenms](https://wordpress.org/support/users/svenms/).
    -  This reply was modified 1 month ago by [svenms](https://wordpress.org/support/users/svenms/).
    -  This reply was modified 1 month ago by [svenms](https://wordpress.org/support/users/svenms/).
 *  Plugin Support [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * (@jamesosborne)
 * [1 month ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-0-in-has_multiple_admins-php-line-93-multisite/#post-18902642)
 * Thanks for reporting this [@svenms](https://wordpress.org/support/users/svenms/),
   and for the useful input [@wpfixpath](https://wordpress.org/support/users/wpfixpath/).
   I opened a GitHub issue for this, which you’ll find below:
   [https://github.com/google/site-kit-wp/issues/12671](https://github.com/google/site-kit-wp/issues/12671)
 * Feel free to chime in there, or subscribe for updates. Hopefully we can get this
   address with one of the upcoming releases, given we have a bi-weekly release 
   cycle. Thanks again for raising this, and in turn making it a more robust plugin
   for multisite users!

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

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-warning-undefined-array-key-0-in-has_multiple_admins-php-line-93-multisite%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/google-site-kit/assets/icon-256x256.png?rev=3141863)
 * [Site Kit by Google - Analytics, Search Console, AdSense, Speed](https://wordpress.org/plugins/google-site-kit/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-site-kit/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-site-kit/)
 * [Active Topics](https://wordpress.org/support/plugin/google-site-kit/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-site-kit/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-site-kit/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * Last activity: [1 month ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-0-in-has_multiple_admins-php-line-93-multisite/#post-18902642)
 * Status: not resolved