Krop Spam — permanently stop spam in your blog comments

I’ve been tired of com­ment spam at my blogs (I also use Word­Press as a CMS engi­ne so com­ment spam is even more pain in the ass) so I have cre­ated a method to stop it. My method pro­ved to be very effi­cient and doesn’t need any human inte­rac­tion (whi­le plu­gins such as Aki­smet requ­ire blog owner to perio­di­cal­ly look thro­ugh spam fol­der to check if the­re are­n’t any fal­se posi­ti­ves). I have deci­ded to wrap it up in a plugin.

How does it work?

Well, I’ve noti­ced that spam­bots usu­al­ly direc­tly attack the wp-comments-post.php script that is a Word­Press com­ment pro­ces­sing script. Some (but this is real­ly rare) spam­mers also try to par­se the WWW page and when they find a <form> the­re, they just blin­dly fill it in and submit.

If you look into any Word­Press tem­pla­te sour­ce code, you’ll find that the­re is a <texta­rea name=„comment”> some­whe­re insi­de. This is a text field for com­ment con­tent that user enters. Spam­mers just fill it in with garbage.

What my plu­gin does is chan­ge this <texta­rea> name to some­thing meanin­gless for spam­mers (by default its „komen­ta­rzyk” which means „a lit­tle com­ment” in Polish 😉 ). This way, whe­ne­ver a spam­mer attacks your wp-comments-post.php direc­tly, he doesn’t fill now requ­ired „komen­ta­rzyk” field and the com­ment is not added. More­over, my plu­gin leaves the <texta­rea name=„comment” in the sour­ce code, but makes it small (1 row and 1 column only) and tries to hide it thro­ugh CSS (display: none) so human user will pro­ba­bly not fill that field in. Spam­mers don’t bother to check texta­re­a’s size nor do they under­stand CSS, so even when they par­se your webpa­ge, they not only fill in requ­ired „komen­ta­rzyk” field, but also fill in the „com­ment” field (becau­se they fill in just eve­ry­thing they find). This way they let your blog now they are bad people — if „com­ment” field is fil­led in, pro­ba­bly machi­ne fil­led in your com­ment form inste­ad of human. So we refu­se the com­ment to be added.

So, how to install the plugin?

1. Down­lo­ad the Krop Spam plu­gin and unzip it into your Word­Press wp-con­ten­t/plu­gins directory.
2. Ena­ble the plu­gin in Word­Press admin.
3. Open up wp-comments-post.php in your favo­ri­te text edi­tor and find a line that says:

$comment_content = trim($_POST['comment']);  

4. Repla­ce this line with fol­lo­wing fragment:

if(trim($_POST['comment']) != '') wp_die( __('Sorry, small comments field should be left empty - it\'s a spam trap.'));
$comment_content = trim($_POST['komentarzyk']);

5. You’re done 🙂

I have tested the plu­gin with few Word­Press the­mes found on the inter­net and it works cor­rec­tly. The only plu­gi­n’s requ­ire­ment is that it needs to have access to any tem­po­ra­ry direc­to­ry (usu­al­ly /tmp) on the server. It’s almost always possi­ble. If not — talk to you provider.

How efficient is it?

I have been using this method at my Kar­ko­no­sze page sin­ce a few mon­ths ago and it decre­ased the num­ber of spam I rece­ive from 20 – 30 a week to 1 in 3 mon­ths. The­re­’s no guaran­tee it will work for you though 😉

Nie wiadomo jak

Nowy począ­tek nowy roz­dział moje­go życia
Roz­po­czął się w dniu któ­ry myśla­łem może być moim ostatnim
Me oczy były sze­ro­ko zamknię­te ale nie pod­da­łem się
Po pro­stu pomy­śla­łem że przej­dę przez świat samotnie

Nagle nie wia­do­mo jak pozna­łem tam ciebie
Poka­za­łaś mi życie któ­re­go nie widzę bez cie­bie i nie ma po pro­stu sposobu
Bym poko­nał te uczu­cia twą ener­gię pły­ną­cą prze­ze mnie
Nikt nie odbu­du­je mnie jak ty
Nie wia­do­mo jak
Jak to jest możliwe?

