Hi all, I run a blog with many comments and during "live events coverage" people comments every 20 seconds or something like that, it's amazing but... after two warnings from hosting provider because of cpu usage... i'm considering changing the comment flood protection of the blog.
i've just found on comments.php in /wp-includes this:
function check_comment_flood_db( $ip, $email, $date ) {
global $wpdb;
if ( current_user_can( 'manage_options' ) )
return; // don't throttle admins
$hour_ago = gmdate( 'Y-m-d H:i:s', time() - 3600 );
if ( $lasttime = $wpdb->get_var( $wpdb->prepare( "SELECTcomment_date_gmtFROM$wpdb->commentsWHEREcomment_date_gmt>= %s AND (comment_author_IP= %s ORcomment_author_email= %s ) ORDER BYcomment_date_gmtDESC LIMIT 1", $hour_ago, $ip, $email ) ) ) {
$time_lastcomment = mysql2date('U', $lasttime, false);
$time_newcomment = mysql2date('U', $date, false);
$flood_die = apply_filters('comment_flood_filter', false, $time_lastcomment, $time_newcomment);
if ( $flood_die ) {
do_action('comment_flood_trigger', $time_lastcomment, $time_newcomment);if ( defined('DOING_AJAX') )
die( __('You are posting comments too quickly. Slow down.') );wp_die( __('You are posting comments too quickly. Slow down.'), '', array('response' => 403) );
}
}
}
What do i have to change to set the limitation to "1 comment per three minutes"? (for example)
thanks in advance