From 6ddb41f5334d7c6a1125eca2d8e3d853f4ea2574 Mon Sep 17 00:00:00 2001 From: jboland88 <18016357+jboland88@users.noreply.github.com> Date: Tue, 2 Apr 2024 17:36:14 -0400 Subject: [PATCH 1/2] Add has_free_offering check to my Jetpack products --- .../packages/my-jetpack/src/products/class-anti-spam.php | 7 +++++++ .../packages/my-jetpack/src/products/class-backup.php | 7 +++++++ projects/packages/my-jetpack/src/products/class-boost.php | 7 +++++++ .../packages/my-jetpack/src/products/class-creator.php | 7 +++++++ projects/packages/my-jetpack/src/products/class-crm.php | 7 +++++++ .../packages/my-jetpack/src/products/class-jetpack-ai.php | 7 +++++++ .../packages/my-jetpack/src/products/class-product.php | 8 ++++++++ .../packages/my-jetpack/src/products/class-protect.php | 7 +++++++ .../packages/my-jetpack/src/products/class-search.php | 7 +++++++ .../packages/my-jetpack/src/products/class-social.php | 7 +++++++ projects/packages/my-jetpack/src/products/class-stats.php | 7 +++++++ .../packages/my-jetpack/src/products/class-videopress.php | 7 +++++++ 12 files changed, 85 insertions(+) diff --git a/projects/packages/my-jetpack/src/products/class-anti-spam.php b/projects/packages/my-jetpack/src/products/class-anti-spam.php index 0ec88ff334877..3c78bcd29bde5 100644 --- a/projects/packages/my-jetpack/src/products/class-anti-spam.php +++ b/projects/packages/my-jetpack/src/products/class-anti-spam.php @@ -43,6 +43,13 @@ class Anti_Spam extends Product { */ public static $requires_user_connection = false; + /** + * Whether this product has a free offering + * + * @var bool + */ + public static $has_free_offering = true; + /** * Get the product name * diff --git a/projects/packages/my-jetpack/src/products/class-backup.php b/projects/packages/my-jetpack/src/products/class-backup.php index 6eb82aad298fa..390872fe587a3 100644 --- a/projects/packages/my-jetpack/src/products/class-backup.php +++ b/projects/packages/my-jetpack/src/products/class-backup.php @@ -51,6 +51,13 @@ class Backup extends Hybrid_Product { */ public static $has_standalone_plugin = true; + /** + * Whether this product has a free offering + * + * @var bool + */ + public static $has_free_offering = false; + /** * Get the product name * diff --git a/projects/packages/my-jetpack/src/products/class-boost.php b/projects/packages/my-jetpack/src/products/class-boost.php index 03f4a5546aa77..0c23a83929cec 100644 --- a/projects/packages/my-jetpack/src/products/class-boost.php +++ b/projects/packages/my-jetpack/src/products/class-boost.php @@ -50,6 +50,13 @@ class Boost extends Product { */ public static $requires_user_connection = false; + /** + * Whether this product has a free offering + * + * @var bool + */ + public static $has_free_offering = true; + /** * Get the product name * diff --git a/projects/packages/my-jetpack/src/products/class-creator.php b/projects/packages/my-jetpack/src/products/class-creator.php index 2d54bfbb9ba27..1e5972e170b3e 100644 --- a/projects/packages/my-jetpack/src/products/class-creator.php +++ b/projects/packages/my-jetpack/src/products/class-creator.php @@ -49,6 +49,13 @@ public static function get_plugin_filename() { */ public static $requires_user_connection = false; + /** + * Whether this product has a free offering + * + * @var bool + */ + public static $has_free_offering = true; + /** * Get the product name * diff --git a/projects/packages/my-jetpack/src/products/class-crm.php b/projects/packages/my-jetpack/src/products/class-crm.php index e5d8a3d4c2679..052633c94d61c 100644 --- a/projects/packages/my-jetpack/src/products/class-crm.php +++ b/projects/packages/my-jetpack/src/products/class-crm.php @@ -46,6 +46,13 @@ class Crm extends Product { */ public static $requires_user_connection = false; + /** + * Whether this product has a free offering + * + * @var bool + */ + public static $has_free_offering = true; + /** * Get the product name * diff --git a/projects/packages/my-jetpack/src/products/class-jetpack-ai.php b/projects/packages/my-jetpack/src/products/class-jetpack-ai.php index 7c380b095c6b6..414449b3c1daa 100644 --- a/projects/packages/my-jetpack/src/products/class-jetpack-ai.php +++ b/projects/packages/my-jetpack/src/products/class-jetpack-ai.php @@ -28,6 +28,13 @@ class Jetpack_Ai extends Product { */ public static $slug = 'jetpack-ai'; + /** + * Whether this product has a free offering + * + * @var bool + */ + public static $has_free_offering = true; + /** * Get the Product info for the API * diff --git a/projects/packages/my-jetpack/src/products/class-product.php b/projects/packages/my-jetpack/src/products/class-product.php index def5da509d9cd..cb3f53194ceda 100644 --- a/projects/packages/my-jetpack/src/products/class-product.php +++ b/projects/packages/my-jetpack/src/products/class-product.php @@ -77,6 +77,13 @@ abstract class Product { */ public static $has_standalone_plugin = false; + /** + * Whether this product has a free offering + * + * @var bool + */ + public static $has_free_offering = false; + /** * Get the plugin slug * @@ -148,6 +155,7 @@ public static function get_info() { 'requires_user_connection' => static::$requires_user_connection, 'has_required_plan' => static::has_required_plan(), 'has_paid_plan_for_product' => static::has_paid_plan_for_product(), + 'has_free_offering' => static::$has_free_offering, 'has_required_tier' => static::has_required_tier(), 'manage_url' => static::get_manage_url(), 'purchase_url' => static::get_purchase_url(), diff --git a/projects/packages/my-jetpack/src/products/class-protect.php b/projects/packages/my-jetpack/src/products/class-protect.php index ecd0d892e6f99..331ea2b46e58d 100644 --- a/projects/packages/my-jetpack/src/products/class-protect.php +++ b/projects/packages/my-jetpack/src/products/class-protect.php @@ -54,6 +54,13 @@ class Protect extends Product { */ public static $requires_user_connection = false; + /** + * Whether this product has a free offering + * + * @var bool + */ + public static $has_free_offering = true; + /** * Get the product name * diff --git a/projects/packages/my-jetpack/src/products/class-search.php b/projects/packages/my-jetpack/src/products/class-search.php index a0b8041b76c73..03d79b8e2753e 100644 --- a/projects/packages/my-jetpack/src/products/class-search.php +++ b/projects/packages/my-jetpack/src/products/class-search.php @@ -47,6 +47,13 @@ class Search extends Hybrid_Product { */ public static $has_standalone_plugin = true; + /** + * Whether this product has a free offering + * + * @var bool + */ + public static $has_free_offering = true; + /** * The filename (id) of the plugin associated with this product. * diff --git a/projects/packages/my-jetpack/src/products/class-social.php b/projects/packages/my-jetpack/src/products/class-social.php index 349a3637838c2..15e9d2b8e0247 100644 --- a/projects/packages/my-jetpack/src/products/class-social.php +++ b/projects/packages/my-jetpack/src/products/class-social.php @@ -55,6 +55,13 @@ class Social extends Hybrid_Product { 'jetpack-social-dev/jetpack-social.php', ); + /** + * Whether this product has a free offering + * + * @var bool + */ + public static $has_free_offering = true; + /** * Get the product name * diff --git a/projects/packages/my-jetpack/src/products/class-stats.php b/projects/packages/my-jetpack/src/products/class-stats.php index 63a818dbc7371..6960c7e73bb49 100644 --- a/projects/packages/my-jetpack/src/products/class-stats.php +++ b/projects/packages/my-jetpack/src/products/class-stats.php @@ -59,6 +59,13 @@ class Stats extends Module_Product { */ public static $has_standalone_plugin = false; + /** + * Whether this product has a free offering + * + * @var bool + */ + public static $has_free_offering = true; + /** * Get the product name * diff --git a/projects/packages/my-jetpack/src/products/class-videopress.php b/projects/packages/my-jetpack/src/products/class-videopress.php index 8962d0c9a255f..4c8b6b15155d7 100644 --- a/projects/packages/my-jetpack/src/products/class-videopress.php +++ b/projects/packages/my-jetpack/src/products/class-videopress.php @@ -61,6 +61,13 @@ class Videopress extends Hybrid_Product { */ public static $has_standalone_plugin = true; + /** + * Whether this product has a free offering + * + * @var bool + */ + public static $has_free_offering = true; + /** * Get the product name * From c7ce24bd7d43dba3afbedb40d3fa3a40b4e8289a Mon Sep 17 00:00:00 2001 From: jboland88 <18016357+jboland88@users.noreply.github.com> Date: Tue, 2 Apr 2024 17:38:59 -0400 Subject: [PATCH 2/2] changelog --- .../update-add-better-free-check-for-my-jetpack-products | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 projects/packages/my-jetpack/changelog/update-add-better-free-check-for-my-jetpack-products diff --git a/projects/packages/my-jetpack/changelog/update-add-better-free-check-for-my-jetpack-products b/projects/packages/my-jetpack/changelog/update-add-better-free-check-for-my-jetpack-products new file mode 100644 index 0000000000000..620791a880bd3 --- /dev/null +++ b/projects/packages/my-jetpack/changelog/update-add-better-free-check-for-my-jetpack-products @@ -0,0 +1,4 @@ +Significance: minor +Type: added + +add a has_free_offering boolean on My Jetpack products