diff options
Diffstat (limited to 'plugins/jetpack/class.jetpack-plan.php')
-rw-r--r-- | plugins/jetpack/class.jetpack-plan.php | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/plugins/jetpack/class.jetpack-plan.php b/plugins/jetpack/class.jetpack-plan.php index 8eeea853..69acfe8d 100644 --- a/plugins/jetpack/class.jetpack-plan.php +++ b/plugins/jetpack/class.jetpack-plan.php @@ -2,9 +2,14 @@ /** * Handles fetching of the site's plan from WordPress.com and caching the value locally. * + * Not to be confused with the `Jetpack_Plans` class (in `_inc/lib/plans.php`), which + * fetches general information about all available plans from WordPress.com, side-effect free. + * * @package Jetpack */ +use Automattic\Jetpack\Connection\Client; + /** * Provides methods methods for fetching the plan from WordPress.com. */ @@ -44,13 +49,6 @@ class Jetpack_Plan { return false; } - $current_plan = get_option( self::PLAN_OPTION, array() ); - - // If the plans don't differ, then there's nothing to do. - if ( ! empty( $current_plan ) && $current_plan['product_slug'] === $results['plan']['product_slug'] ) { - return false; - } - // Store the new plan in an option and return true if updated. $result = update_option( self::PLAN_OPTION, $results['plan'], true ); if ( ! $result ) { @@ -72,7 +70,7 @@ class Jetpack_Plan { * Make an API call to WordPress.com for plan status * * @uses Jetpack_Options::get_option() - * @uses Jetpack_Client::wpcom_json_api_request_as_blog() + * @uses Client::wpcom_json_api_request_as_blog() * @uses update_option() * * @access public @@ -83,7 +81,7 @@ class Jetpack_Plan { public static function refresh_from_wpcom() { // Make the API request. $request = sprintf( '/sites/%d', Jetpack_Options::get_option( 'id' ) ); - $response = Jetpack_Client::wpcom_json_api_request_as_blog( $request, '1.1' ); + $response = Client::wpcom_json_api_request_as_blog( $request, '1.1' ); return self::update_from_sites_response( $response ); } @@ -132,6 +130,7 @@ class Jetpack_Plan { if ( in_array( $plan['product_slug'], $personal_plans, true ) ) { // special support value, not a module but a separate plugin. $supports[] = 'akismet'; + $supports[] = 'recurring-payments'; $plan['class'] = 'personal'; } @@ -146,6 +145,7 @@ class Jetpack_Plan { if ( in_array( $plan['product_slug'], $premium_plans, true ) ) { $supports[] = 'akismet'; + $supports[] = 'recurring-payments'; $supports[] = 'simple-payments'; $supports[] = 'vaultpress'; $supports[] = 'videopress'; @@ -167,6 +167,7 @@ class Jetpack_Plan { if ( in_array( $plan['product_slug'], $business_plans, true ) ) { $supports[] = 'akismet'; + $supports[] = 'recurring-payments'; $supports[] = 'simple-payments'; $supports[] = 'vaultpress'; $supports[] = 'videopress'; |