diff --git a/projects/plugins/jetpack/_inc/lib/class-jetpack-ai-helper.php b/projects/plugins/jetpack/_inc/lib/class-jetpack-ai-helper.php index fb8cdcf94e8bc..68be7f6d8fed1 100644 --- a/projects/plugins/jetpack/_inc/lib/class-jetpack-ai-helper.php +++ b/projects/plugins/jetpack/_inc/lib/class-jetpack-ai-helper.php @@ -396,6 +396,17 @@ public static function get_ai_assistance_feature() { $usage_period_requests_count = WPCOM\Jetpack_AI\Usage\Helper::get_current_period_requests_count( $blog_id ); + /* + * Get current tier value, a number representing + * the current tier of the site. + * + * - 0 represents a site with the free plan. + * - 1 represents a site with the current, unlimited plan. + * - 100, 200, 500 represents a site with the new plans, + * with the respective number of allowed requests. + */ + $current_tier_value = $has_ai_assistant_feature ? WPCOM\Jetpack_AI\Usage\Helper::get_tier_usage_quantity( $blog_id ) : 0; + // Check if the site requires an upgrade. $require_upgrade = $is_over_limit && ! $has_ai_assistant_feature; @@ -415,7 +426,7 @@ public static function get_ai_assistance_feature() { 'site-require-upgrade' => $require_upgrade, 'upgrade-type' => $upgrade_type, 'current-tier' => array( - 'value' => $has_ai_assistant_feature ? 1 : 0, + 'value' => $current_tier_value, ), ); } diff --git a/projects/plugins/jetpack/changelog/update-jetpack-ai-use-usage-helper-to-set-current-tier-value b/projects/plugins/jetpack/changelog/update-jetpack-ai-use-usage-helper-to-set-current-tier-value new file mode 100644 index 0000000000000..ff96ae47dfef0 --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-jetpack-ai-use-usage-helper-to-set-current-tier-value @@ -0,0 +1,4 @@ +Significance: patch +Type: enhancement + +Jetpack AI: Use Jetpack AI Usage Helper to set current plan tier information on feature endpoint. diff --git a/projects/plugins/jetpack/composer.json b/projects/plugins/jetpack/composer.json index 7fb629452f53f..71057a007630d 100644 --- a/projects/plugins/jetpack/composer.json +++ b/projects/plugins/jetpack/composer.json @@ -103,7 +103,7 @@ "platform": { "ext-intl": "0.0.0" }, - "autoloader-suffix": "f11009ded9fc4592b6a05b61ce272b3c_jetpackā“„12_8_a_11", + "autoloader-suffix": "f11009ded9fc4592b6a05b61ce272b3c_jetpackā“„12_8_a_12", "allow-plugins": { "automattic/jetpack-autoloader": true, "automattic/jetpack-composer-plugin": true diff --git a/projects/plugins/jetpack/jetpack.php b/projects/plugins/jetpack/jetpack.php index df65e83a2f269..ca938547d214f 100644 --- a/projects/plugins/jetpack/jetpack.php +++ b/projects/plugins/jetpack/jetpack.php @@ -4,7 +4,7 @@ * Plugin URI: https://jetpack.com * Description: Security, performance, and marketing tools made by WordPress experts. Jetpack keeps your site protected so you can focus on more important things. * Author: Automattic - * Version: 12.8-a.11 + * Version: 12.8-a.12 * Author URI: https://jetpack.com * License: GPL2+ * Text Domain: jetpack @@ -34,7 +34,7 @@ define( 'JETPACK__MINIMUM_WP_VERSION', '6.2' ); define( 'JETPACK__MINIMUM_PHP_VERSION', '5.6' ); -define( 'JETPACK__VERSION', '12.8-a.11' ); +define( 'JETPACK__VERSION', '12.8-a.12' ); /** * Constant used to fetch the connection owner token diff --git a/projects/plugins/jetpack/package.json b/projects/plugins/jetpack/package.json index a2bda536fbe01..b85a74875ddc0 100644 --- a/projects/plugins/jetpack/package.json +++ b/projects/plugins/jetpack/package.json @@ -1,6 +1,6 @@ { "name": "Jetpack", - "version": "12.8.0-a.11", + "version": "12.8.0-a.12", "private": true, "description": "[Jetpack](https://jetpack.com/) is a WordPress plugin that supercharges your self-hosted WordPress site with the awesome cloud power of [WordPress.com](https://wordpress.com).", "homepage": "https://jetpack.com",