Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#16439 closed defect (bug) (invalid)

When a plugins needs updating, the core code calls "has_cap" in a deprecated way

Reported by: jltallon's profile jltallon Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Plugins Keywords: has_cap, plugin_update_detect
Focuses: Cc:


When WP_DEBUG is enabled, the log continuously spews the following when a plugin has a newer version available:

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 /usr/share/wordpress/wp-includes/functions.php on line 3381

Steps to reproduce:

1.- Enable logging

define('WP_DEBUG', true); Turn debugging ON

define('WP_DEBUG_DISPLAY', false); Turn forced display OFF

define('WP_DEBUG_LOG', true); Turn logging to wp-content/debug.log

2.- Activate a plugin which has a newer version

Steps to "neuter":

1.- Deactivate plugin

2.- Remove the plugin from wp-content/plugins

3.- Switch to another page (a form of "hard refresh")

The warning seems to come from wp-includes/deprecated.php, but I haven't been able to trace it to the original caller so far.

This is mostly annoying to those of us debugging, and not really an issue for production installs.

Last encountered with the "better delete revisions" plugin

Change History (3)

#1 @SergeyBiryukov
13 years ago

The problem is in the plugin itself:

        add_options_page('Better Delete Revision',
                         'Better Delete Revision',

It should be 'manage_options' instead of 8.

#2 @jltallon
13 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Indeed. Resolution verified (thanks!)

  • TinyMCE Advanced (v3.2.7) suffers from the same problem: line 268 (hey @Ozz!)

#3 @scribu
13 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.