LLMS_Background_Updater::get_progress()

Retrieve approximate progress of updates in the queue


Return Return

(int)


Top ↑

Source Source

File: includes/class.llms.background.updater.php

	public function get_progress() {

		// If the queue is empty we've already finished.
		if ( $this->is_queue_empty() ) {
			return 0;
		}

		// Get the progress.
		$batch     = $this->get_batch();
		$total     = max( array_keys( $batch->data ) ) + 1;
		$remaining = count( $batch->data );
		if ( ! $total ) {
			return 0;
		}
		return ceil( ( ( $total - $remaining ) / $total ) * 100 );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.4.3
3.16.10 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.