Theme Check
[resolved] "WARNING: WP_DEBUG is not enabled!"... when it is. (6 posts)

  1. catnip216
    Posted 2 years ago #

    I have this line in wp-config.php:

    But every time I run Theme Check, I get:

    WARNING: WP_DEBUG is not enabled! Please test your theme with debug enabled before you upload!

    I've tried deactivating all plugins, switching themes, checking different themes, etc.

    Any suggestions?


  2. Simon Prosser
    Theme Review Admin
    Plugin Author

    Posted 2 years ago #

    Maybe you have the line commented out.

    Heres the code:

    if ( !defined( 'WP_DEBUG' ) || WP_DEBUG == false ) ....

    so if its not defined or false the message is displayed. if its set to true the message isnt displayed simple as that.

  3. catnip216
    Posted 2 years ago #

    It was not commented out, but I did find the problem.

    I dug around wp-config.php, and found that define('WP_DEBUG', false); was already in there for some reason, higher up in the file.

    I'd figure that setting it to true at the bottom of the file would have overridden that setting, but apparently it didn't. Removing it from the bottom, and setting the first instance to true solved it.

    So while it was by no means a difficult fix, it wasn't quite "simple as that".

  4. Simon Prosser
    Theme Review Admin
    Plugin Author

    Posted 2 years ago #

    You can only define a constant once, you were probably filling your logs with php warnings abou it already being defined.

  5. catnip216
    Posted 2 years ago #

    I understand that now, I just didn't realize it had already been defined.

    I do need to get better about remembering to check my logs. This isn't the first time I've asked for help before doing so, and I always kick myself for it.

  6. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 1 year ago #

    Also, defines always go towards the top of the file. Putting them "at the bottom" won't work.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic


No tags yet.