Automattic\WooCommerce\Internal\Admin

Analytics::is_refund_double_count_tool_applicable │ public static │ WC 1.0

Whether a store may have refunds double-counted by the bug fixed in #66320.

Only stores that use the new full refund data and ran WooCommerce before 11.1.0, where the write path was fixed, can have affected rows.

Method of the class: Analytics{}

No Hooks.

Returns

bool.

Usage

$result = Analytics::is_refund_double_count_tool_applicable(): bool;

Analytics::is_refund_double_count_tool_applicable() code WC 11.3.0

public static function is_refund_double_count_tool_applicable(): bool {
	if ( ! OrderUtil::uses_new_full_refund_data() || OrderUtil::unknown_orders_data_store_in_use() ) {
		return false;
	}

	if ( self::get_refund_double_count_state()['dismissed'] ) {
		return false;
	}

	// Installs older than 9.2.0 never recorded their initial version.
	$initial_version = get_option( \WC_Install::INITIAL_INSTALLED_VERSION );

	return ! is_string( $initial_version ) || '' === $initial_version || version_compare( $initial_version, '11.1.0', '<' );
}