Title: PHP 8 warning on every admin_init
Last modified: September 12, 2026

---

# PHP 8 warning on every admin_init

 *  [diversityx](https://wordpress.org/support/users/diversityx/)
 * (@diversityx)
 * [2 weeks, 5 days ago](https://wordpress.org/support/topic/php-8-warning-on-every-admin_init/)
 * Undefined array key “input” in class-easyfancybox-admin.php line 609
 * **Environment**: Firelight Lightbox 2.3.22 (the 2.3.23 changelog does not mention
   this, so I assume it is still present), WordPress 7.1, PHP 8.3, single site.
 * Every admin_init triggers this warning:
 * **PHP Warning:** Undefined array key “input” in wp-content/plugins/easy-fancybox/
   inc/class-easyfancybox-admin.php on line 609
 * The line is inside add_settings_fields_recursively():
 *     ```wp-block-code
       if (
           is_array( $option )
           && array_key_exists( 'options', $option )
           // Exclude select inputs, which have options key.
           && 'select' !== $option['input']
       ) {
       ```
   
 * Some entries in the options tree have an ‘options’ key but no ‘input’ key, so
   the comparison reads an undefined index. The logic still evaluates as intended(
   a missing ‘input’ is not ‘select’), so there is no functional bug, only the warning.
 * Because admin_init also fires on admin-ajax.php, this runs on every ajax request
   from every logged-in user, not just on admin pages. On a BuddyPress community
   with a few hundred active members we log roughly 11,000 of these warnings per
   day, which drowns out real errors.
 * Suggested fix, one line:
 *     ```wp-block-code
       && 'select' !== ( $option['input'] ?? '' )
       ```
   
 * Optionally, register the settings fields only on the plugin’s own settings screen(
   or skip when wp_doing_ajax()) so the recursive walk does not run on every ajax
   call at all.
 * Happy to test a dev build. Thanks for maintaining the plugin.

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-8-warning-on-every-admin_init%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/easy-fancybox/assets/icon-256x256.png?rev=3188201)
 * [Firelight Lightbox](https://wordpress.org/plugins/easy-fancybox/)
 * [Support Threads](https://wordpress.org/support/plugin/easy-fancybox/)
 * [Active Topics](https://wordpress.org/support/plugin/easy-fancybox/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/easy-fancybox/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/easy-fancybox/reviews/)

## Tags

 * [admin_init](https://wordpress.org/support/topic-tag/admin_init/)
 * [warning](https://wordpress.org/support/topic-tag/warning/)

 * 0 replies
 * 1 participant
 * Last reply from: [diversityx](https://wordpress.org/support/users/diversityx/)
 * Last activity: [2 weeks, 5 days ago](https://wordpress.org/support/topic/php-8-warning-on-every-admin_init/)
 * Status: not resolved