WordPress.org

Ready to get started?Download WordPress

Forums

Login LockDown
Plugin using deprecated argument (8 posts)

  1. Ian Dunn
    Member
    Posted 2 years ago #

    This is printed to every page when WP_DEBUG is enabled:

    Notice: 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 /var/www/vhosts/[redacted]/httpdocs/wp-includes/functions.php on line 3551

    Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/[redacted]/httpdocs/wp-includes/functions.php:3551) in /var/www/vhosts/[redacted]/httpdocs/wp-includes/functions.php on line 861

    Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/[redacted]/httpdocs/wp-includes/functions.php:3551) in /var/www/vhosts/[redacted]/httpdocs/wp-includes/functions.php on line 862

    http://wordpress.org/extend/plugins/login-lockdown/

  2. chrisjako
    Member
    Posted 2 years ago #

    I am too getting this message in debug mode

  3. BenjaminRMueller
    Member
    Posted 2 years ago #

    Hello,

    This is caused by the use of user levels which were deprecated a while back and replaced with the new roles and capabilities.

    This plugin is still using the user levels when creating their options page. You can view the code below of where they create this on line 297 or so.

    add_options_page('Login LockDown', 'Login LockDown', 9, basename(__FILE__), 'print_loginlockdownAdminPage');

    The 9 is the user level call that is throwing the error message. This code above should be replace with the following instead:

    add_options_page('Login LockDown', 'Login LockDown', 'edit_users', basename(__FILE__), 'print_loginlockdownAdminPage');

    This allows anyone with the capability of editing users to view the Login Lockdown options page (this is usually only users with the Administrator role.)

    I have applied this to my site and it seems to have removed the error. Let me know if you have any problems implementing this.

  4. Ian Dunn
    Member
    Posted 2 years ago #

    Yeah, I know I can manually fix it, but I was hoping the author would so that the changes wouldn't get overwritten with new versions.

  5. BenjaminRMueller
    Member
    Posted 2 years ago #

    Yeah I tried emailing the author of the plugin to see if he would like some help with developing things so fixes like this could be implemented but I haven't heard back yet.

    I guess the good news though is that any changes you do make won't be overwritten until he does update the plugin. I will wait to hear back from him for a while and if I don't hear anything I might fork the project and oversee it's future development.

  6. Ian Dunn
    Member
    Posted 2 years ago #

    That'd be cool, let me know if you fork it. I also might switch to using the Login Lock plugin, but I don't think they mask login error messages like Login Lockdown does.

  7. Ian Dunn
    Member
    Posted 2 years ago #

    There's a new plugin that I tried out called Login Security Solution and I'm really happy with it. I think the code higher quality, and it's more comprehensive than the other plugins out there. I've talked to the developer too, and he's been very responsive to feedback.

  8. Bozz
    Member
    Posted 1 year ago #

    Came here to report the same issue! What's even more surprising is that this was deprecated at 2.0!

    Argument in add_options_page()
    Used in wp-content/plugins/login-lockdown/loginlockdown.php on line 299.

    Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. Deprecated in version 2.0.

    Ian, that new plugin looks great! Thanks for sharing.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic