• 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_Admin::recheck_queue_portion() –

You appear to be a bot. Output may be restricted

Description

Usage

Akismet_Admin::recheck_queue_portion( $start, $limit );

Parameters

$start
( mixed ) optional –
$limit
( mixed ) optional default: 100 –

Returns

void

Source

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

1 to 38 of 38
  public static function recheck_queue_portion( $start = 0, $limit = 100 ) {
    global $wpdb;
    
    $paginate = '';

    if ( $limit <= 0 ) {
      $limit = 100;
    }

    if ( $start < 0 ) {
      $start = 0;
    }

    $moderation = $wpdb->get_col( $wpdb->prepare( "SELECT * FROM {$wpdb->comments} WHERE comment_approved = '0' LIMIT %d OFFSET %d", $limit, $start ) );

    $result_counts = array(
      'processed' => count( $moderation ),
      'spam' => 0,
      'ham' => 0,
      'error' => 0,
    );

    foreach ( $moderation as $comment_id ) {
      $api_response = Akismet::recheck_comment( $comment_id, 'recheck_queue' );

      if ( 'true' === $api_response ) {
        ++$result_counts['spam'];
      }
      elseif ( 'false' === $api_response ) {
        ++$result_counts['ham'];
      }
      else {
        ++$result_counts['error'];
      }
    }

    return $result_counts;
  }
 

 View on GitHub View on Trac

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

Primary Sidebar

Information

Function name: Akismet_Admin::recheck_queue_portion
Class ref: Akismet_Admin
Plugin ref: Akismet
Version: 5.0.1
Sourcefile: class.akismet-admin.php
File ref: class.akismet-admin.php
Deprecated?: No
API Letters: A,P,Q,R

Footer

WordPress a2z
WordPress a2z
WordPress Dynamic API Reference
WordPress 6.1.1. PHP: 8.0.28
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