• 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://www.ads-software.com/plugins/shortcode-menu/

Viewing 1 replies (of 1 total)
  • 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.