Title: PHP Notice in Debug mode
Last modified: August 22, 2016

---

# PHP Notice in Debug mode

 *  [Eduardo Turiño](https://wordpress.org/support/users/eturi/)
 * (@eturi)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/php-notice-in-debug-mode/)
 * When WP_DEBUG is enabled, a Notice is displayed:
 * `Notice: Trying to get property of non-object in /wp-content/plugins/better-wp-
   security/modules/free/tweaks/class-itsec-tweaks.php on line 216`
 * Regards…
 * [https://wordpress.org/plugins/better-wp-security/](https://wordpress.org/plugins/better-wp-security/)

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

 *  [iThemes Support](https://wordpress.org/support/users/ithemes-support/)
 * (@ithemes-support)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/php-notice-in-debug-mode/#post-5204165)
 * Hey ETMSOFT,
 * Thanks for reporting this! I’ll make sure it’s updated in a near future release.
 * Thanks,
 * Gerroald
 *  [dalecoooperfr](https://wordpress.org/support/users/dalecoooperfr/)
 * (@dalecoooperfr)
 * [11 years ago](https://wordpress.org/support/topic/php-notice-in-debug-mode/#post-5204360)
 * Hi,
    this is still present in the current version. Any chance to get rid of it?
 * Thanks
    Ben
 *  [dwinden](https://wordpress.org/support/users/dwinden/)
 * (@dwinden)
 * [11 years ago](https://wordpress.org/support/topic/php-notice-in-debug-mode/#post-5204361)
 * Probably not without any additional info …
 * First of all I think the line number has changed from 216 to 220.
 * And is this occurring in frontend or backend (or both) ?
    What are the exact 
   steps to reproduce this ? Are we talking about a single occurrence of the notice
   or is it repeated a number of times (with or without variations)? It would be
   interesting to post a screenshot of the notice clearly displaying it on screen.
 * I think we are missing an important piece of the puzzle because in a vanilla 
   WP env with the latest iTSec plugin installed I’m unable to reproduce the notice.
 * I suspect the notice is generated on execution of the following code line:
 * $jquery_ver = $wp_scripts->registered[‘jquery’]->ver;
 * In a standard WP env the jquery.js script is registered by WP. The notice would
   seem to indicate that this is not the case in your WordPress env …
    Possibly 
   because of another plugin or theme …
 * So instead of pointing a vinger towards the iTSec plugin there may be something
   non standard in your WP env that needs to be investigated …
 * Just some thoughts that might help to get to the bottom of this.
 * dwinden
 *  [toulouse](https://wordpress.org/support/users/toulouse/)
 * (@toulouse)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/php-notice-in-debug-mode/#post-5204362)
 * Hello,
    I also got this notice when `wp_debug` was enabled.
 * dwinden, you are correct, the line number has changed to 220.
 * The theme I used had `wp_deregister_script('jquery')` in it’s functions.php file.
   That was why `$wp_scripts->registered['jquery']` was not an object.
 * I changed line 220 to:
 *     ```
       if ( is_object ( $wp_scripts->registered['jquery'] ) ) {
       	$jquery_ver = $wp_scripts->registered['jquery']->ver;
       } else {
       	$jquery_ver = null;
       }
       ```
   
 * This got rid of the notice. Themes deregistering jquery is probably not good 
   practice, but with this check you can avoid the notice when using such themes.
 * p.s. sorry if there are formatting errors. Just created this account to post 
   this.
 * Edit: This actually gave me another notice (`undefined index jquery`). What I
   use now:
 *     ```
       if ( isset ( $wp_scripts->registered['jquery'] ) && is_object ( $wp_scripts->registered['jquery'] ) ) {
       	$jquery_ver = $wp_scripts->registered['jquery']->ver;
       } else {
       	$jquery_ver = null;
       }
       ```
   
 *  [dwinden](https://wordpress.org/support/users/dwinden/)
 * (@dwinden)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/php-notice-in-debug-mode/#post-5204363)
 * Thank you very much for this excellent feedback.
 * dwinden

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

The topic ‘PHP Notice in Debug mode’ is closed to new replies.

 * ![](https://ps.w.org/better-wp-security/assets/icon.svg?rev=2980272)
 * [Solid Security – Password, Two Factor Authentication, and Brute Force Protection](https://wordpress.org/plugins/better-wp-security/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/better-wp-security/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/better-wp-security/)
 * [Active Topics](https://wordpress.org/support/plugin/better-wp-security/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/better-wp-security/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/better-wp-security/reviews/)

 * 5 replies
 * 5 participants
 * Last reply from: [dwinden](https://wordpress.org/support/users/dwinden/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/php-notice-in-debug-mode/#post-5204363)
 * Status: not resolved