jetpack
Last commit date
3rd-party
1 week ago
_inc
2 days ago
css
2 weeks ago
extensions
2 days ago
images
1 month ago
jetpack_vendor
2 days ago
json-endpoints
1 week ago
modules
2 days ago
sal
1 week ago
src
2 days ago
vendor
2 days ago
views
1 month ago
CHANGELOG.md
2 days ago
LICENSE.txt
5 months ago
SECURITY.md
2 days ago
class-jetpack-connection-status.php
2 years ago
class-jetpack-gallery-settings.php
6 months ago
class-jetpack-newsletter-dashboard-widget.php
6 months ago
class-jetpack-pre-connection-jitms.php
2 years ago
class-jetpack-stats-dashboard-widget.php
3 months ago
class-jetpack-xmlrpc-methods.php
1 week ago
class.frame-nonce-preview.php
6 months ago
class.jetpack-admin.php
2 days ago
class.jetpack-autoupdate.php
6 months ago
class.jetpack-cli.php
2 days ago
class.jetpack-client-server.php
2 years ago
class.jetpack-gutenberg.php
1 week ago
class.jetpack-heartbeat.php
3 months ago
class.jetpack-modules-list-table.php
6 months ago
class.jetpack-network-sites-list-table.php
6 months ago
class.jetpack-network.php
1 month ago
class.jetpack-plan.php
2 years ago
class.jetpack-post-images.php
2 months ago
class.jetpack-twitter-cards.php
3 months ago
class.jetpack-user-agent.php
2 years ago
class.jetpack.php
2 days ago
class.json-api-endpoints.php
1 week ago
class.json-api.php
2 weeks ago
class.photon.php
3 years ago
composer.json
2 days ago
enhanced-open-graph.php
1 week ago
functions.compat.php
3 months ago
functions.cookies.php
2 years ago
functions.global.php
2 days ago
functions.is-mobile.php
2 years ago
functions.opengraph.php
2 months ago
functions.photon.php
2 years ago
jetpack.php
2 days ago
json-api-config.php
3 years ago
json-endpoints.php
2 years ago
load-jetpack.php
1 week ago
locales.php
6 months ago
readme.txt
2 days ago
unauth-file-upload.php
6 months ago
uninstall.php
6 months ago
wpml-config.xml
3 years ago
class.jetpack-plan.php
142 lines
| 1 | <?php //phpcs:ignore WordPress.Files.FileName.InvalidClassFileName |
| 2 | /** |
| 3 | * Handles fetching of the site's plan and products from WordPress.com and caching values locally. |
| 4 | * |
| 5 | * @deprecated 12.3 use Automattic\Jetpack\Current_Plan instead. |
| 6 | * |
| 7 | * Not to be confused with the `Jetpack_Plans` class (in `_inc/lib/plans.php`), which |
| 8 | * fetches general information about all available plans from WordPress.com, side-effect free. |
| 9 | * |
| 10 | * @package automattic/jetpack |
| 11 | */ |
| 12 | |
| 13 | use Automattic\Jetpack\Current_Plan; |
| 14 | |
| 15 | /** |
| 16 | * Provides methods methods for fetching the site's plan and products from WordPress.com. |
| 17 | */ |
| 18 | class Jetpack_Plan { |
| 19 | /** |
| 20 | * The name of the option that will store the site's plan. |
| 21 | * |
| 22 | * @deprecated 12.3 use Automattic\Jetpack\Current_Plan::PLAN_OPTION |
| 23 | * |
| 24 | * @var string |
| 25 | */ |
| 26 | const PLAN_OPTION = Current_Plan::PLAN_OPTION; |
| 27 | |
| 28 | /** |
| 29 | * The name of the option that will store the site's products. |
| 30 | * |
| 31 | * @deprecated 12.3 use Automattic\Jetpack\Current_Plan::SITE_PRODUCTS_OPTION |
| 32 | * |
| 33 | * @var string |
| 34 | */ |
| 35 | const SITE_PRODUCTS_OPTION = Current_Plan::SITE_PRODUCTS_OPTION; |
| 36 | |
| 37 | /** |
| 38 | * Array of products supported by each plan. |
| 39 | * |
| 40 | * @deprecated 12.3 use Automattic\Jetpack\Current_Plan::PLAN_DATA |
| 41 | * |
| 42 | * @var array |
| 43 | */ |
| 44 | const PLAN_DATA = Current_Plan::PLAN_DATA; |
| 45 | |
| 46 | /** |
| 47 | * Given a response to the `/sites/%d` endpoint, will parse the response and attempt to set the |
| 48 | * site's plan and products from the response. |
| 49 | * |
| 50 | * @deprecated 12.3 use Automattic\Jetpack\Current_Plan::update_from_sites_response instead. |
| 51 | * |
| 52 | * @param array $response The response from `/sites/%d`. |
| 53 | * @return bool Was the plan successfully updated? |
| 54 | */ |
| 55 | public static function update_from_sites_response( $response ) { |
| 56 | _deprecated_function( __METHOD__, '12.3', 'Automattic\Jetpack\Current_Plan::update_from_sites_response' ); |
| 57 | |
| 58 | return Current_Plan::update_from_sites_response( $response ); |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * Make an API call to WordPress.com for plan status |
| 63 | * |
| 64 | * @deprecated 12.3 use Automattic\Jetpack\Current_Plan::refresh_from_wpcom instead. |
| 65 | * |
| 66 | * @access public |
| 67 | * @static |
| 68 | * |
| 69 | * @return bool True if plan is updated, false if no update |
| 70 | */ |
| 71 | public static function refresh_from_wpcom() { |
| 72 | _deprecated_function( __METHOD__, '12.3', 'Automattic\Jetpack\Current_Plan::refresh_from_wpcom' ); |
| 73 | |
| 74 | return Current_Plan::refresh_from_wpcom(); |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * Get the plan that this Jetpack site is currently using. |
| 79 | * |
| 80 | * @deprecated 12.3 use Automattic\Jetpack\Current_Plan::get instead. |
| 81 | * |
| 82 | * @access public |
| 83 | * @static |
| 84 | * |
| 85 | * @return array Active Jetpack plan details |
| 86 | */ |
| 87 | public static function get() { |
| 88 | _deprecated_function( __METHOD__, '12.3', 'Automattic\Jetpack\Current_Plan::get' ); |
| 89 | |
| 90 | return Current_Plan::get(); |
| 91 | } |
| 92 | |
| 93 | /** |
| 94 | * Get the site's products. |
| 95 | * |
| 96 | * @deprecated 12.3 use Automattic\Jetpack\Current_Plan::get_products instead. |
| 97 | * |
| 98 | * @access public |
| 99 | * @static |
| 100 | * |
| 101 | * @return array Active Jetpack products |
| 102 | */ |
| 103 | public static function get_products() { |
| 104 | _deprecated_function( __METHOD__, '12.3', 'Automattic\Jetpack\Current_Plan::get_products' ); |
| 105 | |
| 106 | return Current_Plan::get_products(); |
| 107 | } |
| 108 | |
| 109 | /** |
| 110 | * Gets the minimum plan slug that supports the given feature |
| 111 | * |
| 112 | * @deprecated 12.3 use Automattic\Jetpack\Current_Plan::get_minimum_plan_for_feature instead. |
| 113 | * |
| 114 | * @param string $feature The name of the feature. |
| 115 | * @return string|bool The slug for the minimum plan that supports. |
| 116 | * the feature or false if not found |
| 117 | */ |
| 118 | public static function get_minimum_plan_for_feature( $feature ) { |
| 119 | _deprecated_function( __METHOD__, '12.3', 'Automattic\Jetpack\Current_Plan::get_minimum_plan_for_feature' ); |
| 120 | |
| 121 | return Current_Plan::get_minimum_plan_for_feature( $feature ); |
| 122 | } |
| 123 | |
| 124 | /** |
| 125 | * Determine whether the active plan supports a particular feature |
| 126 | * |
| 127 | * @deprecated 12.3 use Automattic\Jetpack\Current_Plan::supports instead. |
| 128 | * |
| 129 | * @access public |
| 130 | * @static |
| 131 | * |
| 132 | * @param string $feature The module or feature to check. |
| 133 | * |
| 134 | * @return bool True if plan supports feature, false if not |
| 135 | */ |
| 136 | public static function supports( $feature ) { |
| 137 | _deprecated_function( __METHOD__, '12.3', 'Automattic\Jetpack\Current_Plan::supports' ); |
| 138 | |
| 139 | return Current_Plan::supports( $feature ); |
| 140 | } |
| 141 | } |
| 142 |