<?php

class PWP_EDD {
	public static $valid = false;

	public function __construct()
	{
		$status = get_option( 'edd_pwp_license_status' );

		if ( 'valid' === $status || self::is_wpcom() || self::is_woo() ) {
			self::$valid = true;
		}
	}

	public static function is_valid()
	{
		return self::$valid;
	}

	public static function is_wpcom()
	{
		// WordPress.com environment check
		return defined('IS_ATOMIC') && IS_ATOMIC && defined('ATOMIC_CLIENT_ID') && '2' === ATOMIC_CLIENT_ID;
	}

	// Add a new function to detect the “WooCommerce.com version”
	public static function is_woo()
	{
		return defined('PWP_IS_WOO') && true === PWP_IS_WOO;
	}
}