[wp-trac] Re: [WordPress Trac] #5130: Linking to multiple posts on your own site breaks pingback due to comment flooding

WordPress Trac wp-trac at lists.automattic.com
Tue Jan 22 00:15:39 GMT 2008


#5130: Linking to multiple posts on your own site breaks pingback due to comment
flooding
-------------------------------+--------------------------------------------
 Reporter:  Denis-de-Bernardy  |        Owner:  anonymous
     Type:  defect             |       Status:  new      
 Priority:  normal             |    Milestone:  2.6      
Component:  General            |      Version:  2.3      
 Severity:  normal             |   Resolution:           
 Keywords:                     |  
-------------------------------+--------------------------------------------
Comment (by scottsm):

 I'm the writer of the plugin. Sorry about the late comment, I never
 realized this made it up here until I was looking around today.

 Anyway, I was worried about the possibility of a comment flood through the
 xmlrpc but since I haven't yet [knock on wood] ran into a comment flood
 but have been (slightly) annoyed with missing pings I figured I'd give
 this way a try. Detecting self-pings would be good but it seems like it
 would also be good to catch legitimate multiple pings from other blogs so
 I guess that wouldn't work.

 So I guess that means fixing this would require some method similar to the
 plugin. It is worth mentioning that the plugin is only letting 5 pings
 through in 15 seconds compared to the default 1. What if the limit on
 pings was no more than 5 in say 75 seconds? That would offer the same
 protection as the current comment_flood_filter but still allow multiple
 pings.

 This could be done easily by adding:
 {{{
 if (($time_newcomment - $time_lastcomment) < 15 ){
   if(strpos($_SERVER['PHP_SELF'],"xmlrpc.php")!==false){
     $pings=$wpdb->get_var("SELECT COUNT(comment_date_gmt) FROM
 $wpdb->comments
             WHERE comment_author_IP = '".$_SERVER['REMOTE_ADDR']."' AND
             TIME_TO_SEC(TIMEDIFF(now(),comment_date_gmt)) < 75");
     if($pings>5) return true;
   } else return true;
 }
 }}}
 to function wp_throttle_comment_flood in comment.php.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/5130#comment:3>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list