Plugin: Ultimate Security Checker Notice debug notice has_cap (3 posts)

  1. ChrisFo
    Posted 5 years ago #

    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

  2. bsndev
    Posted 5 years ago #

    our plugin doesn't call this function at all. it might be somewhere in wordpress core..

  3. jrf
    Posted 4 years ago #

    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__,

    and change the lines to:

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

    (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!


Topic Closed

This topic has been closed to new replies.

About this Topic