Title: obsolete code detected
Last modified: August 21, 2016

---

# obsolete code detected

 *  Resolved [DJIO | Dionizio Bach](https://wordpress.org/support/users/djio/)
 * (@djio)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/obsolete-code-detected/)
 * Hi there!
 * I was running Debug Bar to detect an error on my theme but I came across this
   warning on Deprecated Calls tab.
 * I ran a sitewide search and found your plugin using levels intead of capabilities,
   so
    antispam_bee.php line 670 is:
 * if ( !current_user_can(‘level_2’) or !self::get_option(‘dashboard_chart’) ) {
 * but it should be:
 * if ( !current_user_can(‘publish_posts’) or !self::get_option(‘dashboard_chart’)){
 * Please change that for the next version
    😉
 * Best regards,
    Cheers from Brazil
 * Djio
 * [http://wordpress.org/extend/plugins/antispam-bee/](http://wordpress.org/extend/plugins/antispam-bee/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Sergej Müller](https://wordpress.org/support/users/sergejmueller/)
 * (@sergejmueller)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/obsolete-code-detected/#post-3722131)
 * Thanks for detecting 😉
 * `if ( !current_user_can('author') or !self::get_option('dashboard_chart') ) {`
 * is better. Agree?
 *  Thread Starter [DJIO | Dionizio Bach](https://wordpress.org/support/users/djio/)
 * (@djio)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/obsolete-code-detected/#post-3722141)
 * Hi Sergej,
 * Actually `author` is not a capability, but a role, as stated in this Codex link.
   
   [http://codex.wordpress.org/Roles_and_Capabilities#Author](http://codex.wordpress.org/Roles_and_Capabilities#Author)
 * The Codex also stands the function `current_user_can()` expects a capability.
   
   [http://codex.wordpress.org/Function_Reference/current_user_can](http://codex.wordpress.org/Function_Reference/current_user_can)
 * Unless you use an alternative approach, like in this link below.
    [http://docs.appthemes.com/tutorials/wordpress-check-user-role-function/](http://docs.appthemes.com/tutorials/wordpress-check-user-role-function/)
 * Hope it helps to clarify.
    =)
 *  [Sergej Müller](https://wordpress.org/support/users/sergejmueller/)
 * (@sergejmueller)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/obsolete-code-detected/#post-3722143)
 * Thank you.
    [http://plugins.trac.wordpress.org/changeset/708674](http://plugins.trac.wordpress.org/changeset/708674)
 *  Thread Starter [DJIO | Dionizio Bach](https://wordpress.org/support/users/djio/)
 * (@djio)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/obsolete-code-detected/#post-3722144)
 * You’re welcome!
    Anytime.
 * I thank you for developing this awesome plugin.
    Soon I expect to finish the 
   translation to pt_BR and post in my list. [http://www.djio.com.br/traducoes/](http://www.djio.com.br/traducoes/)
 * Best Regards,
    Djio

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘obsolete code detected’ is closed to new replies.

 * ![](https://ps.w.org/antispam-bee/assets/icon-256x256.png?rev=2898402)
 * [Antispam Bee](https://wordpress.org/plugins/antispam-bee/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/antispam-bee/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/antispam-bee/)
 * [Active Topics](https://wordpress.org/support/plugin/antispam-bee/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/antispam-bee/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/antispam-bee/reviews/)

## Tags

 * [capabilities](https://wordpress.org/support/topic-tag/capabilities/)
 * [deprecated](https://wordpress.org/support/topic-tag/deprecated/)
 * [obsolete](https://wordpress.org/support/topic-tag/obsolete/)

 * 4 replies
 * 2 participants
 * Last reply from: [DJIO | Dionizio Bach](https://wordpress.org/support/users/djio/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/obsolete-code-detected/#post-3722144)
 * Status: resolved