Title: E_WARNING: Undefined array key loading API connection settings fields
Last modified: February 28, 2025

---

# E_WARNING: Undefined array key loading API connection settings fields

 *  Resolved [Menno van den Ende](https://wordpress.org/support/users/mennoll/)
 * (@mennoll)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/e_warning-undefined-array-key-loading-api-connection-settings-fields/)
 * I’ve seen the following error occur un our error logbook of some sites.
 * E_WARNING: Undefined array key [NUMBER] at /PATH_TO_WP_PLUGINS/mailplus-forms/
   admin/classes/Setting.class.php in Spotler\Admin\Setting::apiConnectionSection
   line 124
 * This is caused because it loops 50 times to register api settings fields, however
   those indexes don’t always exist on the result of the $this->getSettings(‘name’)
   function.
 * To resolve the issue, you can do the following. Change the line below
 * `'name' => $this->getSettings('name')[$i],`
 * to
 * `'name' => $this->getSettings('name')[$i] ?? '',`
 * Please note that this suggestion only works for PHP 7.0+. If you need even more
   backward compatibility, you can also do this:
 *     ```wp-block-code
       // Before the for loop (makes sure to only get name settings once)$name_setting = $this->getSettings('name');// And then later 'name' => !empty($name_setting[$i]) ? $name_setting[$i] : '';
       ```
   
 * The change should be quite small, but prevent a lot of warnings as it triggers
   50 times on every wp-admin pageload.
 * If there are any questions remaining, please feel free to ask.
   Kind regards,Menno
    -  This topic was modified 1 year, 2 months ago by [Menno van den Ende](https://wordpress.org/support/users/mennoll/).
    -  This topic was modified 1 year, 2 months ago by [Menno van den Ende](https://wordpress.org/support/users/mennoll/).

The topic ‘E_WARNING: Undefined array key loading API connection settings fields’
is closed to new replies.

 * ![](https://ps.w.org/mailplus-forms/assets/icon.svg?rev=2655132)
 * [Spotler Mail+ Forms](https://wordpress.org/plugins/mailplus-forms/)
 * [Support Threads](https://wordpress.org/support/plugin/mailplus-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/mailplus-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mailplus-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mailplus-forms/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Menno van den Ende](https://wordpress.org/support/users/mennoll/)
 * Last activity: [1 year, 2 months ago](https://wordpress.org/support/topic/e_warning-undefined-array-key-loading-api-connection-settings-fields/)
 * Status: resolved