Title: Notice: Undefined variable: enabledMobilePlugins and disabledMobilePlugins
Last modified: August 21, 2016

---

# Notice: Undefined variable: enabledMobilePlugins and disabledMobilePlugins

 *  Resolved [CodeWaggle](https://wordpress.org/support/users/codewaggle/)
 * (@codewaggle)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/notice-undefined-variable-enabledmobileplugins-and-disabledmobileplugins/)
 * Hi,
 * I’m working in Debug mode and in the admin area I’m seeing an undefined variable
   notice when I publish or update a post or page (It’s not happening on all the
   admin pages).
 * Because the headers are being sent to display the warning, WordPress can’t finish
   loading the page.
 * I’m including the error output at the end. I tried moving the variable assignment
   outside an if statement and the problem went away.
 * wordpress\wp-content\plugins\plugin-organizer\lib\PluginOrganizer.class.php (
   987)
 *     ```
       if (get_option('PO_disable_mobile_plugins') == 1) {
         $globalMobilePlugins = get_option('PO_disabled_mobile_plugins');
         if (!is_array($globalMobilePlugins)) {
           $globalMobilePlugins = array();
         }
         $disabledMobilePlugins = array();
         $enabledMobilePlugins = array();
       ```
   
 * When I moved the assignments to line 986 (before the if statement), the pages
   were processed normally:
 *     ```
       (986)
         $disabledMobilePlugins = array();
         $enabledMobilePlugins = array();
   
       if (get_option('PO_disable_mobile_plugins') == 1) {
         $globalMobilePlugins = get_option('PO_disabled_mobile_plugins');
         if (!is_array($globalMobilePlugins)) {
           $globalMobilePlugins = array();
         }
       ```
   
 * >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 * Here’s the output when the page stops loading:
 *     ```
       Notice: Undefined variable: enabledMobilePlugins in wordpress/wp-content/plugins/plugin-organizer/lib/PluginOrganizer.class.php on line 1043 
   
       Call Stack: 0.0006 871920 
   
       1. {wp-content}() wordpress/wp-admin/post.php:0 0.3478 64600928 
   
       2. edit_post() wordpress/wp-admin/post.php:218 0.3588 64638184 
   
       3. wp_update_post() wordpress/wp-admin/includes/post.php:281 0.3591 64655976 
   
       4. wp_insert_post() wordpress/wp-includes/post.php:3016 0.3716 64753424 
   
       5. do_action() wordpress/wp-includes/post.php:2954 0.3734 64741248 
   
       6. call_user_func_array() wordpress/wp-includes/plugin.php:429 0.3734 64741280 
   
       7. PluginOrganizer->save_post_meta_box() wordpress/wp-includes/plugin.php:429 
   
       Notice: Undefined variable: disabledMobilePlugins in wordpress/wp-content/plugins/plugin-organizer/lib/PluginOrganizer.class.php on line 1043 
   
       Call Stack: 0.0006 871920 
   
       1. {wp-content}() wordpress/wp-admin/post.php:0 0.3478 64600928 
   
       2. edit_post() wordpress/wp-admin/post.php:218 0.3588 64638184 
   
       3. wp_update_post() wordpress/wp-admin/includes/post.php:281 0.3591 64655976 
   
       4. wp_insert_post() wordpress/wp-includes/post.php:3016 0.3716 64753424 
   
       5. do_action() wordpress/wp-includes/post.php:2954 0.3734 64741248 
   
       6. call_user_func_array() wordpress/wp-includes/plugin.php:429 0.3734 64741280 
   
       7. PluginOrganizer->save_post_meta_box() wordpress/wp-includes/plugin.php:429 
   
       Warning: Cannot modify header information - headers already sent by (output started at wordpress/wp-content/plugins/plugin-organizer/lib/PluginOrganizer.class.php:1043) in wordpress/wp-admin/post.php on line 222 
   
       Call Stack: 0.0006 871920 
   
       1. {wp-content}() wordpress/wp-admin/post.php:0 0.3763 64640328 
   
       2. setcookie() wordpress/wp-admin/post.php:222 
   
       Warning: Cannot modify header information - headers already sent by (output started at wordpress/wp-content/plugins/plugin-organizer/lib/PluginOrganizer.class.php:1043) in wordpress/wp-includes/pluggable.php on line 899 
   
       Call Stack: 0.0006 871920 
   
       1. {wp-content}() wordpress/wp-admin/post.php:0 0.3763 64640112 
   
       2. redirect_post() wordpress/wp-admin/post.php:224 0.3767 64640312 
   
       3. wp_redirect() wordpress/wp-admin/post.php:75 0.3768 64650624 
   
       4. header() wordpress/wp-includes/pluggable.php:899
       ```
   
 * [http://wordpress.org/plugins/plugin-organizer/](http://wordpress.org/plugins/plugin-organizer/)

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

 *  Thread Starter [CodeWaggle](https://wordpress.org/support/users/codewaggle/)
 * (@codewaggle)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/notice-undefined-variable-enabledmobileplugins-and-disabledmobileplugins/#post-4358240)
 * P.S.
 * Forgot to mention what a great plugin this is. I just came across it a few hours
   ago and it’s taken care of a conflict with the order that two plugins are loading(
   I was using a small function to change the priority, this is easier to keep track
   of).
 * Plus it’s taken care of the main goal which was to disable a plugin on a page
   where it was causing a conflict and isn’t needed.
 * Thanks!
 *  Plugin Author [Jeff Sterup](https://wordpress.org/support/users/foomagoo/)
 * (@foomagoo)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/notice-undefined-variable-enabledmobileplugins-and-disabledmobileplugins/#post-4358360)
 * Thank you for catching that. I will get it fixed in the next update which should
   be in the next couple of weeks.
 *  Thread Starter [CodeWaggle](https://wordpress.org/support/users/codewaggle/)
 * (@codewaggle)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/notice-undefined-variable-enabledmobileplugins-and-disabledmobileplugins/#post-4358363)
 * Your Welcome.
 *  Plugin Author [Jeff Sterup](https://wordpress.org/support/users/foomagoo/)
 * (@foomagoo)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/notice-undefined-variable-enabledmobileplugins-and-disabledmobileplugins/#post-4358413)
 * This should be fixed with version 4.0.2

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

The topic ‘Notice: Undefined variable: enabledMobilePlugins and disabledMobilePlugins’
is closed to new replies.

 * ![](https://ps.w.org/plugin-organizer/assets/icon-256x256.png?rev=1786554)
 * [Plugin Organizer](https://wordpress.org/plugins/plugin-organizer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/plugin-organizer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/plugin-organizer/)
 * [Active Topics](https://wordpress.org/support/plugin/plugin-organizer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/plugin-organizer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/plugin-organizer/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Jeff Sterup](https://wordpress.org/support/users/foomagoo/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/notice-undefined-variable-enabledmobileplugins-and-disabledmobileplugins/#post-4358413)
 * Status: resolved