Spam prevention interfere with Avada Forms
-
Hello,
since the 5.2.5 update, it seems that enablingDetect spambots that post comments
affects Avada forms (AIOS option can be found here:admin.php?page=aiowpsec_spam&tab=comment-spam
).Avada forms is an element of the Avada Builder with which you can create any form (e.g. a contact form). Just like with CF7 or Gravity forms.
I think the setting should only work for comments or am I missing something? So let me go into detail.
When a page contains a form, AIOS adds some Javascript to that page. This piece of code creates some hidden fields with randomly created input field names and values. When the form is submitted, these hidden fields are then sent along so that the recipient can see them.The corresponding code can be found here:
all-in-one-wp-security-and-firewall/classes/wp-security-comment.php
Here is the method (see around line 142):
public static function insert_antibot_keys_in_comment_form() { $key_map_arr = self::generate_antibot_keys(); if (empty($key_map_arr)) { return; } ?> <script> document.addEventListener('DOMContentLoaded', function (event) { for (let i = 0; i < document.forms.length; ++i) { let form = document.forms[i]; <?php foreach ($key_map_arr[0] as $key) { echo 'if (form.method != "get") { var input' . esc_attr($key[0]) . ' = document.createElement("input"); input' . esc_attr($key[0]) . '.setAttribute("type", "hidden"); input' . esc_attr($key[0]) . '.setAttribute("name", "' . esc_attr($key[0]) . '"); input' . esc_attr($key[0]) . '.setAttribute("value", "' . esc_attr($key[1]) . '"); form.appendChild(input' . esc_attr($key[0]) . '); }' . "\n"; } ?> } }); </script> <?php }
Deactivating the spam protection option mentioned at the beginning solved the problem, but then you no longer have spam protection.
- The topic ‘Spam prevention interfere with Avada Forms’ is closed to new replies.