• Resolved Jensdiep

    (@jensdiep)


    Hallo, first of all; Thanks for this super clean plugin, love it.

    There is a error when I enable “Add some fake input inside the form” function. It breaks the HTML of my forms. It looks like there is an HTML tag who isn’t closing. Like <div> without the </div>

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Erik

    (@codekraft)

    oh thank you @jensdiep!

    Could you send me a minimal configuration of your form that is corrupted by the honeypot? Sometimes happens because inputs are inside multiple containers and the php parser cannot properly parse html5 :/

    georg.r

    (@georgr)

    I have a similar issue. The plugin messes up the HTML Code. It moves the closing div tag to a different position which breaks the layout.

    If I enter something like this:

    <div class="row">
        <div class="column">
            [text your-name-1 placeholder "Your Name"]
        </div>
        <div class="column">
            [email* your-email-1 placeholder "Your Email"]
        </div>
    </div>
    
    [textarea your-message-1 40x6 placeholder "Message"]
    [submit "Send"]

    I end up with something like this:

    <div class="row">
        <div class="column">
            [text your-name-1 placeholder "Your Name"]
        </div>
        <div class="column">
            [email* your-email-1 placeholder "Your Email"]
        </div>
    
    
    [textarea your-message-1 40x6 placeholder "Message"]
    [submit "Send"]
    </div>

    The closing div is moved below the send button and brakes the row.

    Thread Starter Jensdiep

    (@jensdiep)

    @codekraft I have exactly the same as @georgr that’s a good example ??

    Plugin Author Erik

    (@codekraft)

    Ok guys, I want to confirm that the problem exists, and that I will probably release a new version soon that solves the problem.

    Unfortunately placing honeypots without requiring the user to enter the placeholder in the contact form, is not easy… currently I am using php domDocument but this seems to work differently depending on the version of php and, in general, this function fails to do correctly what it was meant to do :/

    For this I will replace everything with a classic regex replace, just give me some time to make the necessary changes and tests. Thank you for reporting the problem and making this plugin even better!

    georg.r

    (@georgr)

    Great, thank you Erik

    Thread Starter Jensdiep

    (@jensdiep)

    Thanks @codekraft understand your struggle domDocument sucks… A small suggestion; an other solution is to create a shortcode within CF7 to display this.

    Plugin Author Erik

    (@codekraft)

    @jensdiep good point but adding honeypots with a shortcode is already something that another plugin specifically for honeypots in cf7 does… But it’s not what I would want, because for people like me who manage many forms it’s really a hassle.

    I would like, without configuration, to create the necessary honeypots but the issue arises because it has to be done server side with php (who does not excel at manipulating dom) before the form is served and I can’t do it with js.

    The reason is because 99.9% of the bots pointing to WP sites download the page with curl|wget|… and then send the email with a post directly to the server avoiding any “in-page” checking. Unfortunately, it is not easy to create a function that covers all types of form templates (especially with domDocument) so I am switching to a safer method like a regex, but please just give me some time to rewrite that function!

    Thread Starter Jensdiep

    (@jensdiep)

    Good point I understand.
    Thanks for the effort!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Add some fake input inside the form breaks HTML’ is closed to new replies.