Title: PHP error messages
Last modified: August 22, 2016

---

# PHP error messages

 *  [awelsh](https://wordpress.org/support/users/awelsh/)
 * (@awelsh)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/php-error-messages/)
 * Hi,
 * This is a great plugin. However I’m getting three PHP error messages when I have
   wordpress debug turned on. They are:
 * > Notice: Undefined variable: sub_menu_style in /Applications/AMPPS/www/192.168.1.6/
   > wp-content/plugins/shortcode-menu/shortcode-menu.php on line 192
   > Notice: Undefined variable: submenu_anchor_color_style in /Applications/AMPPS/
   > www/192.168.1.6/wp-content/plugins/shortcode-menu/shortcode-menu.php on line
   > 195
   > Notice: Undefined variable: submenu_anchor_hover_color_style in /Applications/
   > AMPPS/www/192.168.1.6/wp-content/plugins/shortcode-menu/shortcode-menu.php 
   > on line 196
 * The lines they are referring to are:
 *     ```
       #'.$menu_id.' ul, #'.$menu_id.' ul ul { '.$sub_menu_style.' }
       #'.$menu_id.' ul a { '.$submenu_anchor_color_style.' }
       #'.$menu_id.' ul a:hover { '.$submenu_anchor_hover_color_style.' }
       ```
   
 * I’ve tried deactivating all my other plugins, and enabling the defaulty 2014 
   wordpress theme and I’m still getting the same errors.
 * Thanks,
    Arian
 * [https://wordpress.org/plugins/shortcode-menu/](https://wordpress.org/plugins/shortcode-menu/)

Viewing 1 replies (of 1 total)

 *  [rtpHarry](https://wordpress.org/support/users/rtpharry/)
 * (@rtpharry)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/php-error-messages/#post-5563211)
 * I’m getting these errors as well.
 * Looking at the code it seems pretty simple for the developers to fix.
 * `extract()` will create a $var for each of the atts that are passed through. 
   The error is occurring because it uses different names to store the css snippet
   than the original.
 * Adding these three lines after $list = ‘ul’; on line 93 will “fix” it:
 *     ```
       $sub_menu_style = '';
       $submenu_anchor_color_style = '';
       $submenu_anchor_hover_color_style = '';
       ```
   
 * However the code could certainly be optimised overall as that whole block of 
   code creates redundant, empty blocks of CSS if the shortcode doesn’t override
   the colors, eg:
 *     ```
       <style>
       #short_menu_54e3303fddb73 {  }
       #short_menu_54e3303fddb73 ul.wpsm-arrow-enabled:before {  }
       #short_menu_54e3303fddb73 ul,
       #short_menu_54e3303fddb73 ul ul {  }
       #short_menu_54e3303fddb73 a {  }
       #short_menu_54e3303fddb73 a:hover {  }
       #short_menu_54e3303fddb73 ul a {  }
       #short_menu_54e3303fddb73 ul a:hover {  }
       </style>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘PHP error messages’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/shortcode-menu_cdc6af.svg)
 * [Shortcode Menu](https://wordpress.org/plugins/shortcode-menu/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortcode-menu/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortcode-menu/)
 * [Active Topics](https://wordpress.org/support/plugin/shortcode-menu/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortcode-menu/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortcode-menu/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [rtpHarry](https://wordpress.org/support/users/rtpharry/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/php-error-messages/#post-5563211)
 * Status: not resolved