Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 Today 08:33:16

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,244
Website GitHub Mastodon Twitter

Referrer spam

I know that it is not GDPR compatible, but is there a way to have the IP addresses in the visitor logs in order to block referrer spam? In the past week, we had about 100,000 hits/day, most by a particular IP. I of course did not know that, except from the fact that our logs were over 1000 pages with 96 logs/page every time I checked for a week I ignored them but eventually decided to look at the server logs via sftp to identify the culprit.

I wonder if we could store IPs in the txp logs for 24 hours or so, for the protection of our sites.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#2 Today 17:37:47

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,998
Website GitHub

Re: Referrer spam

Perhaps a long shot, but I don’t see why you couldn’t switch on logging and then run a script once a day to clear the entries in txp_log that are older than that day. That could take the form of

  • a separate php file that you trigger at a certain time each day using a cronjob on your server.
  • a txp plugin that is triggered by a visit to the site and runs once a day doing the same.

Textpattern doesn’t have a “runner” that would do it at a certain point each day, so a txp plugin would have to be triggered by a visit. Said plugin would note if it had run already that day to stop it being triggered by every visit. The “risk” here is that if you have a day with no visitors (not likely with your site), then the logs may end up being stored for longer.

There is aks_cron (no idea if it still works) but as Jukka noted, it uses the same principle, not true cron.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB