From 779719dbfc08f990798fa17dcdf4ce433fd6ccc5 Mon Sep 17 00:00:00 2001 From: Daniele Alessandra Date: Thu, 28 Aug 2025 16:12:40 +0200 Subject: [PATCH 1/3] Added show_pending=true to activation request if user provided a license key --- includes/class-freemius.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/class-freemius.php b/includes/class-freemius.php index 79439c8e..d95704aa 100755 --- a/includes/class-freemius.php +++ b/includes/class-freemius.php @@ -17218,6 +17218,10 @@ function opt_in( $params['is_extensions_tracking_allowed'] = FS_Permission_Manager::instance( $this )->is_extensions_tracking_allowed(); $params['is_diagnostic_tracking_allowed'] = FS_Permission_Manager::instance( $this )->is_diagnostic_tracking_allowed(); + // We want to allow people activating license on unpublished plugins if they are using a license key + if ( ! empty($license_key)) + $params['show_pending'] = true; + $request = array( 'method' => 'POST', 'body' => $params, From b47265cf8d5f7dd394d34060fb481bdd8d78f9d0 Mon Sep 17 00:00:00 2001 From: Daniele Alessandra Date: Fri, 29 Aug 2025 15:59:21 +0200 Subject: [PATCH 2/3] Added a message to add-ons page to inform developer that some add-on may not be visible --- templates/add-ons.php | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/templates/add-ons.php b/templates/add-ons.php index d4078f0c..a924f335 100755 --- a/templates/add-ons.php +++ b/templates/add-ons.php @@ -50,7 +50,28 @@ do_action( 'addons/after_title' ) ?> -
+ has_secret_key()) : + $integration_url = 'https://dashboard.freemius.com/#!/live/plugins/' . $fs->get_id() . '/integration/'; + $secret_const = 'WP_FS__' . $slug . '_SECRET_KEY'; + ?> +
+ You have enabled WP_FS__DEV_MODE, but no secret key is defined for this plugin. As a result, add-ons that are not publicly released yet, or that do not have publicly visible pricing, will not appear in the list below.

+

To configure your development environment properly, add the %s constant to your wp-config.php, then reload this page. + %s

', + $secret_const, + esc_url( $integration_url ), + esc_html( fs_text_inline( 'Read the integration guide', 'read-integration-guide', $slug ) ) + ); ?> +
+ + + +

Date: Wed, 10 Dec 2025 16:47:26 +0100 Subject: [PATCH 3/3] Allow license activation for unpublished add-ons and harden addon account template --- start.php | 2 +- templates/account/partials/addon.php | 23 ++++++++++++++++------- templates/add-ons.php | 23 +---------------------- 3 files changed, 18 insertions(+), 30 deletions(-) diff --git a/start.php b/start.php index 73688982..f1534010 100644 --- a/start.php +++ b/start.php @@ -15,7 +15,7 @@ * * @var string */ - $this_sdk_version = '2.13.0'; + $this_sdk_version = '2.13.0.1'; #region SDK Selection Logic -------------------------------------------------------------------- diff --git a/templates/account/partials/addon.php b/templates/account/partials/addon.php index af9b94c2..adb23e5d 100644 --- a/templates/account/partials/addon.php +++ b/templates/account/partials/addon.php @@ -13,14 +13,23 @@ $odd = $VARS['odd']; $slug = $fs->get_slug(); - $fs_blog_id = $VARS['fs_blog_id']; + $fs_blog_id = isset( $VARS['fs_blog_id'] ) ? $VARS['fs_blog_id'] : null; - $active_plugins_directories_map = $VARS['active_plugins_directories_map']; + $active_plugins_directories_map = isset( $VARS['active_plugins_directories_map'] ) && is_array( $VARS['active_plugins_directories_map'] ) + ? $VARS['active_plugins_directories_map'] + : array(); + + // Make sure addon info is always an array to avoid undefined index notices. + $addon_info = ( isset( $VARS['addon_info'] ) && is_array( $VARS['addon_info'] ) ) + ? $VARS['addon_info'] + : array(); - $addon_info = $VARS['addon_info']; $is_addon_activated = $fs->is_addon_activated( $addon_id ); - $is_addon_connected = $addon_info['is_connected']; - $is_addon_installed = $VARS['is_addon_installed']; + + // If the 'is_connected' key is missing, default to false. + $is_addon_connected = isset( $addon_info['is_connected'] ) ? (bool) $addon_info['is_connected'] : false; + + $is_addon_installed = ! empty( $VARS['is_addon_installed'] ); $fs_addon = ( $is_addon_connected && $is_addon_installed ) ? freemius( $addon_id ) : @@ -65,7 +74,7 @@ $subscription = null; $is_paying = false; $show_upgrade = false; - $is_whitelabeled = $VARS['is_whitelabeled']; + $is_whitelabeled = ! empty( $VARS['is_whitelabeled'] ); if ( is_object( $fs_addon ) ) { $is_paying = $fs_addon->is_paying(); @@ -132,7 +141,7 @@ ( $site->trial_plan_id == $license->plan_id ) ); - $is_whitelabeled = $addon_info['is_whitelabeled']; + $is_whitelabeled = isset( $addon_info['is_whitelabeled'] ) ? (bool) $addon_info['is_whitelabeled'] : false; } } diff --git a/templates/add-ons.php b/templates/add-ons.php index a924f335..d4078f0c 100755 --- a/templates/add-ons.php +++ b/templates/add-ons.php @@ -50,28 +50,7 @@ do_action( 'addons/after_title' ) ?> - has_secret_key()) : - $integration_url = 'https://dashboard.freemius.com/#!/live/plugins/' . $fs->get_id() . '/integration/'; - $secret_const = 'WP_FS__' . $slug . '_SECRET_KEY'; - ?> -
- You have enabled WP_FS__DEV_MODE, but no secret key is defined for this plugin. As a result, add-ons that are not publicly released yet, or that do not have publicly visible pricing, will not appear in the list below.

-

To configure your development environment properly, add the %s constant to your wp-config.php, then reload this page. - %s

', - $secret_const, - esc_url( $integration_url ), - esc_html( fs_text_inline( 'Read the integration guide', 'read-integration-guide', $slug ) ) - ); ?> -
- - - -
+