Title: Error Log Warning &#8211; Undefined array key &#8220;default&#8221;
Last modified: November 5, 2022

---

# Error Log Warning – Undefined array key “default”

 *  Resolved [Rhapsody348](https://wordpress.org/support/users/rhapsody348/)
 * (@rhapsody348)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/error-log-warning-undefined-array-key-default/)
 * Hello Javier,
 * I am posting a minor item for clean up in a future release. I just noticed the
   following error log entry using version 1.21.2 and am suggesting a fix to prevent
   the log generation.
 * This is the error log:
 * [04-Nov-2022 11:47:11 UTC] PHP Warning: Undefined array key “default” in /home/***/***/
   blog/wp-content/plugins/import-users-from-csv-with-meta/classes/settings.php 
   on line 209
 * The suggested change to the settings.php file before line 209 which is `return
   $settings[ $option ]['default'];` is to insert the following:
 *     ```
               if( !isset( $settings[ $option ]['default'] ) )
                   return false;
       ```
   

Viewing 1 replies (of 1 total)

 *  Plugin Author [Javier Carazo](https://wordpress.org/support/users/carazo/)
 * (@carazo)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/error-log-warning-undefined-array-key-default/#post-16173429)
 * Thanks for your debugging.
 * In the next release it will be fixed.
 * But I have used this better because this !isset is managed before of it:
 *     ```
       if( !isset( $settings[ $option ]['default'] ) ){
                   switch( $settings[ $option ] ){
                       case 'text':
                           return '';
   
                       case 'array_text':
                           return array();
   
                       case 'checkbox':
                           return false;
   
                       default:
                           return false;
                   }
               }
       ```
   
 * The default with return false should do the trick.

Viewing 1 replies (of 1 total)

The topic ‘Error Log Warning – Undefined array key “default”’ is closed to new replies.

 * ![](https://ps.w.org/import-users-from-csv-with-meta/assets/icon-256x256.png?
   rev=1174343)
 * [Import and export users and customers](https://wordpress.org/plugins/import-users-from-csv-with-meta/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/import-users-from-csv-with-meta/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/import-users-from-csv-with-meta/)
 * [Active Topics](https://wordpress.org/support/plugin/import-users-from-csv-with-meta/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/import-users-from-csv-with-meta/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/import-users-from-csv-with-meta/reviews/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [Javier Carazo](https://wordpress.org/support/users/carazo/)
 * Last activity: [3 years, 7 months ago](https://wordpress.org/support/topic/error-log-warning-undefined-array-key-default/#post-16173429)
 * Status: resolved