WordPress.org

Forums

WP-SpamShield Anti-Spam
[resolved] 1 argument that needs patching (21 posts)

  1. master412160
    Member
    Posted 1 year ago #

    Not a notice or bug but I do get this;

    wp-admin/menu-header.php:139 - Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead.

    https://wordpress.org/plugins/wp-spamshield/

  2. Scott Allen
    Member
    Plugin Author

    Posted 1 year ago #

    Hi master412160,

    I've looked into that one extensively. There's actually no bug in the plugin. (At least not from what I can tell...after a LOT of testing, researching, etc.) I've checked that particular notice with DEBUG on and nothing causes it to go away. I honestly think there must be some kind of strange quirk or bug with WordPress because the code that calls that function is literally copied and pasted from the WordPress Codex. In a few places in the plugin I have to verify user capabilities. The code used in the plugin is current_user_can('moderate_comments') and current_user_can('manage_options') and there hasn't been reference to user levels as of a long time ago.

    The example given in the WordPress Codex is :

    if ( current_user_can('moderate_comments') ) {
     echo 'The current user can moderate comments';
    }

    so you can see it's exactly the same usage.

    The codex entries for the function "current_user_can()" is:
    http://codex.wordpress.org/Function_Reference/current_user_can
    ... and User Roles and Capabilities is:
    http://codex.wordpress.org/Roles_and_Capabilities

    I've pretty much memorized those pages inside and out, backwards and forwards, and still can't see anything would cause it.

    All I can do on this one is recommend not running a production site with DEBUG on. But that's completely your call. :) If you (or anyone else) happen to find a solution I don't know about, I'm open to suggestions.

    - Scott

  3. master412160
    Member
    Posted 1 year ago #

    I see good and detailed explanation you gave me.

    Did you bring this up with any other developer? To see if they maybe spot what is causing or you can submit it as a possible core bug to the trac here on wordpress?

  4. Scott Allen
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks. I haven't yet, but it's definitely on the To Do list. I'm going to do some more testing first. I like to be able to recreate a problem consistently before I submit it as a bug. I know what it's like trying to diagnose a problem that's not consistent...it's like shooting in the dark. The WP Devs have enough work to do already so I just want to have more info to give them first.

  5. Scott Allen
    Member
    Plugin Author

    Posted 1 year ago #

    One thing I forgot to mention...when I was testing, I did a couple things to prove a point...I copied and pasted the exact implementations of the code from the WordPress core itself into the plugin. Still happened. Then, I went further and even created a test version of the plugin that had no references whatsoever to the "current_user_can()" function at all. It still happened. So there definitely is something else going on. I'm wondering if there is a WordPress function that is incorrectly calling it. I'm going to look into the WP Core files to look into it.

  6. master412160
    Member
    Posted 1 year ago #

    It seems so. Often enough people tend to look over things like this with their own creation. A new set of eyes may resolve this for you.

    I don't mean to offend you its like when you write a document you sometimes read over typos everytime you re-read it until you let someone else read it and they spot it for you. :)

    Also good luck! Hopefully you'll find your answer there somewhere.

  7. Scott Allen
    Member
    Plugin Author

    Posted 1 year ago #

    Trust me you don't offend me at all...I really appreciate your feedback and observations.

    I appreciate feedback and insight from all who are willing to offer it. I agree...when it's your own creation, its all too easy to overlook things.

    Thank you! I'm sure I will, it just might take a little bit. Have a good one. :)

  8. master412160
    Member
    Posted 1 year ago #

    Have you had any luck no this?

  9. Scott Allen
    Member
    Plugin Author

    Posted 1 year ago #

    I applied a workaround so it shouldn't show up anymore but I haven't been able to figure out what exactly is causing it yet.

  10. master412160
    Member
    Posted 1 year ago #

    Is tis workaround present in the latest version?

  11. Scott Allen
    Member
    Plugin Author

    Posted 1 year ago #

    Yes it is.

  12. master412160
    Member
    Posted 1 year ago #

    It still displays for me though...

  13. Scott Allen
    Member
    Plugin Author

    Posted 1 year ago #

    Are you testing on 127.0.0.1?

  14. master412160
    Member
    Posted 1 year ago #

    Version 1.3 it says in my plugin list.

  15. Scott Allen
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, it would definitely say it's in your plugin list. I was asking about the server you're testing it on....is it an internal server (127.0.0.1, ie. your computer) or a live production website? (www.somewebsite.com)

  16. master412160
    Member
    Posted 1 year ago #

    live production website.

  17. Scott Allen
    Member
    Plugin Author

    Posted 1 year ago #

    That's strange. Ok, well the best way for me to help is probably for you to just contact me directly via the Support Form. That way we can email back and forth. (Since I'm already familiar with the particular situation, you don't need to list all your plugins.)

  18. master412160
    Member
    Posted 1 year ago #

    I send it, did you get it?

  19. Scott Allen
    Member
    Plugin Author

    Posted 1 year ago #

    I didn't receive any emails yet. (I checked the spam folder too.) I'm not sure if it's delayed or something. There has been an issue with my web host that once in a while the PHP mail() function won't send emails from certain email addresses. I don't know why. I'm sorry this is such a pain. Lets try this one more time...if you don't mind. On any page of the site, in the top right of the navigation bar is a Contact link. If you use that form, it's using the WP-SpamShield Contact Form and I have logging on all the time so even in PHP mail() doesn't send for some reason, I will be able to get your info.

  20. master412160
    Member
    Posted 1 year ago #

    I filled it out.

  21. Scott Allen
    Member
    Plugin Author

    Posted 1 year ago #

    Got it! :) Emailing you now.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP-SpamShield Anti-Spam
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.