mirror of
https://gh.wpcy.net/https://github.com/webguyio/stop-spammers-classic.git
synced 2026-05-24 23:55:55 +08:00
30 lines
No EOL
709 B
PHP
30 lines
No EOL
709 B
PHP
<?php
|
|
|
|
if ( !defined( 'ABSPATH' ) ) {
|
|
status_header( 404 );
|
|
exit;
|
|
}
|
|
|
|
class ss_remove_gcache {
|
|
public function process( $ip, &$stats = array(), &$options = array(), &$post = array() ) {
|
|
extract( $stats );
|
|
extract( $options );
|
|
while ( count( $goodips ) > $ss_sp_good ) {
|
|
array_shift( $goodips );
|
|
}
|
|
$nowtimeout = gmdate( 'Y/m/d H:i:s', time() - ( 4 * 3600 ) + ( get_option( 'gmt_offset' ) * 3600 ) );
|
|
foreach ( $goodips as $key => $data ) {
|
|
if ( $data < $nowtimeout ) {
|
|
unset( $goodips[$key] );
|
|
}
|
|
if ( $key == $ip ) {
|
|
unset( $goodips[$key] );
|
|
}
|
|
}
|
|
$stats['goodips'] = $goodips;
|
|
ss_set_stats( $stats );
|
|
return $goodips; // return the array so AJAX can show it
|
|
}
|
|
}
|
|
|
|
?>
|