WC_Product_Importer::get_percent_complete()

Get file pointer position as a percentage of file size.


Description Description


Return Return

(int)


Top ↑

Source Source

File: includes/import/abstract-wc-product-importer.php

	public function get_percent_complete() {
		$size = filesize( $this->file );
		if ( ! $size ) {
			return 0;
		}

		return absint( min( round( ( $this->file_position / $size ) * 100 ), 100 ) );
	}


Top ↑

User Contributed Notes User Contributed Notes

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