Advertisement:

Author Topic: [PLUGIN] - Stop Registration Spam  (Read 12064 times)

Basti

  • Newbie
  • *
  • Posts: 5
[PLUGIN] - Stop Registration Spam
« on: December 12, 2012, 01:03:23 am »
Hey everyone. This is my second plugin and i thought i share it. So there is room for improovement i guess :)

Features:
1) Checks email and IP against the api from stopforumspam.com
2) If spammer, insert into logs
3) if spammer was previous dedected already, update spam attemps and last spam date
4) If spammer, stop registration and forward to website root.
5) Admin view spam attemps, email, ip of every spammer via the configure link
6) Delete entries

Installation
1) Upload to oc-content/plugins
2) Since version 3.1 is not out yet open oc-includes/os-class/UserActions.php
Find:
Code: [Select]
        //add...
        function add()
        {

On a new line below add:
Code: [Select]
            osc_run_hook('pre_user_post');

3) Log into admin and click install on the plugins page ( Register Spam Check )

Planned features ( maybe, dont have much time )
1) Admin configure not allowed domain list ( see notes point #2 )
2) Admin configure: Extent to enable areas to use this plugin for
- Post ad if registration is not required
- Contact ad seller
3) Admin view spam attemps: Search for ip / email and add sorting option to the list. For now it sorts by latest spam attempt
4) Set number of entries to display per page. For now 20 hardcoded

Notes
1) Had no idea how i duplicate the admin pagination, so i made a new one, is not pretty ( plain links ) but does the job
2) by default the script blocks emails from mail.ru and bigmir.net If you dont want that or want to extent it, please open index.php and extend as needed
Code: [Select]
    $main_domains = array('mail.ru','bigmir.net');or to remove, change line to
Code: [Select]
    $main_domains = array();

« Last Edit: December 12, 2012, 03:02:37 am by Basti »

cartagena68

  • issues
  • Hero Member
  • *
  • Posts: 1186
Re: [PLUGIN] - Stop Registration Spam
« Reply #1 on: December 12, 2012, 01:17:49 am »
Hi Basti,
just a question, this plugin will work just for registration form or also to pubblish a new ad form.
I mean, in my sites anyone can publish a new ad, no registration is required, the plugin will stop the spammer?

Basti

  • Newbie
  • *
  • Posts: 5
Re: [PLUGIN] - Stop Registration Spam
« Reply #2 on: December 12, 2012, 01:22:18 am »
Hey, sorry. As of now it only supports the registration form ( was a job i did for someone ).
When i integrate some configurable options, ill make sure to insert a choice for where you wish to enable it.

Added it to the planned features
« Last Edit: December 12, 2012, 01:24:21 am by Basti »

cartagena68

  • issues
  • Hero Member
  • *
  • Posts: 1186
Re: [PLUGIN] - Stop Registration Spam
« Reply #3 on: December 12, 2012, 01:28:15 am »
Ok, thank you
Anyway good job, is a helpfull plugin.

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: [PLUGIN] - Stop Registration Spam
« Reply #4 on: December 12, 2012, 02:10:49 am »
@basti
Good job man, do you have idea if it is possible to use also to check contact seller email ?

//edit
Well, I have solution  8)

1. open /oc-content/plugins/spamcheck/index.php and after last function (function spamcheck_die() ) add this function:
Code: [Select]
function spamcheck_die_contact()
{
    $spambot = checkSpambots(Params::getParam('yourEmail'), $_SERVER['REMOTE_ADDR'], Params::getParam('yourName'));
    if($spambot == true){
        header('Location: '.osc_base_url());
        exit;
    }
}

and at the end of file above ?> add:
Code: [Select]
osc_add_hook('item_contact_form', 'spamcheck_die_contact');