Rodzi­na i przy­ja­cie­le byli moim życiem nie nale­ża­łem do Ikarów
Lecz dałaś mi miłość któ­rej nie umiem ukryć
Jeśli będą chwi­le gdy będzie­my dale­ko chcę byś wie­dzia­ła że jesteś w moim sercu
I roz­kwi­tasz w prze­cu­dow­ny ogród

Żad­nych uczuć całe moje cia­ło było jak lód
Potrze­bo­wa­łem czuć że słoń­ce oświe­tli mi drogę
Mój świat obró­cił się w perzy­nę ale mia­łem wia­rę i zaufanie
Po pro­stu pomy­śla­łem że przej­dę przez świat samotnie

Nagle nie wia­do­mo jak pozna­łem tam ciebie
Poka­za­łaś mi życie któ­re­go nie widzę bez cie­bie i nie ma po pro­stu sposobu
Bym poko­nał te uczu­cia twą ener­gię pły­ną­cą prze­ze mnie
Nikt nie odbu­du­je mnie jak ty
Nie wia­do­mo jak
Jak to jest możliwe?

Del­ta Goodrem — Out of the blue

Tajemne życie

Od czer­wo­nych olbrzy­mów przez supernowe
Wra­ca­jąc do cie­bie i do mnie
Ukry­ty byt
W wir­tu­al­nej rzeczywistości
Zme­cha­ni­zo­wa­na i zorganizowana
Widzę jak na dłoni
Siłę zapracowaną
Tka­niem fantazji
Tak trud­no ją zrozumieć
I czę­sto jeste­śmy ślepi
Lecz gdy­by praw­da była oceanem
Czy zmie­ści­ła­by się w kału­ży ludz­kie­go umysłu

Jesteś cał­kiem samotny
Choć nie wyda­je się to spe­cjal­nie fair
Dla­cze­go wszy­scy jeste­śmy porzu­ce­ni w ignorancji
Wpa­da­jąc w zwątpienie
Filo­zo­fia i teologia
Pro­po­nu­ją nam rzut oka
Na coś bar­dziej niewiarygodnego
Niż ty i ja

Więc wezwij na pomoc tajem­ne życie
Wezwij na pomoc tajem­ne życie
Pokaż mi spo­sób na życie
Powo­łaj tajem­ne życie

Ewan­ge­li­ści, scjentolodzy
I inni któ­rych nie wspomnę
Pro­po­nu­ją lek­cje kodologii
Wszyst­ko w dobrych intencjach
Słu­chaj na wła­sne ryzyko
Daj uwię­zić swo­ją duszę
Przy­wróć swą wrażliwość
Na ten nie­wia­ry­god­ny wymiar

Myślę więc jestem

The Corrs — Secret Life

Projekt domu — podsumowanie

Czas: od 22 stycz­nia 2007
Kosz­ty:

  • ta stro­na jest do uzu­peł­nie­nia (i jej data do zmiany)

Nasze kry­te­ria:

  • dom dla rodzi­ny 2+3 (kto wie ile potom­stwa zechce­my mieć 😉 )
  • raczej nie­pod­piw­ni­czo­ny
  • garaż dosta­wi­my kie­dy indziej, wolnostojący
  • na dole musi być sypial­nia dla gości i gabinet
  • kuch­nia, jadal­nia i salon w jed­nym cią­gu (może być w kształ­cie lite­ry L) ale jakoś logicz­nie ułożone
  • kuch­nia z małą spiżarką
  • komi­nek
  • pomiesz­cze­nie gospo­dar­cze z osob­nym wejściem
  • będzie­my grzać prą­dem i komin­kiem więc kotłow­nia niepotrzebna
  • dwie łazien­ki: na dole prysz­nic, na górze wanna
  • na górze 4 pokoje
  • moż­li­wość odło­że­nia wykoń­cze­nia góry na póź­niej będzie dodat­ko­wym atutem 🙂
  • wydać jak najmniej 🙂