2017 © Pedro Peláez
 

library semalt-blocker

Block referral spammers from visiting your site and ruining your stats

image

nabble/semalt-blocker

Block referral spammers from visiting your site and ruining your stats

  • Thursday, December 1, 2016
  • by hongaar
  • Repository
  • 13 Watchers
  • 65 Stars
  • 4,090 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 6 Forks
  • 5 Open issues
  • 49 Versions
  • 7 % Grown

The README.md

Don't use this project

The list of spammy domains is stale and without any update since 2016

> Read original blogpost which inspired this project: Semalt infecting computers to spam the web.

Latest Stable Version Build Status Coverage Status Scrutinizer Code Quality StyleCI Status Dependency Status Packagist Downloads License, (*1)

semalt-blocker

Self-updating PHP library which blocks hundreds of spammy domains from ruining your website statistics

Bad domains Last updated
2433 December 1st, 2016

Block referral spam with a single line of code. Originally started to stop the nasty Semalt botnet from visiting your site and ruining your stats (of course their domains are still included), the blocklist now contains hundreds of spammy domains. The library will try to self-update every week, so you don't have to worry about composer update's., (*2)

blocklist

Looking for the blocklist only? No problem:, (*3)

sources

The blocklist is compiled from several sources. Currently:, (*4)

Source Raw source file Number of domains
sahava https://raw.githubusercontent.com/sahava/spam-filter-tool/master/js/spamfilter.js 417
piwik https://raw.githubusercontent.com/piwik/referrer-spam-blacklist/master/spammers.txt 483
stevie-ray https://raw.githubusercontent.com/Stevie-Ray/apache-nginx-referral-spam-blacklist/master/generator/domains.txt 1071
ar-communications https://raw.githubusercontent.com/ARCommunications/Block-Referral-Spam/master/blocker.php 376
flameeyes https://raw.githubusercontent.com/Flameeyes/modsec-flameeyes/master/rules/flameeyes_bad_referrers.data 936
semalt-blocker ../domains/additional 1
desbma https://raw.githubusercontent.com/desbma/referer-spam-domains-blacklist/master/spammers.txt 1700

debug console

We've added a tool to check whether your site blocks spammy bots. You can find it in the repository and online at: nabble.nl/semalt, (*5)

composer setup

This is the easiest method, but requires the use of Composer. Add semalt-blocker to your project by running the following in your terminal:, (*6)

composer require nabble/semalt-blocker:~1

Then in your project add (but you probably already have this):, (*7)

require "vendor/autoload.php";

legacy setup

Not using composer? No problem, copy the files domains/blocked and compact/semaltblocker.php to the same directory in your project and add this line:, (*8)

require "/path/to/semaltblocker.php";

basic usage

It's as easy as:, (*9)

use Nabble\SemaltBlocker\Blocker;

Blocker::protect();

// ... your app

Make sure you add it somewhere at the beginning of your code, it will save you!, (*10)

self-update

In order for the self-update mechanism to work, make sure the domains/blocked file is writable by the webserver:, (*11)

$ chmod a+w vendor/nabble/semalt-blocker/domains/blocked

options

Blocker::protect(); // default, serve a 403 Forbidden response
Blocker::protect('http://semalt.com'); // return them their own botnet traffic
Blocker::protect('Hi, bot'); // displays a nice message when blocked

All calls to the protect function will trigger the auto-updater at a regular interval., (*12)

If you want to stay in control even more, use this:, (*13)

$blocked = Blocker::blocked(); // returns true when a blocked referrer is detected

If you want an explanation for why a referer is blocked, use:, (*14)

echo Blocker::explain();

The self-updater runs every 7 days by default. To force updating the domain list, use this:, (*15)

use Nabble\SemaltBlocker\Updater;

Updater::update(true);

contribute

Yes, please! Feel free to open issues or pull-requests., (*16)

licence

MIT, (*17)

The Versions

01/12 2016

dev-master

