• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress a2z

WordPress a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Themes
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Akismet_CLI::recheck_queue() – Recheck all comments in the Pending queue.

You appear to be a bot. Output may be restricted

Description

Recheck all comments in the Pending queue.

EXAMPLES

  • wp akismet recheck_queue

Usage

Akismet_CLI::recheck_queue();

Parameters

Returns

void

Source

File name: akismet/class.akismet-cli.php
Lines:

1 to 30 of 30
  public function recheck_queue() {
    $batch_size = 100;
    $start = 0;
    
    $total_counts = array();
    
    do {
      $result_counts = Akismet_Admin::recheck_queue_portion( $start, $batch_size );
      
      if ( $result_counts['processed'] > 0 ) {
        foreach ( $result_counts as $key => $count ) {
          if ( ! isset( $total_counts[ $key ] ) ) {
            $total_counts[ $key ] = $count;
          }
          else {
            $total_counts[ $key ] += $count;
          }
        }
        $start += $batch_size;
        $start -= $result_counts['spam']; // These comments will have been removed from the queue.
      }
    } while ( $result_counts['processed'] > 0 );
    
    WP_CLI::line( sprintf( _n( "Processed %d comment.", "Processed %d comments.", $total_counts['processed'], 'akismet' ), number_format( $total_counts['processed'] ) ) );
    WP_CLI::line( sprintf( _n( "%d comment moved to Spam.", "%d comments moved to Spam.", $total_counts['spam'], 'akismet' ), number_format( $total_counts['spam'] ) ) );
    
    if ( $total_counts['error'] ) {
      WP_CLI::line( sprintf( _n( "%d comment could not be checked.", "%d comments could not be checked.", $total_counts['error'], 'akismet' ), number_format( $total_counts['error'] ) ) );
    }
  }
 

 View on GitHub View on Trac

Published: 19th December 2019 | Last updated: 19th December 2019

Primary Sidebar

Information

Function name: Akismet_CLI::recheck_queue
Class ref: Akismet_CLI
Plugin ref: Akismet
Version: 5.0.1
Sourcefile: class.akismet-cli.php
File ref: class.akismet-cli.php
Deprecated?: No
API Letters: A,C,Q,R

Footer

WordPress a2z
WordPress a2z
WordPress Dynamic API Reference
WordPress 6.1.1. PHP: 8.0.27
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  wp-a2z.org
© Copyright WordPress a2z 2014-2023. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites