Skip to content

Commit 2f30005

Browse files
committed
chore: updated freemius SDK version
1 parent 5d2c7b5 commit 2f30005

14 files changed

Lines changed: 64 additions & 24 deletions

freemius/assets/js/pricing/freemius-pricing.js

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: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6558,10 +6558,7 @@ private function maybe_schedule_sync_cron() {
65586558
$next_schedule = $this->next_sync_cron();
65596559

65606560
// The event is properly scheduled, so no need to reschedule it.
6561-
if (
6562-
is_numeric( $next_schedule ) &&
6563-
$next_schedule > time()
6564-
) {
6561+
if ( is_numeric( $next_schedule ) ) {
65656562
return;
65666563
}
65676564

@@ -7098,7 +7095,6 @@ private function add_sticky_optin_admin_notice() {
70987095
*/
70997096
function _enqueue_connect_essentials() {
71007097
wp_enqueue_script( 'jquery' );
7101-
wp_enqueue_script( 'json2' );
71027098

71037099
fs_enqueue_local_script( 'postmessage', 'nojquery.ba-postmessage.js' );
71047100
fs_enqueue_local_script( 'fs-postmessage', 'postmessage.js' );
@@ -17436,7 +17432,7 @@ function setup_network_account(
1743617432
FS_User_Lock::instance()->unlock();
1743717433
}
1743817434

17439-
if ( 1 < count( $installs ) ) {
17435+
if ( 1 < count( $installs ) || fs_is_network_admin() ) {
1744017436
// Only network level opt-in can have more than one install.
1744117437
$is_network_level_opt_in = true;
1744217438
}

freemius/includes/class-fs-plugin-updater.php

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,32 @@ function pre_set_site_transient_update_plugins_filter( $transient_data ) {
540540
return $transient_data;
541541
}
542542

543+
// Alias.
544+
$basename = $this->_fs->premium_plugin_basename();
545+
543546
global $wp_current_filter;
544547

545-
if ( ! empty( $wp_current_filter ) && in_array( 'upgrader_process_complete', $wp_current_filter ) ) {
548+
/**
549+
* During bulk updates, avoid re-injecting update data for the plugin itself once it has already been updated.
550+
*
551+
* If the custom package is re-added to the transient after the plugin update, WordPress may detect the package again and incorrectly report "The plugin is at the latest version" for a pending update, since the custom package version matches the currently installed version.
552+
*
553+
* Behavior differs depending on how the bulk update is triggered. Please refer to the inline comments for each flow below for details.
554+
*/
555+
if (
556+
! empty( $wp_current_filter ) && (
557+
/**
558+
* update-core.php and other upgrader pages:
559+
* The `upgrader_process_complete` action fires only once after all updates have finished. In this case, it is the current action (`$wp_current_filter[0]`), while `self::$_upgrade_basename` may contain any plugin basename.
560+
*/
561+
'upgrader_process_complete' === $wp_current_filter[0] ||
562+
/**
563+
* AJAX bulk updates (e.g., from the Plugins page):
564+
* The `upgrader_process_complete` action fires multiple times — once for each plugin after it finishes updating. In this flow, it is not the current action (`$wp_current_filter[0]`) because it is triggered from another action. Instead, we compare `self::$_upgrade_basename` with the basename of the plugin currently being updated, since the `upgrader_process_complete` action runs separately for each plugin.
565+
*/
566+
( in_array( 'upgrader_process_complete', $wp_current_filter ) && self::$_upgrade_basename === $basename )
567+
)
568+
) {
546569
return $transient_data;
547570
}
548571

@@ -566,9 +589,6 @@ function pre_set_site_transient_update_plugins_filter( $transient_data ) {
566589
}
567590
}
568591

569-
// Alias.
570-
$basename = $this->_fs->premium_plugin_basename();
571-
572592
if ( is_object( $this->_update_details ) ) {
573593
if ( isset( $transient_data->no_update ) ) {
574594
unset( $transient_data->no_update[ $basename ] );

freemius/includes/fs-essential-functions.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
1111
* @since 1.1.5
1212
*/
13+
if ( ! defined( 'ABSPATH' ) ) {
14+
exit;
15+
}
1316

1417
if ( ! function_exists( 'fs_normalize_path' ) ) {
1518
if ( function_exists( 'wp_normalize_path' ) ) {

freemius/includes/managers/class-fs-contact-form-manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function get_standalone_link( Freemius $fs ) {
7777
$query_params = $this->get_query_params( $fs );
7878

7979
$query_params['is_standalone'] = 'true';
80-
$query_params['parent_url'] = admin_url( add_query_arg( null, null ) );
80+
$query_params['parent_url'] = admin_url( add_query_arg( '', '' ) );
8181

8282
return WP_FS__ADDRESS . '/contact/?' . http_build_query( $query_params );
8383
}

freemius/includes/managers/class-fs-debug-manager.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
* @package Freemius
77
* @since 2.6.2
88
*/
9+
if ( ! defined( 'ABSPATH' ) ) {
10+
exit;
11+
}
912

1013
class FS_DebugManager {
1114

freemius/start.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
* @var string
1717
*/
18-
$this_sdk_version = '2.13.0';
18+
$this_sdk_version = '2.13.1';
1919

2020
#region SDK Selection Logic --------------------------------------------------------------------
2121

freemius/templates/account.php

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@
252252
$available_license_paid_plan = is_object( $available_license ) ?
253253
$fs->_get_plan_by_id( $available_license->plan_id ) :
254254
null;
255+
256+
$is_dev_mode = ( defined( 'WP_FS__DEV_MODE' ) && WP_FS__DEV_MODE );
255257
?>
256258
<div class="wrap fs-section">
257259
<?php if ( ! $has_tabs && ! $fs->apply_filters( 'hide_account_tabs', false ) ) : ?>
@@ -787,7 +789,7 @@ class="fs-tag fs-<?php echo $fs->can_use_premium_code() ? 'success' : 'warn' ?>"
787789
<th><?php echo esc_html( $plan_text ) ?></th>
788790
<th><?php fs_esc_html_echo_x_inline( 'License', 'as software license', 'license', $slug ) ?></th>
789791
<th></th>
790-
<?php if ( defined( 'WP_FS__DEV_MODE' ) && WP_FS__DEV_MODE ) : ?>
792+
<?php if ( $is_dev_mode ) : ?>
791793
<th></th>
792794
<?php endif ?>
793795
</tr>
@@ -853,10 +855,20 @@ class="fs-tag fs-<?php echo $fs->can_use_premium_code() ? 'success' : 'warn' ?>"
853855
'is_whitelabeled' => ( $is_whitelabeled && ! $is_data_debug_mode )
854856
);
855857

856-
fs_require_template(
857-
'account/partials/addon.php',
858-
$addon_view_params
859-
);
858+
if ( ! empty($addon_view_params['addon_info'] ) ) {
859+
fs_require_template(
860+
'account/partials/addon.php',
861+
$addon_view_params
862+
);
863+
} else {
864+
// If we are here it means there is an activation of an unreleased add-on and yet the SDK is not in development mode.
865+
echo '<tr>';
866+
echo '<td style="text-align: right;">' . esc_html( $addon_id ) . '</td>';
867+
echo '<td colspan="' . ( $is_dev_mode ? 6 : 5 ) . '" style="text-align: left;">';
868+
echo 'The add-on you have activated is no longer <a href="https://freemius.com/help/documentation/wordpress/selling-add-ons-extensions/#preparing-the-add-on-for-sale" rel="noreferrer noopener" target="_blank">listed</a> by the product owner, or the SDK is not running in <a href="https://freemius.com/help/documentation/wordpress-sdk/testing/" rel="noreferrer noopener" target="_blank">test mode</a>. Please <a href="' . esc_url( $fs->contact_url() ) . '">contact support</a> if you need further assistance.';
869+
echo '</td>';
870+
echo '</tr>';
871+
}
860872

861873
$odd = ! $odd;
862874
} ?>

freemius/templates/checkout.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
66
* @since 2.9.0
77
*/
8-
8+
if ( ! defined( 'ABSPATH' ) ) {
9+
exit;
10+
}
911
/**
1012
* @var array $VARS
1113
* @var Freemius $fs

freemius/templates/checkout/frame.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
}
3636

3737
wp_enqueue_script( 'jquery' );
38-
wp_enqueue_script( 'json2' );
3938
fs_enqueue_local_script( 'postmessage', 'nojquery.ba-postmessage.js' );
4039
fs_enqueue_local_script( 'fs-postmessage', 'postmessage.js' );
4140
fs_enqueue_local_script( 'fs-form', 'jquery.form.js', array( 'jquery' ) );

0 commit comments

Comments
 (0)