diff options
Diffstat (limited to 'plugins/jetpack/class.jetpack-plan.php')
-rw-r--r-- | plugins/jetpack/class.jetpack-plan.php | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/plugins/jetpack/class.jetpack-plan.php b/plugins/jetpack/class.jetpack-plan.php index 333653b3..85ebffa0 100644 --- a/plugins/jetpack/class.jetpack-plan.php +++ b/plugins/jetpack/class.jetpack-plan.php @@ -63,6 +63,7 @@ class Jetpack_Plan { ), 'supports' => array( 'akismet', + 'payments', 'recurring-payments', 'premium-content/container', 'videopress', @@ -90,6 +91,10 @@ class Jetpack_Plan { 'jetpack_security_daily_monthly', 'jetpack_security_realtime', 'jetpack_security_realtime_monthly', + 'jetpack_security_t1_yearly', + 'jetpack_security_t1_monthly', + 'jetpack_security_t2_yearly', + 'jetpack_security_t2_monthly', ), 'supports' => array(), ), @@ -103,6 +108,7 @@ class Jetpack_Plan { 'ecommerce-bundle', 'ecommerce-bundle-monthly', 'ecommerce-bundle-2y', + 'pro-plan', ), 'supports' => array(), ), @@ -318,6 +324,16 @@ class Jetpack_Plan { * @return bool True if plan supports feature, false if not */ public static function supports( $feature ) { + // Hijack the feature eligibility check on WordPress.com sites since they are gated differently. + $should_wpcom_gate_feature = ( + function_exists( 'wpcom_site_has_feature' ) && + function_exists( 'wpcom_feature_exists' ) && + wpcom_feature_exists( $feature ) + ); + if ( $should_wpcom_gate_feature ) { + return wpcom_site_has_feature( $feature ); + } + // Search product bypasses plan feature check. if ( 'search' === $feature && (bool) get_option( 'has_jetpack_search_product' ) ) { return true; @@ -330,18 +346,6 @@ class Jetpack_Plan { $plan = self::get(); - // Manually mapping WordPress.com features to Jetpack module slugs. - foreach ( $plan['features']['active'] as $wpcom_feature ) { - switch ( $wpcom_feature ) { - case 'wordads-jetpack': - // WordAds are supported for this site. - if ( 'wordads' === $feature ) { - return true; - } - break; - } - } - if ( in_array( $feature, $plan['supports'], true ) || in_array( $feature, $plan['features']['active'], true ) |