Automattic\WooCommerce\Internal\Logging

RemoteLogger::is_remote_logging_allowed()publicWC 1.0

Determines if remote logging is allowed based on the following conditions:

  1. The feature flag for remote error logging is enabled.
  2. The user has opted into tracking/logging.
  3. The store is allowed to log based on the variant assignment percentage.
  4. The current WooCommerce version is the latest so we don't log errors that might have been fixed in a newer version.

Метод класса: RemoteLogger{}

Хуков нет.

Возвращает

true|false.

Использование

$RemoteLogger = new RemoteLogger();
$RemoteLogger->is_remote_logging_allowed();

Код RemoteLogger::is_remote_logging_allowed() WC 9.3.3

public function is_remote_logging_allowed() {
	if ( ! FeaturesUtil::feature_is_enabled( 'remote_logging' ) ) {
		return false;
	}

	if ( ! \WC_Site_Tracking::is_tracking_enabled() ) {
		return false;
	}

	if ( ! $this->is_variant_assignment_allowed() ) {
		return false;
	}

	if ( ! $this->is_latest_woocommerce_version() ) {
		return false;
	}

	return true;
}