WordPress at Your Fingertips
function is not described

WC_Product_Importer::get_percent_complete() public WC 1.0

Get file pointer position as a percentage of file size.

{} It's a method of the class: WC_Product_Importer{}

No Hooks.

Return

Int.

Usage

$WC_Product_Importer = new WC_Product_Importer();
$WC_Product_Importer->get_percent_complete();

Code of WC_Product_Importer::get_percent_complete() WC 5.7.1

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

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