updated plugin Jetpack Protect version 1.3.0

This commit is contained in:
2023-03-17 22:34:13 +00:00
committed by Gitium
parent 19e086d1c4
commit 1e9ac45ec6
183 changed files with 4388 additions and 2345 deletions

View File

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

View File

@ -142,7 +142,6 @@ class Wpcom_Products {
self::update_cache( $products );
return $products;
}
/**
@ -175,11 +174,13 @@ class Wpcom_Products {
$cost = $product->cost;
$discount_price = $cost;
$is_introductory_offer = false;
$introductory_offer = null;
// Get/compute the discounted price.
if ( isset( $product->introductory_offer->cost_per_interval ) ) {
$discount_price = $product->introductory_offer->cost_per_interval;
$is_introductory_offer = true;
$introductory_offer = $product->introductory_offer;
}
$pricing = array(
@ -187,6 +188,7 @@ class Wpcom_Products {
'full_price' => $cost,
'discount_price' => $discount_price,
'is_introductory_offer' => $is_introductory_offer,
'introductory_offer' => $introductory_offer,
);
return self::populate_with_discount( $product, $pricing, $discount_price );

View File

@ -8,7 +8,7 @@
namespace Automattic\Jetpack\My_Jetpack\Products;
use Automattic\Jetpack\Connection\Client;
use Automattic\Jetpack\My_Jetpack\Hybrid_Product;
use Automattic\Jetpack\My_Jetpack\Product;
use Automattic\Jetpack\My_Jetpack\Wpcom_Products;
use Automattic\Jetpack\Redirect;
use Jetpack_Options;
@ -17,7 +17,7 @@ use WP_Error;
/**
* Class responsible for handling the Backup product
*/
class Backup extends Hybrid_Product {
class Backup extends Product {
/**
* The product slug
@ -198,9 +198,7 @@ class Backup extends Hybrid_Product {
* @return ?string
*/
public static function get_manage_url() {
if ( static::is_jetpack_plugin_active() ) {
return Redirect::get_url( 'my-jetpack-manage-backup' );
} elseif ( static::is_plugin_active() ) {
if ( static::is_plugin_active() ) {
return admin_url( 'admin.php?page=jetpack-backup' );
}
}

View File

@ -12,6 +12,13 @@ use Automattic\Jetpack\Plugins_Installer;
use WP_Error;
/**
*
* DEPRECATED: This class is deprecated and will be removed in a future version.
*
* All product classes have been moved out of the hybrid class concept
*
* @deprecated 2.7.2
*
* Class responsible for handling the hybrid products
*
* Hybrid products are those that may work both as a stand-alone plugin or with the Jetpack plugin.
@ -120,7 +127,6 @@ abstract class Hybrid_Product extends Product {
}
return true;
}
}

View File

@ -116,7 +116,6 @@ abstract class Module_Product extends Product {
}
return $module_activation;
}
/**

View File

@ -403,7 +403,6 @@ abstract class Product {
$result = apply_filters( "my_jetpack_{$product_slug}_activation", $result );
return $result;
}
/**

View File

@ -174,7 +174,6 @@ class Scan extends Module_Product {
}
return $product_activation;
}
/**

View File

@ -9,7 +9,7 @@ namespace Automattic\Jetpack\My_Jetpack\Products;
use Automattic\Jetpack\Connection\Client;
use Automattic\Jetpack\Constants;
use Automattic\Jetpack\My_Jetpack\Hybrid_Product;
use Automattic\Jetpack\My_Jetpack\Product;
use Automattic\Jetpack\My_Jetpack\Wpcom_Products;
use Automattic\Jetpack\Search\Module_Control as Search_Module_Control;
use Jetpack_Options;
@ -18,7 +18,7 @@ use WP_Error;
/**
* Class responsible for handling the Search product
*/
class Search extends Hybrid_Product {
class Search extends Product {
/**
* The product slug
*

View File

@ -38,7 +38,7 @@ class Security extends Module_Product {
* @return string
*/
public static function get_name() {
return __( 'Security', 'jetpack-my-jetpack' );
return _x( 'Security', 'Jetpack product name', 'jetpack-my-jetpack' );
}
/**
@ -47,7 +47,7 @@ class Security extends Module_Product {
* @return string
*/
public static function get_title() {
return __( 'Security', 'jetpack-my-jetpack' );
return _x( 'Security', 'Jetpack product name', 'jetpack-my-jetpack' );
}
/**
@ -149,7 +149,6 @@ class Security extends Module_Product {
}
return $activation;
}
/**

View File

@ -7,13 +7,13 @@
namespace Automattic\Jetpack\My_Jetpack\Products;
use Automattic\Jetpack\My_Jetpack\Hybrid_Product;
use Automattic\Jetpack\My_Jetpack\Product;
use Automattic\Jetpack\My_Jetpack\Wpcom_Products;
/**
* Class responsible for handling the Social product
*/
class Social extends Hybrid_Product {
class Social extends Product {
/**
* The product slug
@ -126,9 +126,7 @@ class Social extends Hybrid_Product {
* @return string
*/
public static function get_manage_url() {
if ( static::is_jetpack_plugin_active() ) {
return admin_url( 'admin.php?page=jetpack#/settings?term=publicize' );
} elseif ( static::is_plugin_active() ) {
if ( static::is_plugin_active() ) {
return admin_url( 'admin.php?page=jetpack-social' );
}
}

View File

@ -7,13 +7,13 @@
namespace Automattic\Jetpack\My_Jetpack\Products;
use Automattic\Jetpack\My_Jetpack\Hybrid_Product;
use Automattic\Jetpack\My_Jetpack\Product;
use Automattic\Jetpack\My_Jetpack\Wpcom_Products;
/**
* Class responsible for handling the VideoPress product
*/
class Videopress extends Hybrid_Product {
class Videopress extends Product {
/**
* The product slug
@ -145,8 +145,6 @@ class Videopress extends Hybrid_Product {
public static function get_manage_url() {
if ( method_exists( 'Automattic\Jetpack\VideoPress\Initializer', 'should_initialize_admin_ui' ) && \Automattic\Jetpack\VideoPress\Initializer::should_initialize_admin_ui() ) {
return \Automattic\Jetpack\VideoPress\Admin_UI::get_admin_page_url();
} else {
return admin_url( 'admin.php?page=jetpack#/settings?term=videopress' );
}
}