Skip to content

Commit

Permalink
[updater] Prevent handling updates right after post-upgrade processing.
Browse files Browse the repository at this point in the history
  • Loading branch information
fajardoleo committed Dec 17, 2024
1 parent 7f58ad3 commit 9a37d01
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
20 changes: 2 additions & 18 deletions includes/class-fs-plugin-updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -542,24 +542,8 @@ function pre_set_site_transient_update_plugins_filter( $transient_data ) {

global $wp_current_filter;

$current_plugin_version = $this->_fs->get_plugin_version();

if ( ! empty( $wp_current_filter ) && 'upgrader_process_complete' === $wp_current_filter[0] ) {
if (
is_null( $this->_update_details ) ||
( is_object( $this->_update_details ) && $this->_update_details->new_version !== $current_plugin_version )
) {
/**
* After an update, clear the stored update details and reparse the plugin's main file in order to get
* the updated version's information and prevent the previous update information from showing up on the
* updates page.
*
* @author Leo Fajardo (@leorw)
* @since 2.3.1
*/
$this->_update_details = null;
$current_plugin_version = $this->_fs->get_plugin_version( true );
}
return $transient_data;
}

if ( ! isset( $this->_update_details ) ) {
Expand All @@ -568,7 +552,7 @@ function pre_set_site_transient_update_plugins_filter( $transient_data ) {
false,
fs_request_get_bool( 'force-check' ),
FS_Plugin_Updater::UPDATES_CHECK_CACHE_EXPIRATION,
$current_plugin_version
$this->_fs->get_plugin_version()
);

$this->_update_details = false;
Expand Down
8 changes: 7 additions & 1 deletion includes/managers/class-fs-admin-notice-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,14 @@ function dismiss_notice_ajax_callback() {
* @since 1.0.7
*/
static function _add_sticky_dismiss_javascript() {
$sticky_admin_notice_js_template_name = 'sticky-admin-notice-js.php';

if ( ! file_exists( fs_get_template_path( $sticky_admin_notice_js_template_name ) ) ) {
return;
}

$params = array();
fs_require_once_template( 'sticky-admin-notice-js.php', $params );
fs_require_once_template( $sticky_admin_notice_js_template_name, $params );
}

private static $_added_sticky_javascript = false;
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.10.1.1';
$this_sdk_version = '2.10.1.2';

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

Expand Down

0 comments on commit 9a37d01

Please sign in to comment.