9999999-dev

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

16/08 2016

v1.3.21

1.3.21.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

08/07 2016

v1.3.20

1.3.20.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

24/06 2016

v1.3.19

1.3.19.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

17/05 2016

v1.3.18

1.3.18.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

07/05 2016

v1.3.17

1.3.17.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

06/05 2016

v1.3.16

1.3.16.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

06/05 2016

dev-analysis-8wjAJe

dev-analysis-8wjAJe

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

06/05 2016

dev-analysis-z3wKDL

dev-analysis-z3wKDL

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

26/04 2016

v1.3.15

1.3.15.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

24/04 2016

v1.3.14

1.3.14.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

20/04 2016

v1.3.13

1.3.13.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

11/04 2016

v1.3.12

1.3.12.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

08/04 2016

v1.3.11

1.3.11.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

27/01 2016

v1.3.10

1.3.10.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

24/01 2016

v1.3.9

1.3.9.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

12/01 2016

v1.3.8

1.3.8.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

30/12 2015

v1.3.7

1.3.7.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

16/12 2015

v1.3.6

1.3.6.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

08/12 2015

v1.3.5

1.3.5.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

01/12 2015

v1.3.4

1.3.4.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

30/11 2015

v1.3.3

1.3.3.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

30/11 2015

v1.3.2

1.3.2.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

27/11 2015

v1.3.1

1.3.1.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

16/11 2015

v1.3.0

1.3.0.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

09/11 2015

v1.2.11

1.2.11.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

24/10 2015

v1.2.10

1.2.10.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

12/10 2015

v1.2.9

1.2.9.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

05/10 2015

v1.2.8

1.2.8.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

17/09 2015

v1.2.7

1.2.7.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

14/09 2015

v1.2.6

1.2.6.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

09/09 2015

v1.2.5

1.2.5.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

03/09 2015

v1.2.4

1.2.4.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

31/08 2015

v1.2.3

1.2.3.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

13/08 2015

v1.2.2

1.2.2.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

27/07 2015

v1.2.1

1.2.1.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

19/07 2015

v1.2.0

1.2.0.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

17/07 2015

v1.1.3

1.1.3.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

17/07 2015

1.1.2

1.1.2.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joram van den Boezem

10/07 2015

1.1.1

1.1.1.0

Block referral spammers from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

  • php >=5.0.0

 

The Development Requires

by Joram van den Boezem

10/07 2015

1.1.0

1.1.0.0

Block the Semalt botnet from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

  • php >=5.0.0

 

The Development Requires

by Joram van den Boezem

16/06 2015

1.0.7

1.0.7.0

Block the Semalt botnet from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

  • php >=5.0.0

 

The Development Requires

by Joram van den Boezem

16/06 2015

1.0.6

1.0.6.0

Block the Semalt botnet from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

  • php >=5.0.0

 

The Development Requires

by Joram van den Boezem

25/05 2015

1.0.5

1.0.5.0

Block the Semalt botnet from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

  • php >=5.0.0

 

The Development Requires

by Joram van den Boezem

28/04 2015

1.0.4

1.0.4.0

Block the Semalt botnet from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

  • php >=5.0.0

 

The Development Requires

by Joram van den Boezem

23/02 2015

1.0.3

1.0.3.0

Block the Semalt botnet from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

  • php >=5.0.0

 

The Development Requires

by Joram van den Boezem

26/11 2014

1.0.2

1.0.2.0

Block the Semalt botnet from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

  • php >=5.0.0

 

The Development Requires

by Joram van den Boezem

07/08 2014

1.0.1

1.0.1.0

Block the Semalt botnet from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

  • php >=5.0.0

 

The Development Requires

by Joram van den Boezem

07/08 2014

1.0.0

1.0.0.0

Block the Semalt botnet from visiting your site and ruining your stats

  Sources   Download

MIT

The Requires

  • php >=5.0.0

 

The Development Requires

by Joram van den Boezem