256
256
public static function delete_old_comments() {
259
while( $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_id FROM {$wpdb->comments} WHERE DATE_SUB(NOW(), INTERVAL 15 DAY) > comment_date_gmt AND comment_approved = 'spam' LIMIT %d", defined( 'AKISMET_DELETE_LIMIT' ) ? AKISMET_DELETE_LIMIT : 10000 ) ) ) {
260
* Determines how many comments will be deleted in each batch.
262
* @param int The default, as defined by AKISMET_DELETE_LIMIT.
264
$delete_limit = apply_filters( 'akismet_delete_comment_limit', defined( 'AKISMET_DELETE_LIMIT' ) ? AKISMET_DELETE_LIMIT : 10000 );
265
$delete_limit = max( 1, intval( $delete_limit ) );
268
* Determines how many days a comment will be left in the Spam queue before being deleted.
270
* @param int The default number of days.
272
$delete_interval = apply_filters( 'akismet_delete_comment_interval', 15 );
273
$delete_interval = max( 1, intval( $delete_interval ) );
275
while ( $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_id FROM {$wpdb->comments} WHERE DATE_SUB(NOW(), INTERVAL %d DAY) > comment_date_gmt AND comment_approved = 'spam' LIMIT %d", $delete_interval, $delete_limit ) ) ) {
260
276
if ( empty( $comment_ids ) )
263
279
$wpdb->queries = array();
265
do_action( 'delete_comment', $comment_ids );
281
foreach ( $comment_ids as $comment_id ) {
282
do_action( 'delete_comment', $comment_id );
267
285
$comma_comment_ids = implode( ', ', array_map('intval', $comment_ids) );
926
944
return _http_build_query( $args, '', '&' );
948
* Log debugging info to the error log.
950
* Enabled when WP_DEBUG_LOG is enabled, but can be disabled via the akismet_debug_log filter.
952
* @param mixed $akismet_debug The data to log.
929
954
public static function log( $akismet_debug ) {
930
if ( defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG )
931
error_log( print_r( compact( 'akismet_debug' ), 1 ) ); //send message to debug.log when in debug mode
955
if ( apply_filters( 'akismet_debug_log', defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) ) {
956
error_log( print_r( compact( 'akismet_debug' ), true ) );
b'\\ No newline at end of file'