isAtomicPlatform() ; } /** * Returns true if the site has an ecommerce-related plans on WordPress.com. * See https://github.com/Automattic/wc-calypso-bridge#active-plan-detection */ public function isCommerce(): bool { return function_exists('wc_calypso_bridge_has_ecommerce_features') && wc_calypso_bridge_has_ecommerce_features() ; } /** * Returns true if the site has a business plan on WordPress.com. * See https://github.com/Automattic/wc-calypso-bridge#active-plan-detection */ public function isBusiness(): bool { return function_exists('wc_calypso_bridge_is_business_plan') && wc_calypso_bridge_is_business_plan() ; } /** * Returns the plan name for the current site if hosted on WordPress.com. * Empty otherwise. */ public function getDotcomPlan(): string { if ($this->isCommerce()) { return 'commerce'; }; if ($this->isBusiness()) { return 'business'; }; return ''; } }