Title: Small modification suggestion
Last modified: July 5, 2026

---

# Small modification suggestion

 *  [SG213](https://wordpress.org/support/users/sg213/)
 * (@sg213)
 * [3 days, 17 hours ago](https://wordpress.org/support/topic/small-modification-suggestion/)
 * Thanks for the nice lightweight plugin.
   Initially I was having some problems 
   with it – I would try to submit a message on the contact form page, but it would
   respond with a “1” in a red box. However, the message still got sent.After digging
   around a bit, it seems that I had something (most likely in my plugin inventory)
   which had output a newline before the AJAX handler in inc/ef-ajax.php had been
   called. This was then throwing off the check for a plain “1” (without newlines)
   in essential-form.php, and making it think the call had failed.Would it be possible
   to add something like the following just before the “echo wp_mail()” call in 
   ef-ajax.php? This should flush any extraneous buffered output before the echo.
   I know it’s not a problem with your plugin per-se, but it might fix some edge
   cases like this where other plugins etc. are not behaving properly.
 *     ```wp-block-code
       if ( ob_get_length() ) {
           ob_clean();
       }
       ```
   

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

 *  Plugin Author [Jose Mortellaro](https://wordpress.org/support/users/giuse/)
 * (@giuse)
 * [3 days, 10 hours ago](https://wordpress.org/support/topic/small-modification-suggestion/#post-18956183)
 * Many thanks [@sg213](https://wordpress.org/support/users/sg213/)
 * I suggest hooking into the `essential_form_before_sending` action to clear the
   output buffer:
 *     ```wp-block-code
       add_action( 'essential_form_before_sending',function() {    if ( ob_get_length() ) {        ob_clean();    }} );
       ```
   
 * Normally, the output buffer should be empty at this stage. If it isn’t, it usually
   means that another plugin or custom code has generated unexpected output during
   the AJAX request.
 * While clearing the buffer is a valid workaround, I believe it’s better to identify
   and fix the original source of that output. Otherwise, the same issue could also
   affect other plugins or AJAX endpoints, not just Essential Form.
 * For this reason, I would recommend using the snippet above as a temporary workaround
   while investigating which code is filling the buffer.
 * I prefer not to add this behavior to the core of Essential Form. Automatically
   clearing the output buffer would hide problems caused by third-party code, making
   them harder to detect and fix. I think it’s better for Essential Form to provide
   a hook for custom workarounds when needed, rather than silently masking issues
   originating elsewhere.
 * I hope it helps
 * Have a great day!
 *  Thread Starter [SG213](https://wordpress.org/support/users/sg213/)
 * (@sg213)
 * [2 days, 23 hours ago](https://wordpress.org/support/topic/small-modification-suggestion/#post-18956560)
 * Thanks for the detailed reply, yes that’s totally reasonable – I just thought
   I would post it here also in case anyone else had a similar issue and was trying
   to figure out what was happening. I’ll look again for the stray newline.

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

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fsmall-modification-suggestion%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/essential-form/assets/icon-256x256.png?rev=2872333)
 * [Essential Form - The lightest plugin for contact forms, ultra lightweight and no spam](https://wordpress.org/plugins/essential-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/essential-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/essential-form/)
 * [Active Topics](https://wordpress.org/support/plugin/essential-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/essential-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/essential-form/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [SG213](https://wordpress.org/support/users/sg213/)
 * Last activity: [2 days, 23 hours ago](https://wordpress.org/support/topic/small-modification-suggestion/#post-18956560)
 * Status: not resolved