One of the new features in WordPress 2.6 (including MU) is post revisions. This is nice but I'm somewhat concerned with the implications. A post revision is saved to the wp_posts table every time the user saves a draft.
Does anyone have an estimate for the average number of draft saves? I make just a few saves for each post I write. What effect will this have on the database size and performance when there are 50K users?
Can one turn off this feature by adding the following to the config file:
define('WP_POST_REVISIONS', false);
I’m also not sure if a revision is saved via the autosave process?
maybe this plugin works? I haven't tried it with wpmu, just found it yesterday...
http://wordpress.org/extend/plugins/mg-advancedoptions/
Thanks Ovidiu.
I'm still not that I want to turn if off. Maybe limit the number of revisions like:
define('WP_POST_REVISIONS', 3); // max. 3 revisions
or maybe just delete the revisions once the the post is published (or a few days later).
musnake
Member
Posted 16 years ago #
In wp-includes/post.php @ line 3182:
// WP_POST_REVISIONS = (int) (# of autasaves to save)
$delete = count($revisions) - WP_POST_REVISIONS;
Smells like chicken.
TimePeak
Member
Posted 16 years ago #
musnake, should these strings be added to post.php?
Cause actually my post.php file is 2982 lines long, and it doesn't contain anything like WP_POST_REVISIONS
lunabyte
Member
Posted 16 years ago #
No, they shouldn't be added.
They exist in 2.6, which is what this is all discussing.
TimePeak
Member
Posted 16 years ago #
oh, I see. I'm still on 1.5.1 :)
btw. the plugin I linked to above, can either disable or limit the post revisions to a certain number of revisions.
mrarrow
Member
Posted 16 years ago #
I've installed this plugin on WPMU 2.6 and all it seems to do is hide the 'Post revisions' tab at the bottom of each write post page. This is nowhere near as useful, as revised posts are still being created in MySQL, hence the tables will continue to get bigger and bigger.
When you look in MySQL revised posts are flagged as post_status='inherit' (rather than post_status='publish').
It would be much neater to be able to kill any revisions from being created in the first place.
musnake
Member
Posted 16 years ago #
How about this:
http://wordpress.org/extend/plugins/revision-control/
Author: Dion Hulse
Revision Control is a plugin for WordPress 2.6+ which gives the user more control over the Post/Page Revisions.
The plugin allows the user to set a blog-global setting (Settings -> Revisions) for pages/posts to enable/disable/limit the number of revisions which are saved for the page/post. The user may change this setting on a per-page/post basis from the Revisions Meta box.
The plugin also allows the deletion of specific revisions via the Revisions post metabox.
mrarrow
Member
Posted 16 years ago #
Excellent - well spotted! Having installed it in the plugins folder, initial results seem to completely kill any revisions being created. Perfect, even though the authors site says it wasn't written for WPMU!
I mashed together a specifically wpmu/site-wide version. Enable/disable post revisions in SiteAdmin-->Options
http://wpmudevorg.wordpress.com/project/Limit-Post-Revisions
mrarrow
Member
Posted 16 years ago #
Oh my, that looks good as well although I haven't installed it as the other one is working at the moment.
Dsader:, when you say site-wide do you mean across the whole MU installation or just top down from specific top level domains?
Coz quite frankly, I'm not keen on allowing anyone to have access to previous revisions, especially when it writes each revision to the database. So it'd be cool to switch it off globally, or at least one switch for the whole of a domain.
"site-wide"
One SiteAdmin-->Option to set and poof no more revisions, ... anywhere.
musnake
Member
Posted 16 years ago #
Thanks man.
I guess line 43 echo 'huh?'.$number;
is an artifact...
So this stops new ones from being created but does it ever get rid of the old ones or do we need to manual clear up what has already been created?
add this code somewhere inside wp-config.php to remove post revisions (source: http://lesterchan.net/wordpress/2008/07/17/how-to-turn-off-post-revision-in-wordpress-26/)
---------------------------------------
define('WP_POST_REVISIONS', false);
VentureMaker
Member
Posted 16 years ago #
Do only posts have revisions in WPMU? What about pages, links, etc?
VentureMaker
Member
Posted 16 years ago #
Posts & pages have revisions, nothing else does.
pages are just special posts.
(that's why it's called "post revisions" ;p )