211 | | // User account was registered less than 2 weeks ago (but longer than 3 days) (user is still fairly new). |
212 | | $two_weeks_ago = time() - ( 2 * WEEK_IN_SECONDS ); |
213 | | $three_days_ago = time() - ( 3 * DAY_IN_SECONDS ); |
214 | | if ( strtotime( $author->user_registered ) > $two_weeks_ago && strtotime( $author->user_registered ) < $three_days_ago ) { |
| 211 | // There has been an uptick in users with names ending in numbers AND being very new, submitting |
| 212 | // a lot of plugins after being banned. |
| 213 | $two_weeks_ago = time() - ( 2 * WEEK_IN_SECONDS ); |
| 214 | $four_days_ago = time() - ( 4 * DAY_IN_SECONDS ); |
| 215 | if ( is_numeric( substr( $author->user_login, - 1, 1 ) ) && strtotime( $author->user_registered ) > $four_days_ago ) { |
| 216 | // Username ends in numbers and is less than 4 days old. |
| 217 | array_push( self::$flagged['high'], 'account registered less than 4 days ago and username ends in numbers' ); |
| 218 | } elseif ( is_numeric( substr( $author->user_login, - 1, 1 ) ) ) { |
| 219 | // Username just ends in numbers. |
| 220 | array_push( self::$flagged['med'], 'username ends in numbers' ); |
| 221 | } elseif ( strtotime( $author->user_registered ) > $two_weeks_ago && strtotime( $author->user_registered ) < $four_days_ago ) { |
| 222 | // User account was registered less than 2 weeks ago (but longer than 4 days). |
| 224 | // If they have 4+ plugins in 2 weeks, it MAY be an issue. |
| 225 | if ( 4 <= count( $author_plugins ) ) { |
| 226 | array_push( self::$flagged['med'], 'high number of submitted plugins in a short timeframe' ); |
| 227 | } |
| 228 | } elseif ( strtotime( $author->user_registered ) > $four_days_ago ) { |
| 229 | // User account was registered less than 3 days ago. |
| 230 | array_push( self::$flagged['med'], 'account registered less than 4 days ago' ); |
| 231 | // If they have 2+ plugins in 4 days, it's a problem. |
| 232 | if ( 2 <= count( $author_plugins ) ) { |
| 233 | array_push( self::$flagged['high'], 'high number of submitted plugins in a short timeframe' ); |
| 234 | } |