Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions includes/class-freemius.php
Original file line number Diff line number Diff line change
Expand Up @@ -8839,8 +8839,13 @@ private function get_plugins_data_for_api() {
isset( $site_active_plugins[ $basename ] )
) {
// Plugin was site level activated.
$site_active_plugins_cache->plugins[ $basename ] = $network_plugins[ $basename ];
$site_active_plugins_cache->plugins[ $basename ]['is_active'] = true;
$site_active_plugins_cache->plugins[ $basename ] = array(
'slug' => $network_plugins[ $basename ]['slug'],
'version' => $network_plugins[ $basename ]['Version'],
'title' => $network_plugins[ $basename ]['Name'],
'is_active' => $is_active,
'is_uninstalled' => false,
);
} else if ( isset( $site_active_plugins_cache->plugins[ $basename ] ) &&
! isset( $site_active_plugins[ $basename ] )
) {
Expand Down Expand Up @@ -21741,6 +21746,8 @@ private function handle_license_deactivation_result( $license, $hmm_text = false
'error'
);

$this->do_action( 'after_license_deactivation', $license );

return;
}

Expand All @@ -21761,6 +21768,8 @@ private function handle_license_deactivation_result( $license, $hmm_text = false

$this->_store_account();

$this->do_action( 'after_license_deactivation', $license );

if ( $show_notice ) {
$this->_admin_notices->add(
sprintf( $this->is_only_premium() ?
Expand Down
32 changes: 31 additions & 1 deletion includes/managers/class-fs-checkout-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,37 @@ public function get_query_params( Freemius $fs, $plugin_id, $plan_id, $licenses
( $fs->is_theme() && current_user_can( 'install_themes' ) )
);

return array_merge( $context_params, $_GET, array(
/**
* Allow developers to customize the checkout query params before final validation,
* so custom keys can be included and known keys can be overridden.
* We then validate the merged params and re-attach any unknown custom keys that
* validation intentionally ignores, preserving developer-provided extras while
* keeping core keys safe.
*
* Usage example (in a plugin/theme):
*
* add_filter( 'fs_checkout_query_params_' . fs()->get_unique_affix(), function( $params ) {
* // Add or modify query params passed to the Freemius Checkout.
* $params['coupon'] = 'WELCOME10';
* $params['utm_source'] = 'my-plugin';
* return $params;
* }, 10, 5 );
*
* @since 2.12.1.3
*
* @param array $context_params The params prepared by the SDK before validation.
* @param Freemius $fs The Freemius instance of the calling module.
* @param int|mixed $plugin_id The target plugin/add-on ID for the checkout context.
* @param int|mixed $plan_id The selected plan ID (if any).
* @param int|mixed $licenses The requested number of licenses (if provided).
*/
$filtered_params = fs_apply_filter(
$fs->get_unique_affix(),
'checkout_query_params',
$context_params
);

return array_merge( $filtered_params, $_GET, array(
// Current plugin version.
'plugin_version' => $fs->get_plugin_version(),
'sdk_version' => WP_FS__SDK_VERSION,
Expand Down
2 changes: 1 addition & 1 deletion start.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @var string
*/
$this_sdk_version = '2.12.1.2';
$this_sdk_version = '2.12.1.3';

#region SDK Selection Logic --------------------------------------------------------------------

Expand Down