Title: [Plugin: Web Ninja Google Analytics] undefined variable and constant
Last modified: August 20, 2016

---

# [Plugin: Web Ninja Google Analytics] undefined variable and constant

 *  [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [14 years ago](https://wordpress.org/support/topic/plugin-web-ninja-google-analytics-undefined-variable-and-constant/)
 * version 1.0.8
    I get this in my error_log
 * PHP Notice: Undefined variable: wbga_debug_enabled in /wp/wp-content/plugins/
   web-ninja-google-analytics/webninja_ga.php on line 752
 * Also,
    Use of undefined constant user_level – assumed ‘user_level’ in /wp/wp-
   content/plugins/web-ninja-google-analytics/webninja_ga.php on line 1413
 * [http://wordpress.org/extend/plugins/web-ninja-google-analytics/](http://wordpress.org/extend/plugins/web-ninja-google-analytics/)

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

 *  [cm258](https://wordpress.org/support/users/cm258/)
 * (@cm258)
 * [14 years ago](https://wordpress.org/support/topic/plugin-web-ninja-google-analytics-undefined-variable-and-constant/#post-2731869)
 * I’ve had to fix those errors every time I update this plugin for a while now.
   I actually make three edits:
 * Add a line before line 752 right after the function declaration for “wgba_debug”:
 *     ```
       function wbga_debug($message) {
         global $wbga_debug_enabled;  // insert this line
         if ($wbga_debug_enabled) {
       ```
   
 * Then, go to the function “wgba_track_user” and change the third line of that 
   function to make it look like this:
 * `if (!($user_level)) {`
 * Finally, I also have to make a change to the in the Stat Dashboard Settings section.
   There’s a missing “php” opening a block of PHP code that will cause issues on
   some systems. It’s on line 1076 in the file and looks like this:
 * `<? if(!class_exists('SimpleXMLElement'))`
 * I alter it like so:
 * `<?php if(!class_exists('SimpleXMLElement'))`
 * cm258
 *  Plugin Author [joshfowler](https://wordpress.org/support/users/joshfowler/)
 * (@joshfowler)
 * [14 years ago](https://wordpress.org/support/topic/plugin-web-ninja-google-analytics-undefined-variable-and-constant/#post-2731870)
 * Thanks for catching those. I just changed the code and pushed it to wordpress.
   It should tell you to update to 1.0.9 soon.
 *  Thread Starter [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [14 years ago](https://wordpress.org/support/topic/plugin-web-ninja-google-analytics-undefined-variable-and-constant/#post-2731872)
 * Thank you!
    Maybe the author will fix it in the plugin…
 *  [cm258](https://wordpress.org/support/users/cm258/)
 * (@cm258)
 * [14 years ago](https://wordpress.org/support/topic/plugin-web-ninja-google-analytics-undefined-variable-and-constant/#post-2731873)
 * You’re welcome…
 * > Maybe the author will fix it in the plugin…
 * Looks like he just updated to 1.0.9, and incorporated those three fixes…

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

The topic ‘[Plugin: Web Ninja Google Analytics] undefined variable and constant’
is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/web-ninja-google-analytics.svg)
 * [Web Ninja Google Analytics](https://wordpress.org/plugins/web-ninja-google-analytics/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/web-ninja-google-analytics/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/web-ninja-google-analytics/)
 * [Active Topics](https://wordpress.org/support/plugin/web-ninja-google-analytics/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/web-ninja-google-analytics/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/web-ninja-google-analytics/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [cm258](https://wordpress.org/support/users/cm258/)
 * Last activity: [14 years ago](https://wordpress.org/support/topic/plugin-web-ninja-google-analytics-undefined-variable-and-constant/#post-2731873)
 * Status: not resolved