• Resolved dave1010

    (@dave1010)


    With WP_DEBUG on, the Contact Form 7 to Database Extension plugin has lots of PHP Notices on every page load. While these are not errors, they make developing other plugins with WP_DEBUG on very difficult.

    Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    Where do you turn on WP_DEBUG? I am setting define('WP_DEBUG', true); everywhere I can think of but I see no debug output on pages.

    Try adding it near the top of your wp-config.php file.

    Plugin Author Michael Simpson

    (@msimpson)

    That worked (I had it at the bottom of that file and it did not work…)
    Once I turned it on I saw some warnings and I committed changes to the development version (trunk) that removed the warnings I saw. Try that and let me know if you see any further warnings.

    You need to change any “function &” to “function” to suppress the errors .. its explained here: https://www.php.net/manual/en/language.references.return.php , notably: “If you try to return a reference from a function with the syntax: return ($this->value); this will not work as you are attempting to return the result of an expression, and not a variable, by reference.”

    Not sure why you need all the references anyways?

    /* off topic – and to what the original poster mentions, I find if rather annoying and lazy that so many plugin developers don’t keep debug set to true when working on their plugins. But thats another rant. */

    And to fix it – what you really need to do is assign the expression / object property to a variable and return that? If I am not mistaken.

    Plugin Author Michael Simpson

    (@msimpson)

    @mardala: I claim this is already fixed in the *development* version. If you continue to see such notices in that version, please post the specific notices you see.
    Thanks for the tip.

    Thread Starter dave1010

    (@dave1010)

    @msimpsonthanks for the quick update. I’ll give it a go.

    @mardala I think WP doesn’t make the WP_DEBUG very discoverable. If it was up to me, I’d force debugging on all the time.

    @dave1010 – I apologize if I was coming across a bit conceited. It wasn’t my intention. I’ve just noticed it a lot when I work on wordpress and downloaded plugins, that is that a lot of plugins throw tons of notices (undefined indexes, deprecated functions / code etc.). I guess it could also reflect dev server settings?

    @msimpson – noted. I am basing this off of the downloaded version, which I downloaded this week.

    Plugin Author Michael Simpson

    (@msimpson)

    Newly released version 1.4.4 should be free from such warning messages.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Contact Form 7 to Database Extension] Lots of "PHP Notice: Only variable references s’ is closed to new replies.