Skip to content

Commit

Permalink
Package protect-status: Fix Current_Plan::supports from busting cache…
Browse files Browse the repository at this point in the history
… on every call. (#41010)

* Fix Protect-status Current_Plan::supports() from breaking the cache.
  • Loading branch information
elliottprogrammer authored Jan 16, 2025
1 parent adbfe86 commit 147fd7e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Protect-status package: Fix Current_Plan::supports() call from breaking cache on every call.
2 changes: 1 addition & 1 deletion projects/packages/protect-status/src/class-plan.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static function has_required_plan( $force_refresh = false ) {
$products = array_column( Current_Plan::get_products(), 'product_slug' );

// Check for a plan or product that enables scan.
$plan_supports_scan = Current_Plan::supports( 'scan', true );
$plan_supports_scan = Current_Plan::supports( 'scan', $force_refresh );
$has_scan_product = count( array_intersect( array( 'jetpack_scan', 'jetpack_scan_monthly' ), $products ) ) > 0;
$has_scan = $plan_supports_scan || $has_scan_product;
}
Expand Down

0 comments on commit 147fd7e

Please sign in to comment.