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
28 changes: 24 additions & 4 deletions includes/class-fs-plugin-updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -540,9 +540,32 @@ function pre_set_site_transient_update_plugins_filter( $transient_data ) {
return $transient_data;
}

// Alias.
$basename = $this->_fs->premium_plugin_basename();

global $wp_current_filter;

if ( ! empty( $wp_current_filter ) && in_array( 'upgrader_process_complete', $wp_current_filter ) ) {
/**
* During bulk updates, avoid re-injecting update data for the plugin itself once it has already been updated.
*
* 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.
*
* Behavior differs depending on how the bulk update is triggered. Please refer to the inline comments for each flow below for details.
*/
if (
! empty( $wp_current_filter ) && (
/**
* update-core.php and other upgrader pages:
* 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.
*/
'upgrader_process_complete' === $wp_current_filter[0] ||
/**
* AJAX bulk updates (e.g., from the Plugins page):
* 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.
*/
( in_array( 'upgrader_process_complete', $wp_current_filter ) && self::$_upgrade_basename === $basename )
)
) {
return $transient_data;
}

Expand All @@ -566,9 +589,6 @@ function pre_set_site_transient_update_plugins_filter( $transient_data ) {
}
}

// Alias.
$basename = $this->_fs->premium_plugin_basename();

if ( is_object( $this->_update_details ) ) {
if ( isset( $transient_data->no_update ) ) {
unset( $transient_data->no_update[ $basename ] );
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.13.0.5';
$this_sdk_version = '2.13.0.6';

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

Expand Down
Loading