Before you ask please READ THIS

Prevent spam in theme contact from

edited April 2013 in Hypershot Posts: 6
First of all, I´m really happy with your theme. It´s very easy to use and all the information that you supply in this forum it´s awesome.

After a few weeks with the webpage online I´m starting to receive some annoying spam from the contact form. I´ve read in other post that you recommended some plugin (I´ve tried the captcha plugin but i couldn´t plaste the code that appears in the FAQ page of the plugin) and you didn´t offer support to captha.

So I´ve tried on my own to use recaptcha from Google for PHP. The verifying system looks ok but I wasn´t able to plaste the <?php code inside the form body. So I gave up and found another way, which I hopefully you can help me (maybe it´s not possible or it´s to complicate).

Straight to the point; I wanted to have a extra field in the form (which I called "secret field") so that I can hide it from the user (through css). And here is the trick, if the field keeps empty then the e-mail will be sent normally, but if the spam-robot fields it then it will be blocked. I had no problem to place the "secretfield" in the form (in utilities.php as described in the attached files) but I´ve not been able to found the right way to create the opposite error (all the other fields if they are empty they will show the error, but this field should be when it´s not empty). As I´m just a beginner I couldn´t find the right way with the true/false commands and the required rule.
I don´t know if you understood my point, but if i´m right it will be an easy and fast solution to avoid those spam attacks.

If it´s not possible it will be a pity because I really love this original way contact throught the show info, and i will have to create an other contact form with a plugin.

Have a nice week-end,

P.S: I´ve tried to attached you the utilities.php file but it wasn´t allowed so i had to take some screenshots.
UTILITIES.screenshot-1.png
1397 x 1012 - 215K
UTILITIES.screenshot-2.png
1395 x 1056 - 243K

Comments

  • AirAir
    Posts: 10,970
    Hello there :-)

    Thanks for all kind word, and sorry for late response(we have issues with putting new theme on ThemeForest and it consumed much time).

    To attach such file as *.php you will have to zip it first :-) It is cause of safety I think ;-)
    It would be easier for me to help you with code if I will receive file version :-)

    I must say that I have also tried adding recaptcha to our contact form but with no success. So in our new theme we integrated our contact form with http://wordpress.org/extend/plugins/captcha/ and I was thinking about adding this one to hypershot also in next update. It requires doing simple math to pass the test.

    So what do you think, we are working on your code or will you wait for update :-)?

    With regards.
  • Ok! here we go!
    There are no other modifications. just added the new box called: secretfield as the other existing boxes. Nothing more.
    If you can check and fix the problem in less than 2 minutes, It will be great (after all the time I expend trying to figure a solution). If not it´s not problem for me to wait for the update. However, if this secret field works it could be an extra filter. There is not a universal solution and some spam-robots can skip the captcha.
    So it´s up to you, I will be happy anyway.
    Best regards!
    zip
    zip
    utilities.zip
    9K
  • AirAir
    Posts: 10,970
    I think I will do it with captcha plugin, as it also protects comments form in posts. However I will take a look at your code tomorrow, as now my head is not fresh after whole day of finishing new theme:-)

    With regards.
  • AirAir
    Posts: 10,970
    Hello,

    This issue have been fixed in new version. You can download it on themeforest : http://themeforest.net/item/hypershot-photography-portfolio-wordpress-theme/3391790

    Finally I didn't check your file, for what I am sorry. If you will still need to add more protection we will continue this topic:-)
    Here is info about integrated plugin(it is from our new theme, cause I forgot to update Hypershot documentation...) http://apollo13.eu/docs/beach/#!/plugins_recomendations_captcha

    With regards.
  • Posts: 40
    Nice :)
    I was hoping for a simple integration - and of course, you found a way :)
  • Don't worry Air, with the updated solution it´s fine. If there are new spams coming in a far far away future I will let you know :).
    Thanks a lot for your great work!!!
  • AirAir
    Posts: 10,970
    Thanks for your kind words :-) Don't forget to rate us on ThemeForest - it helps us a lot!

    With regards.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!