__('Antisplog')), $columns); return $columns; } function antisplog_add_column_field( $column, $blog_id ) { if ( $column == 'antisplog' ) { $spammytot = 0; $domainsource = get_blog_option( $blog_id, 'siteurl'); // a basic default filter ( for email based tests) $filtre_default = array('sex','.info','best', 'free','.ru','online','stamp','host'); //preg_match('/(?P\w+)(?P\d+)/', $domainsource, $matches); //if somebody have better , different and more powerfull patterns, mail me homeof@gmail.com preg_match('/(?P\d+)/', $domainsource, $matches); //echo 'digits found: '.$matches['digit']; $digits = $matches['digit']; $res = strlen($digits); if($res>5){ // five digits in a blogname, look very spammy $spammytot = $spammytot + 10 ; } $blogusers = get_users_of_blog($blog_id); /*to find blogs with no user */ $ghost = count( $blogusers ); if ($ghost == 0) { $spammytot = $spammytot + 100; /*warning... comment if you have a doubt */ //wpmu_delete_blog($blog_id, TRUE); } if ( is_array( $blogusers ) ) { $blogusers_warning = ''; if ( count( $blogusers ) > 5 ) { $blogusers = array_slice( $blogusers, 0, 5 ); $blogusers_warning = __( 'Only showing first 5 users.' ) . ' ' . __( 'More' ) . ''; } foreach ( $blogusers as $key => $val ) { $mailtest = $val->user_email; $walkcounter = count($filtre_default); for ($i = 0; $i <= $walkcounter; $i++) { $hasfound .= strstr($mailtest,$filtre_default[$i]); // there is a small bug, twice count, i think,, but works with coef.. if($hasfound){ $spammytot++; } } } if( $blogusers_warning != '' ) {echo '' . $blogusers_warning . '
';} } echo ''; if($spammytot>0){ echo 'Critical test '.$spammytot.''; } } /*if is column*/ } /*end function*/