Skip to content
Merged
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
2 changes: 1 addition & 1 deletion assets/css/admin/account.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/scss/admin/account.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
}

#fs_account_details .button-group {
float: right;
float: none;
}

.rtl #fs_account .fs-header-actions
Expand Down
68 changes: 48 additions & 20 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 @@ -15777,6 +15782,10 @@ static function get_sites_blog_ids( $sites ) {
function get_site_info( $site = null, $load_registration = false ) {
$this->_logger->entrance();

$fs_hook_snapshot = new FS_Hook_Snapshot();
// Remove all filters from `switch_blog`.
$fs_hook_snapshot->remove( 'switch_blog' );

$switched = false;

$registration_date = null;
Expand Down Expand Up @@ -15836,6 +15845,9 @@ function get_site_info( $site = null, $load_registration = false ) {
restore_current_blog();
}

// Add the filters back to `switch_blog`.
$fs_hook_snapshot->restore( 'switch_blog' );

return $info;
}

Expand Down Expand Up @@ -23505,7 +23517,7 @@ function _fs_pricing_ajax_action_handler() {
$params['plugin_public_key'] = $this->get_public_key();
}

$result = $api->get( 'pricing.json?' . http_build_query( $params ) );
$result = $api->get( $this->add_show_pending( 'pricing.json?' . http_build_query( $params ) ) );
break;
case 'start_trial':
$trial_plan_id = fs_request_get( 'plan_id' );
Expand Down Expand Up @@ -24686,23 +24698,39 @@ private function get_complete_upgrade_instructions( $plan_title = '' ) {
$this->get_premium_slug() :
$this->premium_plugin_basename();

return sprintf(
/* translators: %1$s: Product title; %2$s: Plan title */
$this->get_text_inline( ' The paid version of %1$s is already installed. Please activate it to start benefiting the %2$s features. %3$s', 'activate-premium-version' ),
sprintf( '<em>%s</em>', esc_html( $this->get_plugin_title() ) ),
$plan_title,
sprintf(
'<a style="margin-left: 10px;" href="%s"><button class="button button-primary">%s</button></a>',
( $this->is_theme() ?
wp_nonce_url( 'themes.php?action=activate&amp;stylesheet=' . $premium_theme_slug_or_plugin_basename, 'switch-theme_' . $premium_theme_slug_or_plugin_basename ) :
wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $premium_theme_slug_or_plugin_basename, 'activate-plugin_' . $premium_theme_slug_or_plugin_basename ) ),
esc_html( sprintf(
/* translators: %s: Plan title */
$this->get_text_inline( 'Activate %s features', 'activate-x-features' ),
$plan_title
) )
)
);
if ( is_admin() ) {
return sprintf(
/* translators: %1$s: Product title; %2$s: Plan title */
$this->get_text_inline( ' The paid version of %1$s is already installed. Please activate it to start benefiting from the %2$s features. %3$s', 'activate-premium-version' ),
sprintf( '<em>%s</em>', esc_html( $this->get_plugin_title() ) ),
$plan_title,
sprintf(
'<a style="margin-left: 10px;" href="%s"><button class="button button-primary">%s</button></a>',
( $this->is_theme() ?
wp_nonce_url( 'themes.php?action=activate&amp;stylesheet=' . $premium_theme_slug_or_plugin_basename, 'switch-theme_' . $premium_theme_slug_or_plugin_basename ) :
wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $premium_theme_slug_or_plugin_basename, 'activate-plugin_' . $premium_theme_slug_or_plugin_basename ) ),
esc_html( sprintf(
/* translators: %s: Plan title */
$this->get_text_inline( 'Activate %s features', 'activate-x-features' ),
$plan_title
) )
)
);
} else {
return sprintf(
/* translators: %1$s: Product title; %3$s: Plan title */
$this->get_text_inline( ' The paid version of %1$s is already installed. Please navigate to the %2$s to activate it and start benefiting from the %3$s features.', 'activate-premium-version-plugins-page' ),
sprintf( '<em>%s</em>', esc_html( $this->get_plugin_title() ) ),
sprintf(
'<a href="%s">%s</a>',
admin_url( $this->is_theme() ? 'themes.php' : 'plugins.php' ),
( $this->is_theme() ?
$this->get_text_inline( 'Themes page', 'themes-page' ) :
$this->get_text_inline( 'Plugins page', 'plugins-page' ) )
),
$plan_title
);
}
} else {
// @since 1.2.1.5 The free version is auto deactivated.
$deactivation_step = version_compare( $this->version, '1.2.1.5', '<' ) ?
Expand Down
45 changes: 45 additions & 0 deletions includes/class-fs-hook-snapshot.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php
/**
* @package Freemius
* @copyright Copyright (c) 2025, Freemius, Inc.
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
* @since 2.12.2
*/

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Class FS_Hook_Snapshot
*
* This class allows you to take a snapshot of the current actions attached to a WordPress hook, remove them, and restore them later.
*/
class FS_Hook_Snapshot {

private $removed_actions = array();

/**
* Remove all actions from a given hook and store them for later restoration.
*/
public function remove( $hook ) {
global $wp_filter;

if ( ! empty( $wp_filter ) && isset( $wp_filter[ $hook ] ) ) {
$this->removed_actions[ $hook ] = $wp_filter[ $hook ];
unset( $wp_filter[ $hook ] );
}
}

/**
* Restore previously removed actions for a given hook.
*/
public function restore( $hook ) {
global $wp_filter;

if ( ! empty( $wp_filter ) && isset( $this->removed_actions[ $hook ] ) ) {
$wp_filter[ $hook ] = $this->removed_actions[ $hook ];
unset( $this->removed_actions[ $hook ] );
}
}
}
6 changes: 6 additions & 0 deletions includes/entities/class-fs-plugin-plan.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ class FS_Plugin_Plan extends FS_Entity {
* @var string Support phone.
*/
public $support_phone;
/**
* @var string Support skype username.
*
* @deprecated 2.12.1
*/
public $support_skype = '';
/**
* @var bool Is personal success manager supported with the plan.
*/
Expand Down
Binary file modified languages/freemius-cs_CZ.mo
Binary file not shown.
Loading