This is the issue. It may not be a problem until a site is at scale. We have 171k+ posts this would process.
Please add a return;
at the end of the trigger_background_processing method in classes/class-uagb-loader.php
/**
* Render background processing for block count.
*
* @since 2.0.14
* @return mixed Returns the block count.
*/
public function trigger_background_processing() {
/* Action to get total blocks count */
if ( 'done' !== get_option( 'spectra_blocks_count_status' ) ) {
delete_option( 'get_spectra_block_count' );
update_option( 'spectra_blocks_count_status', 'processing' );
$posts_ids = get_posts(
array(
'post_type' => 'any',
'numberposts' => -1,
'post_status' => 'publish',
'fields' => 'ids',
)
);
foreach ( $posts_ids as $post_id ) {
$this->collect_spectra_blocks_count->push_to_queue(
array(
'data' => $post_id,
'list_blocks' => UAGB_Helper::$block_list,
)
);
}
$this->collect_spectra_blocks_count->save()->dispatch();
}
}