updated plugin Jetpack Protect version 1.2.0

This commit is contained in:
2023-01-18 16:40:00 +00:00
committed by Gitium
parent 6f8f73e860
commit 35a7ea2e06
117 changed files with 5567 additions and 665 deletions

View File

@ -30,7 +30,7 @@ class Initializer {
*
* @var string
*/
const PACKAGE_VERSION = '2.5.1';
const PACKAGE_VERSION = '2.6.0';
/**
* Initialize My Jetpack

View File

@ -35,21 +35,36 @@ class Wpcom_Products {
* @return Object|WP_Error
*/
private static function get_products_from_wpcom() {
$blog_id = \Jetpack_Options::get_option( 'id' );
$endpoint = sprintf( '/sites/%d/products/?_locale=%s&type=jetpack', $blog_id, get_user_locale() );
$wpcom_request = Client::wpcom_json_api_request_as_blog(
$endpoint,
'1.1',
array(
'method' => 'GET',
'headers' => array(
'X-Forwarded-For' => ( new Visitor() )->get_ip( true ),
),
)
$blog_id = \Jetpack_Options::get_option( 'id' );
$ip = ( new Visitor() )->get_ip( true );
$headers = array(
'X-Forwarded-For' => $ip,
);
// If has a blog id, use connected endpoint.
if ( $blog_id ) {
$endpoint = sprintf( '/sites/%d/products/?_locale=%s&type=jetpack', $blog_id, get_user_locale() );
$wpcom_request = Client::wpcom_json_api_request_as_blog(
$endpoint,
'1.1',
array(
'method' => 'GET',
'headers' => $headers,
)
);
} else {
$endpoint = 'https://public-api.wordpress.com/rest/v1.1/products?locale=' . get_user_locale() . '&type=jetpack';
$wpcom_request = wp_remote_get(
esc_url_raw( $endpoint ),
array(
'headers' => $headers,
)
);
}
$response_code = wp_remote_retrieve_response_code( $wpcom_request );
if ( 200 === $response_code ) {

View File

@ -99,7 +99,7 @@ class Videopress extends Hybrid_Product {
return array(
_x( '1TB of storage', 'VideoPress Product Feature', 'jetpack-my-jetpack' ),
_x( 'Built into WordPress editor', 'VideoPress Product Feature', 'jetpack-my-jetpack' ),
_x( 'Ad-free and brandable player', 'VideoPress Product Feature', 'jetpack-my-jetpack' ),
_x( 'Ad-free and customizable player', 'VideoPress Product Feature', 'jetpack-my-jetpack' ),
_x( 'Unlimited users', 'VideoPress Product Feature', 'jetpack-my-jetpack' ),
);
}