WordPress.org

Support

Support » Plugins and Hacks » Plugin: Ultimate Security Checker Notice debug notice has_cap

Plugin: Ultimate Security Checker Notice debug notice has_cap

  • I like to mention a WordPress 3.1 debugging mode & Ultimate Security Checker 2.5.1 notice in my BACKEND:
    has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in /wp-includes/functions.php on line 3387

Viewing 2 replies - 1 through 2 (of 2 total)
  • our plugin doesn’t call this function at all. it might be somewhere in wordpress core..

    Actually your plugin *does* call this function as it still uses roles instead of capabilities in the add_submenu_page() function.

    To fix this, find line 43-46 in the wp-ultimate-security.php file:

    $page = add_submenu_page( 'tools.php',
    	__('Ultimate Security Check', 'myPlugin'),
    	__('Ultimate Security Check', 'myPlugin'), 9,  __FILE__,
    	'my_plugin_manage_menu');

    and change the lines to:

    $page = add_submenu_page( 'tools.php',
    	__('Ultimate Security Check', 'myPlugin'),
    	__('Ultimate Security Check', 'myPlugin'), 'manage_options',  __FILE__,
    	'my_plugin_manage_menu');

    (actually the only change is in line 45, line numbers based on the latest public version of the plugin, v2.1)

    Oh, and while you are at it.. you might as well fix this bug as well:

    In file securitycheck.class.php, line 42:
    $string .= $characters[mt_rand(0, strlen($characters))];
    change this to:
    $string .= $characters[mt_rand(0, (strlen($characters))-1)];

    Hope this helps!

    Smile,
    Juliette

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Plugin: Ultimate Security Checker Notice debug notice has_cap’ is closed to new replies.