Support » Plugin: Contact Form 7 » Recommended red error box analysis

  • Hi, I was able to track down a red box error on my wordpress page by myself and wanted to share the way I did.
    ( Please delete if this is common knowledge 😉 )

    1. In wordpress go to Plugins, Editor. And there select Contact Form 7.

    2. Choose the file contact-form-7/includes/contact-form.php for editing.

    3. Find the function form_response_output() and go to the end of the function ( where the surrounding brackets close, right after the return $output; statement.

    4. We want to get as many informations as possible, so insert the following statement just before the return part:

    $output .= "<ul><li>" . implode("</li><li>", error_get_last() ) . "</li></ul>";

    Save afterwards, of course.

    5. Now, the next time you try out contact form you will recieve an unordered list after your red output box with the last error php encountered. The structure of the array is:

    [type] => Errorcode
    [message] => Text
    [file] => Location
    [line] => Number

    Armed with these informations, your next error-search with the community will probably be much easier.

    Good luck hunting your errors!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter yJan


    Could you make this a sticky ( if my approach pleases you ) ?

    Very nice. The Debug plugin will show errors as well, but for all plugins, not just CF7.

    Also, red box error is not always triggered by a PHP error. If wp_mail returns false (unsuccessful) you’ll get it as well.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Recommended red error box analysis’ is closed to new replies.