Automattic\WooCommerce\Internal\CLI\Migrator\Core

MigratorTracker::get_stored_analyticsprivateWC 1.0

Get stored analytics data with defaults.

Method of the class: MigratorTracker{}

No Hooks.

Returns

Array. Analytics data structure.

Usage

// private - for code of main (parent) class only
$result = $this->get_stored_analytics(): array;

MigratorTracker::get_stored_analytics() code WC 10.7.0

private function get_stored_analytics(): array {
	$defaults = array(
		'totals'    => array(
			'products_attempted'   => 0,
			'products_successful'  => 0,
			'products_failed'      => 0,
			'products_skipped'     => 0,
			'total_sessions'       => 0,
			'total_migration_time' => 0,
			'dry_run_sessions'     => 0,
		),
		'platforms' => array(),
	);

	$stored = get_option( self::OPTION_NAME, array() );
	return wp_parse_args( $stored, $defaults );
}