summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/jetpack_vendor/automattic/jetpack-status/src/class-host.php')
-rw-r--r--plugins/jetpack/jetpack_vendor/automattic/jetpack-status/src/class-host.php32
1 files changed, 27 insertions, 5 deletions
diff --git a/plugins/jetpack/jetpack_vendor/automattic/jetpack-status/src/class-host.php b/plugins/jetpack/jetpack_vendor/automattic/jetpack-status/src/class-host.php
index a0765f6d..dfe1e6ec 100644
--- a/plugins/jetpack/jetpack_vendor/automattic/jetpack-status/src/class-host.php
+++ b/plugins/jetpack/jetpack_vendor/automattic/jetpack-status/src/class-host.php
@@ -17,19 +17,24 @@ class Host {
* Determine if this site is an WordPress.com on Atomic site or not looking first at the 'at_options' option.
* As a fallback, check for presence of wpcomsh plugin to determine if a current site has undergone AT.
*
- * @since $$next_version$$
+ * @since 1.9.0
*
* @return bool
*/
public function is_woa_site() {
- $at_options = get_option( 'at_options', array() );
- return $this->is_atomic_platform() && ( ! empty( $at_options ) || Constants::is_true( 'WPCOMSH__PLUGIN_FILE' ) );
+ $ret = Cache::get( 'is_woa_site' );
+ if ( null === $ret ) {
+ $at_options = get_option( 'at_options', array() );
+ $ret = $this->is_atomic_platform() && ( ! empty( $at_options ) || Constants::is_true( 'WPCOMSH__PLUGIN_FILE' ) );
+ Cache::set( 'is_woa_site', $ret );
+ }
+ return $ret;
}
/**
- * Determine if site is hosted on the Atomic hosting platform.
+ * Determine if the site is hosted on the Atomic hosting platform.
*
- * @since $$next_version$$
+ * @since 1.9.0
*
* @return bool;
*/
@@ -37,4 +42,21 @@ class Host {
return Constants::is_true( 'ATOMIC_SITE_ID' ) && Constants::is_true( 'ATOMIC_CLIENT_ID' );
}
+ /**
+ * Determine if this is a Newspack site.
+ *
+ * @return bool
+ */
+ public function is_newspack_site() {
+ return Constants::is_defined( 'NEWSPACK_PLUGIN_FILE' );
+ }
+
+ /**
+ * Determine if this is a VIP-hosted site.
+ *
+ * @return bool
+ */
+ public function is_vip_site() {
+ return Constants::is_defined( 'WPCOM_IS_VIP_ENV' ) && true === Constants::get_constant( 'WPCOM_IS_VIP_ENV' );
+ }
}