[Plugin: WordPress Form Manager] Help with an additional spam prevention hack
-
I just started using Form Manager so I could be mistaken about this. Please don’t shoot me if I’m wrong. Thx.
After hunting around in the code, best I can tell the validation for required is strictly client side. Correct?
I have an install where reCAPTCHA is not an option. I was using Conditions as a CAPTCHA-lite of sorts. For example, don’t display a required field unless the correct value of X + Y = is entered. For example, don’t display the (required message) text box unless the addition is correct.
However, spam bots are naturally bypassing the form and submitting directly. In short, my CAPTCHA-lite trick doesn’t always work. As a result I’m trying to add a server side hack that check to the plugin that won’t add submits unless the required fields are populated.
This is what I have thus far:
In db.php I added:
function getItemRequiredStatus($formID, $uniqueName){ $q = "SELECT * FROM <code>".$this->itemsTable."</code> WHERE <code>unique_name</code> = '".$uniqueName."' AND <code>ID</code> = '".$formID."'"; $res = $this->query($q); if(mysql_num_rows($res) == 0) return '2'; $row = $this->unpackItem(mysql_fetch_assoc($res)); mysql_free_result($res); return $row['required']; }
In api.php below the Nonce check I added:
//server side check to see if required fields have been populated
foreach($formInfo['items'] as $item){
if ($postData[$item['required']] != getItemRequiredStatus( $formInfo['ID'],$postData[$item['unique_name']])) {
return false;
}
}Does this make sense? Yes, I could install it. However, after crawling thru the beautiful but (for me) complex code of the plugin for the last couple hours I wanted to ask others for input before I start pulling my hair out trying to get this hack to work.
And if I have it right, perhaps as a fail-safe this hack (or similar) could/should be added to a future release? I under it’s somewhat of a unique situation but none the less, a little bit of air-tightness never hurt anybody, eh? ??
Thanks
https://www.ads-software.com/extend/plugins/wordpress-form-manager/
- The topic ‘[Plugin: WordPress Form Manager] Help with an additional spam prevention hack’ is closed to new replies.