Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/jetpack
File: class.jetpack-plan.php
<?php //phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
[0] Fix | Delete
/**
[1] Fix | Delete
* Handles fetching of the site's plan and products from WordPress.com and caching values locally.
[2] Fix | Delete
*
[3] Fix | Delete
* @deprecated 12.3 use Automattic\Jetpack\Current_Plan instead.
[4] Fix | Delete
*
[5] Fix | Delete
* Not to be confused with the `Jetpack_Plans` class (in `_inc/lib/plans.php`), which
[6] Fix | Delete
* fetches general information about all available plans from WordPress.com, side-effect free.
[7] Fix | Delete
*
[8] Fix | Delete
* @package automattic/jetpack
[9] Fix | Delete
*/
[10] Fix | Delete
[11] Fix | Delete
use Automattic\Jetpack\Current_Plan;
[12] Fix | Delete
[13] Fix | Delete
/**
[14] Fix | Delete
* Provides methods methods for fetching the site's plan and products from WordPress.com.
[15] Fix | Delete
*/
[16] Fix | Delete
class Jetpack_Plan {
[17] Fix | Delete
/**
[18] Fix | Delete
* The name of the option that will store the site's plan.
[19] Fix | Delete
*
[20] Fix | Delete
* @deprecated 12.3 use Automattic\Jetpack\Current_Plan::PLAN_OPTION
[21] Fix | Delete
*
[22] Fix | Delete
* @var string
[23] Fix | Delete
*/
[24] Fix | Delete
const PLAN_OPTION = Current_Plan::PLAN_OPTION;
[25] Fix | Delete
[26] Fix | Delete
/**
[27] Fix | Delete
* The name of the option that will store the site's products.
[28] Fix | Delete
*
[29] Fix | Delete
* @deprecated 12.3 use Automattic\Jetpack\Current_Plan::SITE_PRODUCTS_OPTION
[30] Fix | Delete
*
[31] Fix | Delete
* @var string
[32] Fix | Delete
*/
[33] Fix | Delete
const SITE_PRODUCTS_OPTION = Current_Plan::SITE_PRODUCTS_OPTION;
[34] Fix | Delete
[35] Fix | Delete
/**
[36] Fix | Delete
* Array of products supported by each plan.
[37] Fix | Delete
*
[38] Fix | Delete
* @deprecated 12.3 use Automattic\Jetpack\Current_Plan::PLAN_DATA
[39] Fix | Delete
*
[40] Fix | Delete
* @var array
[41] Fix | Delete
*/
[42] Fix | Delete
const PLAN_DATA = Current_Plan::PLAN_DATA;
[43] Fix | Delete
[44] Fix | Delete
/**
[45] Fix | Delete
* Given a response to the `/sites/%d` endpoint, will parse the response and attempt to set the
[46] Fix | Delete
* site's plan and products from the response.
[47] Fix | Delete
*
[48] Fix | Delete
* @deprecated 12.3 use Automattic\Jetpack\Current_Plan::update_from_sites_response instead.
[49] Fix | Delete
*
[50] Fix | Delete
* @param array $response The response from `/sites/%d`.
[51] Fix | Delete
* @return bool Was the plan successfully updated?
[52] Fix | Delete
*/
[53] Fix | Delete
public static function update_from_sites_response( $response ) {
[54] Fix | Delete
_deprecated_function( __METHOD__, '12.3', 'Automattic\Jetpack\Current_Plan::update_from_sites_response' );
[55] Fix | Delete
[56] Fix | Delete
return Current_Plan::update_from_sites_response( $response );
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
/**
[60] Fix | Delete
* Make an API call to WordPress.com for plan status
[61] Fix | Delete
*
[62] Fix | Delete
* @deprecated 12.3 use Automattic\Jetpack\Current_Plan::refresh_from_wpcom instead.
[63] Fix | Delete
*
[64] Fix | Delete
* @access public
[65] Fix | Delete
* @static
[66] Fix | Delete
*
[67] Fix | Delete
* @return bool True if plan is updated, false if no update
[68] Fix | Delete
*/
[69] Fix | Delete
public static function refresh_from_wpcom() {
[70] Fix | Delete
_deprecated_function( __METHOD__, '12.3', 'Automattic\Jetpack\Current_Plan::refresh_from_wpcom' );
[71] Fix | Delete
[72] Fix | Delete
return Current_Plan::refresh_from_wpcom();
[73] Fix | Delete
}
[74] Fix | Delete
[75] Fix | Delete
/**
[76] Fix | Delete
* Get the plan that this Jetpack site is currently using.
[77] Fix | Delete
*
[78] Fix | Delete
* @deprecated 12.3 use Automattic\Jetpack\Current_Plan::get instead.
[79] Fix | Delete
*
[80] Fix | Delete
* @access public
[81] Fix | Delete
* @static
[82] Fix | Delete
*
[83] Fix | Delete
* @return array Active Jetpack plan details
[84] Fix | Delete
*/
[85] Fix | Delete
public static function get() {
[86] Fix | Delete
_deprecated_function( __METHOD__, '12.3', 'Automattic\Jetpack\Current_Plan::get' );
[87] Fix | Delete
[88] Fix | Delete
return Current_Plan::get();
[89] Fix | Delete
}
[90] Fix | Delete
[91] Fix | Delete
/**
[92] Fix | Delete
* Get the site's products.
[93] Fix | Delete
*
[94] Fix | Delete
* @deprecated 12.3 use Automattic\Jetpack\Current_Plan::get_products instead.
[95] Fix | Delete
*
[96] Fix | Delete
* @access public
[97] Fix | Delete
* @static
[98] Fix | Delete
*
[99] Fix | Delete
* @return array Active Jetpack products
[100] Fix | Delete
*/
[101] Fix | Delete
public static function get_products() {
[102] Fix | Delete
_deprecated_function( __METHOD__, '12.3', 'Automattic\Jetpack\Current_Plan::get_products' );
[103] Fix | Delete
[104] Fix | Delete
return Current_Plan::get_products();
[105] Fix | Delete
}
[106] Fix | Delete
[107] Fix | Delete
/**
[108] Fix | Delete
* Gets the minimum plan slug that supports the given feature
[109] Fix | Delete
*
[110] Fix | Delete
* @deprecated 12.3 use Automattic\Jetpack\Current_Plan::get_minimum_plan_for_feature instead.
[111] Fix | Delete
*
[112] Fix | Delete
* @param string $feature The name of the feature.
[113] Fix | Delete
* @return string|bool The slug for the minimum plan that supports.
[114] Fix | Delete
* the feature or false if not found
[115] Fix | Delete
*/
[116] Fix | Delete
public static function get_minimum_plan_for_feature( $feature ) {
[117] Fix | Delete
_deprecated_function( __METHOD__, '12.3', 'Automattic\Jetpack\Current_Plan::get_minimum_plan_for_feature' );
[118] Fix | Delete
[119] Fix | Delete
return Current_Plan::get_minimum_plan_for_feature( $feature );
[120] Fix | Delete
}
[121] Fix | Delete
[122] Fix | Delete
/**
[123] Fix | Delete
* Determine whether the active plan supports a particular feature
[124] Fix | Delete
*
[125] Fix | Delete
* @deprecated 12.3 use Automattic\Jetpack\Current_Plan::supports instead.
[126] Fix | Delete
*
[127] Fix | Delete
* @access public
[128] Fix | Delete
* @static
[129] Fix | Delete
*
[130] Fix | Delete
* @param string $feature The module or feature to check.
[131] Fix | Delete
*
[132] Fix | Delete
* @return bool True if plan supports feature, false if not
[133] Fix | Delete
*/
[134] Fix | Delete
public static function supports( $feature ) {
[135] Fix | Delete
_deprecated_function( __METHOD__, '12.3', 'Automattic\Jetpack\Current_Plan::supports' );
[136] Fix | Delete
[137] Fix | Delete
return Current_Plan::supports( $feature );
[138] Fix | Delete
}
[139] Fix | Delete
}
[140] Fix | Delete
[141] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function