Support » Plugins » Hacks » Would someone be willing to look over my php, please?

  • I’m hoping that someone can help me?? I’ve look everywhere for some guidance on how to hide certain dashboard menu items from everyone except administrators.

    I would like the plugin to hide menu dashboard items for everyone but admins, and hide elements of the admin bar for everyone (at least that’s what it’s supposed to do).

    I’ve finally written a plugin that appears to do this, but since I’m learning php I’m really hoping someone with more experience than me can look the code over and make sure that it’s secure and written correctly, please?

    I’d really appreciate it , thank you so much!

    here is the link to the code:
    http://tny.cz/3c0921bd

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    Your code is fine, you’ve done everything correctly and it is completely secure. The only thing I could comment on, and this is serious nit picking, is your writing style should be a bit more consistent. The type or amount of indent, and ensuring related elements are at the same level of indent. Consistently add_action() either before or after the related callback. All very minor issues, no one would ever complain your code is difficult to read.

    There is a document outlining the preferred coding style for WP related code, it’s easier to work with other coders when we all use the same style. Take a look at WordPress PHP Coding Standards.

    You may have noticed all the core source code also follows the Docblock Comment Standard. You might consider adopting this for your own work.

    None of this is required of course, it’s just FYI in case you’re interested.

    Thank you so much, bcworkz! I really appreciate the feedback. I will read over the articles you have suggested.

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Would someone be willing to look over my php, please?’ is closed to new replies.