There's really no standard design for user warning systems, I believe. The "three strikes and you're out" is a typical approach, but not always the best. For example, if I have N
rules on my website, and we'll say that K
of those rules are serious offenses, then the offenses that aren't so serious I would say give three strikes. But maybe the serious offenses are autoban or give two strikes?
If I had to set up something like this, I would create a table that looked like this:
user_warnings:
- warning_id
- user_id
- created_at
- offense_level
And then maybe have a query set up where you could find any users that had a sum offense level over the last T
days that were greater than or equal to the value of the bannable offense level. And if their total offense level was over the recommended value, ban the user. I'd say set the offense level to be something like 5, and have tiered levels of offenses.
Never delete past offenses, though, in my opinion. You never know when it's important to remember the stuff that happened previously, and it's good to keep records of it. Just make sure this query only checks the dates that are less than 30 days old (or however many days old that the warnings you're wanting to set can be).