Title: WP_Debug Errors
Last modified: August 20, 2016

---

# WP_Debug Errors

 *  Resolved [Driftless](https://wordpress.org/support/users/driftless1/)
 * (@driftless1)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/wp_debug-errors-1/)
 * Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not
   be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts,
   or init hooks. Please see Debugging in WordPress for more information. (This 
   message was added in version 3.3.) in …wordpress/wp-includes/functions.php on
   line 2959 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 …wordpress/wp-includes/functions.php on line 2923
   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 …wordpress/wp-includes/functions.php on line 2923
 * [http://wordpress.org/extend/plugins/zotpress/](http://wordpress.org/extend/plugins/zotpress/)

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

 *  Plugin Author [Katie](https://wordpress.org/support/users/kseaborn/)
 * (@kseaborn)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/wp_debug-errors-1/#post-3451918)
 * Can you provide more information? e.g. What page was this on?
 *  Thread Starter [Driftless](https://wordpress.org/support/users/driftless1/)
 * (@driftless1)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/wp_debug-errors-1/#post-3451954)
 * Upon activation of plugin, and on every admin (and front-end) page at the top.
   Also in the admin menu above Zotpress: 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 …wordpress/wp-includes/
   functions.php on line 2923
 * If you set wp-config argument `define('WP_DEBUG', true);` should light up like
   an x-mas tree.
 * (Thanks for the awesome plugin BTW – exactly what I’ve been dreaming up in my
   head for a while…)
 *  [mommaroodle](https://wordpress.org/support/users/mommaroodle/)
 * (@mommaroodle)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/wp_debug-errors-1/#post-3452103)
 * I think this is a WP bug – I found the following function in wp-includes/capabilities.
   php
 *     ```
       function has_cap( $cap ) {
       		$capabilities = apply_filters( 'role_has_cap', $this->capabilities, $cap, $this->name );
       		if ( !empty( $capabilities[$cap] ) )
       			return $capabilities[$cap];
       		else
       			return false;
       	}
   
       }
       ```
   
 *  I wonder if that has_cap should not be role_has_cap – I did make the change 
   and uploaded the file and still getting same error – hv done seaches on all plugins
   and my theme and the words has_cap doesnt appear in any except the wp-includes/
   capabilities.php of WP3.5.1
 *  [mommaroodle](https://wordpress.org/support/users/mommaroodle/)
 * (@mommaroodle)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/wp_debug-errors-1/#post-3452104)
 * also this on the same page – wp-includes/capabilities.php – from this code we
   can see where the error msg is being generated.
 *     ```
       /**
       	 * Whether user has capability or role name.
       	 *
       	 * This is useful for looking up whether the user has a specific role
       	 * assigned to the user. The second optional parameter can also be used to
       	 * check for capabilities against a specific object, such as a post or user.
       	 *
       	 * @since 2.0.0
       	 * @access public
       	 *
       	 * @param string|int $cap Capability or role name to search.
       	 * @return bool True, if user has capability; false, if user does not have capability.
       	 */
       	function has_cap( $cap ) {
       		if ( is_numeric( $cap ) ) {
       			_deprecated_argument( __FUNCTION__, '2.0', __('Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead.') );
       			$cap = $this->translate_level_to_cap( $cap );
       		}
   
       		$args = array_slice( func_get_args(), 1 );
       		$args = array_merge( array( $cap, $this->ID ), $args );
       		$caps = call_user_func_array( 'map_meta_cap', $args );
   
       		// Multisite super admin has all caps by definition, Unless specifically denied.
       		if ( is_multisite() && is_super_admin( $this->ID ) ) {
       			if ( in_array('do_not_allow', $caps) )
       				return false;
       			return true;
       		}
   
       		// Must have ALL requested caps
       		$capabilities = apply_filters( 'user_has_cap', $this->allcaps, $caps, $args );
       		$capabilities['exist'] = true; // Everyone is allowed to exist
       		foreach ( (array) $caps as $cap ) {
       			if ( empty( $capabilities[ $cap ] ) )
       				return false;
       		}
   
       		return true;
       	}
       ```
   
 *  Plugin Author [Katie](https://wordpress.org/support/users/kseaborn/)
 * (@kseaborn)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/wp_debug-errors-1/#post-3452145)
 * Strange, I DO have debug mode on, and I’m not receiving any of these messages.
 * Zotpress uses “current_user_can” to prevent non-editors (and non-admins) from
   accessing the Zotpress pages.
 * What is your account role? Could another plugin or theme be interfering?
 *  Plugin Author [Katie](https://wordpress.org/support/users/kseaborn/)
 * (@kseaborn)
 * [13 years ago](https://wordpress.org/support/topic/wp_debug-errors-1/#post-3452185)
 * Are these issues still occurring?
 *  Plugin Author [Katie](https://wordpress.org/support/users/kseaborn/)
 * (@kseaborn)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/wp_debug-errors-1/#post-3452190)
 * I’m going to close this thread due to inactivity — please feel free to re-open
   if you’re still encountering this issue.
 *  [LEPblog](https://wordpress.org/support/users/lepblog/)
 * (@lepblog)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/wp_debug-errors-1/#post-3452194)
 * I’m having this issue now. I don’t know what happened to cause it to change between
   yesterday and today, but I’m now getting the wp_enqueue_script errors too.
 *  Plugin Author [Katie](https://wordpress.org/support/users/kseaborn/)
 * (@kseaborn)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/wp_debug-errors-1/#post-3452195)
 * I think this happens when your host turns on debugging features, including warnings.
   Is the script working or just throwing these messages? When I turn on debugging
   there’s warnings, too.
 *  [LEPblog](https://wordpress.org/support/users/lepblog/)
 * (@lepblog)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/wp_debug-errors-1/#post-3452196)
 * You know what? I did turn on debugging. Thanks!
 *  Plugin Author [Katie](https://wordpress.org/support/users/kseaborn/)
 * (@kseaborn)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/wp_debug-errors-1/#post-3452197)
 * Great! Glad the issue is resolved.

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

The topic ‘WP_Debug Errors’ is closed to new replies.

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

## Tags

 * [errors](https://wordpress.org/support/topic-tag/errors/)

 * 11 replies
 * 4 participants
 * Last reply from: [Katie](https://wordpress.org/support/users/kseaborn/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/wp_debug-errors-1/#post-3452197)
 * Status: resolved