Skip to content

Commit 89ed671

Browse files
chore: updated freemius sdk
1 parent ad5cfd9 commit 89ed671

19 files changed

+385
-281
lines changed

freemius/assets/css/admin/account.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

freemius/includes/class-freemius.php

Lines changed: 48 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8839,8 +8839,13 @@ private function get_plugins_data_for_api() {
88398839
isset( $site_active_plugins[ $basename ] )
88408840
) {
88418841
// Plugin was site level activated.
8842-
$site_active_plugins_cache->plugins[ $basename ] = $network_plugins[ $basename ];
8843-
$site_active_plugins_cache->plugins[ $basename ]['is_active'] = true;
8842+
$site_active_plugins_cache->plugins[ $basename ] = array(
8843+
'slug' => $network_plugins[ $basename ]['slug'],
8844+
'version' => $network_plugins[ $basename ]['Version'],
8845+
'title' => $network_plugins[ $basename ]['Name'],
8846+
'is_active' => $is_active,
8847+
'is_uninstalled' => false,
8848+
);
88448849
} else if ( isset( $site_active_plugins_cache->plugins[ $basename ] ) &&
88458850
! isset( $site_active_plugins[ $basename ] )
88468851
) {
@@ -15777,6 +15782,10 @@ static function get_sites_blog_ids( $sites ) {
1577715782
function get_site_info( $site = null, $load_registration = false ) {
1577815783
$this->_logger->entrance();
1577915784

15785+
$fs_hook_snapshot = new FS_Hook_Snapshot();
15786+
// Remove all filters from `switch_blog`.
15787+
$fs_hook_snapshot->remove( 'switch_blog' );
15788+
1578015789
$switched = false;
1578115790

1578215791
$registration_date = null;
@@ -15836,6 +15845,9 @@ function get_site_info( $site = null, $load_registration = false ) {
1583615845
restore_current_blog();
1583715846
}
1583815847

15848+
// Add the filters back to `switch_blog`.
15849+
$fs_hook_snapshot->restore( 'switch_blog' );
15850+
1583915851
return $info;
1584015852
}
1584115853

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

23508-
$result = $api->get( 'pricing.json?' . http_build_query( $params ) );
23520+
$result = $api->get( $this->add_show_pending( 'pricing.json?' . http_build_query( $params ) ) );
2350923521
break;
2351023522
case 'start_trial':
2351123523
$trial_plan_id = fs_request_get( 'plan_id' );
@@ -24686,23 +24698,39 @@ private function get_complete_upgrade_instructions( $plan_title = '' ) {
2468624698
$this->get_premium_slug() :
2468724699
$this->premium_plugin_basename();
2468824700

24689-
return sprintf(
24690-
/* translators: %1$s: Product title; %2$s: Plan title */
24691-
$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' ),
24692-
sprintf( '<em>%s</em>', esc_html( $this->get_plugin_title() ) ),
24693-
$plan_title,
24694-
sprintf(
24695-
'<a style="margin-left: 10px;" href="%s"><button class="button button-primary">%s</button></a>',
24696-
( $this->is_theme() ?
24697-
wp_nonce_url( 'themes.php?action=activate&amp;stylesheet=' . $premium_theme_slug_or_plugin_basename, 'switch-theme_' . $premium_theme_slug_or_plugin_basename ) :
24698-
wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $premium_theme_slug_or_plugin_basename, 'activate-plugin_' . $premium_theme_slug_or_plugin_basename ) ),
24699-
esc_html( sprintf(
24700-
/* translators: %s: Plan title */
24701-
$this->get_text_inline( 'Activate %s features', 'activate-x-features' ),
24702-
$plan_title
24703-
) )
24704-
)
24705-
);
24701+
if ( is_admin() ) {
24702+
return sprintf(
24703+
/* translators: %1$s: Product title; %2$s: Plan title */
24704+
$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' ),
24705+
sprintf( '<em>%s</em>', esc_html( $this->get_plugin_title() ) ),
24706+
$plan_title,
24707+
sprintf(
24708+
'<a style="margin-left: 10px;" href="%s"><button class="button button-primary">%s</button></a>',
24709+
( $this->is_theme() ?
24710+
wp_nonce_url( 'themes.php?action=activate&amp;stylesheet=' . $premium_theme_slug_or_plugin_basename, 'switch-theme_' . $premium_theme_slug_or_plugin_basename ) :
24711+
wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $premium_theme_slug_or_plugin_basename, 'activate-plugin_' . $premium_theme_slug_or_plugin_basename ) ),
24712+
esc_html( sprintf(
24713+
/* translators: %s: Plan title */
24714+
$this->get_text_inline( 'Activate %s features', 'activate-x-features' ),
24715+
$plan_title
24716+
) )
24717+
)
24718+
);
24719+
} else {
24720+
return sprintf(
24721+
/* translators: %1$s: Product title; %3$s: Plan title */
24722+
$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' ),
24723+
sprintf( '<em>%s</em>', esc_html( $this->get_plugin_title() ) ),
24724+
sprintf(
24725+
'<a href="%s">%s</a>',
24726+
admin_url( $this->is_theme() ? 'themes.php' : 'plugins.php' ),
24727+
( $this->is_theme() ?
24728+
$this->get_text_inline( 'Themes page', 'themes-page' ) :
24729+
$this->get_text_inline( 'Plugins page', 'plugins-page' ) )
24730+
),
24731+
$plan_title
24732+
);
24733+
}
2470624734
} else {
2470724735
// @since 1.2.1.5 The free version is auto deactivated.
2470824736
$deactivation_step = version_compare( $this->version, '1.2.1.5', '<' ) ?
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
/**
3+
* @package Freemius
4+
* @copyright Copyright (c) 2025, Freemius, Inc.
5+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6+
* @since 2.12.2
7+
*/
8+
9+
if ( ! defined( 'ABSPATH' ) ) {
10+
exit;
11+
}
12+
13+
/**
14+
* Class FS_Hook_Snapshot
15+
*
16+
* This class allows you to take a snapshot of the current actions attached to a WordPress hook, remove them, and restore them later.
17+
*/
18+
class FS_Hook_Snapshot {
19+
20+
private $removed_actions = array();
21+
22+
/**
23+
* Remove all actions from a given hook and store them for later restoration.
24+
*/
25+
public function remove( $hook ) {
26+
global $wp_filter;
27+
28+
if ( ! empty( $wp_filter ) && isset( $wp_filter[ $hook ] ) ) {
29+
$this->removed_actions[ $hook ] = $wp_filter[ $hook ];
30+
unset( $wp_filter[ $hook ] );
31+
}
32+
}
33+
34+
/**
35+
* Restore previously removed actions for a given hook.
36+
*/
37+
public function restore( $hook ) {
38+
global $wp_filter;
39+
40+
if ( ! empty( $wp_filter ) && isset( $this->removed_actions[ $hook ] ) ) {
41+
$wp_filter[ $hook ] = $this->removed_actions[ $hook ];
42+
unset( $this->removed_actions[ $hook ] );
43+
}
44+
}
45+
}

freemius/includes/entities/class-fs-plugin-plan.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ class FS_Plugin_Plan extends FS_Entity {
7575
* @var string Support phone.
7676
*/
7777
public $support_phone;
78+
/**
79+
* @var string Support skype username.
80+
*
81+
* @deprecated 2.12.1
82+
*/
83+
public $support_skype = '';
7884
/**
7985
* @var bool Is personal success manager supported with the plan.
8086
*/
-229 Bytes
Binary file not shown.
-328 Bytes
Binary file not shown.
-263 Bytes
Binary file not shown.
247 Bytes
Binary file not shown.
-254 Bytes
Binary file not shown.
-256 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)