2. Now go to oc-includes/osclass/ItemActions.php and find:
Code: [Select]
public function contact()
below this function (also below {) add this line:
Code: [Select]
osc_run_hook('item_contact_form');

Thats all, shared database for registration and also contact, I will try to make IP address button that you click on it, plugin IP block will automaticly block that IP.
« Last Edit: December 12, 2012, 02:43:07 am by frosticek »

Basti

  • Newbie
  • *
  • Posts: 5
Re: [PLUGIN] - Stop Registration Spam
« Reply #5 on: December 12, 2012, 03:00:53 am »
@basti
Good job man, do you have idea if it is possible to use also to check contact seller email ?

Hey, thank you.
As stated before already, as of now not, sorry. Only registration is possible. But when i edit it again to do the admin config addition ill include contact as well.
Ill place some sort of checkboxes maybe for which area to activate the plugin ( hope not all areas need a new hook, will be a pain to update osclass )

EDIT:: Nice addition there :)
A feature to cross work with IP blocker plugin is a really good idea
« Last Edit: December 12, 2012, 03:05:35 am by Basti »

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: [PLUGIN] - Stop Registration Spam
« Reply #6 on: December 12, 2012, 03:16:10 am »
I almost have it, tomorrow I will share it and maybe you could edit files of plugin and reupload it as new version :o

Basti

  • Newbie
  • *
  • Posts: 5
Re: [PLUGIN] - Stop Registration Spam
« Reply #7 on: December 12, 2012, 03:37:01 am »
Will do, but with some modification as written in the planned features :)

BadDevil

  • Newbie
  • *
  • Posts: 20
Re: [PLUGIN] - Stop Registration Spam
« Reply #8 on: December 12, 2012, 01:19:12 pm »
Basti one of the best guys I worked with, thank you. Since you did this on my site yesterday the SPAM registrations are down to zero. The best thing is it will check the http://www.stopforumspam.com/ and use their API so no need for me to update IPs and emails   


Thank you

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: [PLUGIN] - Stop Registration Spam
« Reply #9 on: December 12, 2012, 03:45:10 pm »
Hi guys,
There is next modification to check for spam after item is posted, if email address is in spam list, new listing will not be posted:
go to plugin/spamcheck/index.php, bellow last function in file (above osc_register_plugin(osc_plugin_path(__FILE__), 'spamcheck_install') ;) place this code:

Code: [Select]
function spamcheck_die_after_post()
{
    $spambot = checkSpambots(Params::getParam('contactEmail'), $_SERVER['REMOTE_ADDR'], Params::getParam('contactName'));
    if($spambot == true){
        header('Location: '.osc_base_url());
        exit;
    }
}

at the end of file above ?> place this code:
Code: [Select]
osc_add_hook('pre_item_post', 'spamcheck_die_after_post');

thats it, test and leave reply

Legion

  • Hero Member
  • *****
  • Posts: 622
  • I am founder of top20remedies.com buyeradvise.com
Re: [PLUGIN] - Stop Registration Spam
« Reply #10 on: December 13, 2012, 12:51:37 am »
@frosticek great!!!!!!!

BadDevil

  • Newbie
  • *
  • Posts: 20
Re: [PLUGIN] - Stop Registration Spam
« Reply #11 on: December 13, 2012, 01:25:00 am »
A small request for you guys to think about it if its possible.


In here  www.yoursite.com/oc-admin/index.php?page=plugins&action=renderplugin&file=spamcheck/spam_list.php you can see the blocked IPs and emails.. could you make a bridge to the block IP plugin so these IPs from here will be blocked automatically when they try to register. Meaning add these IPs to the banned IPs in that plugin  :)

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: [PLUGIN] - Stop Registration Spam
« Reply #12 on: December 13, 2012, 01:44:47 am »
@BadDevil
Yes, it is possible, but it is useless, I was thinking about that and in my opinion you could lose some possible sellers. If someone register and he is checked as spammer, he do not know about it so he will leave your page. I only made small upgrade that you can make your own (second) spamlist that if you know about someone he is spammer or scamer, you can add his email to second list and will be marked as spammer. If you want, I can share it.

SemperSaint

  • Newbie
  • *
  • Posts: 20
Re: [PLUGIN] - Stop Registration Spam
« Reply #13 on: April 13, 2013, 02:43:04 am »
A "Select All" and/or "Delete All" option would be great.  That registration SPAM list can get loooong, very quick. ;)  Great plugin, and a big help.

Semper

mrreference

  • Jr. Member
  • **
  • Posts: 74
Re: [PLUGIN] - Stop Registration Spam
« Reply #14 on: April 15, 2013, 02:45:45 am »
Would it be possible to include an appropriate message when the spammer is redirected to the home page or are we just leaving them high and dry as they are naughty people :)