Marketpress generating lots of warning making debugging impossible

Marketpress is generating about 30+ debug messages. This is making developing my marketpress theme pretty unpleasant.

I understand that your general attitude towards warnings is “they are not a problem” but I don’t really agree.

The warnings seem to be mostly to do with your custom WP_Query code. The stack trace doesn’t show where it is as it’s being triggered by a hook so it’s going to be a pain to actually find the responsible code.

Are these debug notices on the development schedule to be fixed or are they a permanent part of marketpress? Are there any hacks I can do to stop them showing for my development site but still show warnings from my own code?

  • Michelle Shull
    • DEV MAN’s Apprentice

    Hi, Mike!

    I just turned on DEBUG on a site with only MarketPress and a default theme active, and I’m not seeing any warnings, errors, or notices. Would you mind sharing the debug messages you’re seeing? What other plugins do you have active at this time? I’d like to try to reproduce what you’re seeing, if I can.

    Thanks!

  • Mike
    • The Bug Hunter

    I installed fresh blog on host with production PHP configuration now with marketpress and it just shows 4 notices. If you set PHP to development mode with improved error reporting its about 30 notices. I understand that these are just notices. I did a little research to try and find out why they are occurring and it seems to be from way the queries have been optimised but without spending a lot of time getting to grips with the code (public facing code, I assume your development code is more modular) I couldn’t really say what’s causing them which makes me reluctant to use it as a platform.

    I guess I am just feeling a bit dissapointed, when I found WPMUDEV it looked so awesome but every plugin I have tried so far has had issues. Because the code is behind a paywall there isn’t a community supporting core updates with pull requests so I guess you guys have a massive code base to maintain which must be tough so I can understand.

    The debug messages that show on fresh install with production PHP settings and simple market theme are:

    Notice: Trying to get property of non-object in /home/…/wp-includes/comment-template.php on line 1040

    Notice: Undefined index: only_store_pages in /home…/wp-content/plugins/marketpress/marketpress.php on line 8007

    Notice: Undefined offset: 0 in /home/…/wp-includes/query.php on line 3708

    Notice: Trying to get property of non-object in /home/…/wp-includes/query.php on line 4577

    They appear on “/store/products/”

    The only solution for me that I can see is to turn off the debug display and then write a text parser that ignores all of these notices so I can just see my own notices/warnings/errors. If your devs can think of an easy way for me to do that then I’d be grateful as looking through 30 or so stack traces to see if there is an issue with my code gets boring pretty quick.

  • Mike
    • The Bug Hunter

    Whoop whoop! I found a solution. Query Monitor plugin catches all the PHP notices, removes the duplicates and reformats so it doesn’t get in the way.

    It also shows me the functions being called on the hooks so I can (hopefully) locate where your code is generating these notices and try to understand why it’s like this in a production release.

  • Mike
    • The Bug Hunter

    The non-object notices seem to being generated because null value being sent. This seems to usually be caused by using the wordpress loop on an array that doesn’t contain the full post data. Somewhere there are loops that needs to be replaced with foreach.

  • Bojan Radonic
    • CCO / Deputy COO

    Hey there @Mike,

    Sorry for the delay. Our developers are currently working on 3.0 but I can’t provide ETA on when the update will be released especially with such a major update that will require a lot of testing before it’s released.

    Unfortunately aside from soon I can’t really provide any more information, looking forward for that update same as you :slight_smile:

    Cheers,

    Bojan