Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2012-10-10 17:13:35
- WebKat
- Member
- Registered: 2007-01-16
- Posts: 301
What does the database table "txp_discuss_nonce" do?
I was looking at my database and noticed that the “txp_log” table had gotten huge, so I truncated it. I noticed a few other tables were rather large (though not THAT large)…. they are:
jmd_rate
txp_discuss_nonce
txp_lang
Now, I never got the jmd_rate plugin to work so I just dropped that table. The txp_lang seems to have essential info in it about what text appears and when and where, so I don’t think I should mess with that…
…but the txp_discuss_nonce is just full of weird random strings of characters and numbers. Is it safe to truncate this table? What does it do?
—
WebKat
Offline
Re: What does the database table "txp_discuss_nonce" do?
The nonce table is used to reduce spam comments if you allow comments on your website.
Zem Contact Reborn (contact form plugin, ZCR) uses it for that purpose as well.
Normally, you shouldn’t have to truncate it, because both TXP itself (comments) and ZCR clean up that table automatically. If you do truncate it, then people who are currently filling out a contact form or who are writing a comment, could get an error message and may have to start from scratch. That’s only a temporary effect though. If someone visits your website after you’ve truncated the table, it’ll work just fine… and fill up the table again, so don’t bother truncating it :)
If you want to avoid the txp_log table from getting huge, just disable logging.
Offline
Re: What does the database table "txp_discuss_nonce" do?
ruud wrote:
If you want to avoid the txp_log table from getting huge, just disable logging.
Yep, or set the Logs expire after preference to some reasonable value and go to Admin>Visitor Logs from time to time.
Every time you look at that page, the first thing it does is throw away any entries older than N days (with N being governed by the aforementioned pref). But if you never look at your visitor logs admin panel then the logs will keep filling up, until you do take a look.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#4 2012-10-10 21:00:19
- WebKat
- Member
- Registered: 2007-01-16
- Posts: 301
Re: What does the database table "txp_discuss_nonce" do?
Good info everyone, thanks!
—
WebKat
Offline
Re: What does the database table "txp_discuss_nonce" do?
Bloke wrote:
Every time you look at that page, the first thing it does is throw away any entries older than N days (with N being governed by the aforementioned pref). But if you never look at your visitor logs admin panel then the logs will keep filling up, until you do take a look.
That seems a bit weird to me, can’t it be coded to just do that at every time you log in instead?
Offline
Re: What does the database table "txp_discuss_nonce" do?
philwareham wrote:
That seems a bit weird to me, can’t it be coded to just do that at every time you log in instead?
Maybe, at the expense of slowing down the login process on high traffic sites. It would also have to check if the logged in user had privs to see the visitor logs and only purge the logs if that was the case. Oh, and we don’t have an explicit “just logged in” state so we’d have to fudge it: a bit messy, which is probably why it’s encapsulated in the Visitor Logs panel (so the privs mechanism takes care of the drudgery). At least that way, if you don’t use them your logs grow until you either switch them off or start to look at them on a regular basis.
Last edited by Bloke (2012-10-10 21:43:45)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: What does the database table "txp_discuss_nonce" do?
philwareham wrote:
That seems a bit weird to me, can’t it be coded to just do that at every time you log in instead?
Deleting massive number of rows is never a good thing, and doing it more frequently than now is even worst. It does cause fragmentation, and needless strain.
If anything, janitor tasks could be made publicly invokable (e.g. callback URL) which would allow anyone to setup a scheduled pinging service that invokes the log cleaning process from time to time.
Offline
Re: What does the database table "txp_discuss_nonce" do?
Ah OK. I always turn logging off on all Textpattern installations, so I can sit in my ivory tower and not let this worry me. Cheers.
Offline
#9 2012-10-11 04:05:00
- WebKat
- Member
- Registered: 2007-01-16
- Posts: 301
Re: What does the database table "txp_discuss_nonce" do?
LOL ivory tower. ;D
—
WebKat
Offline