WordPress.org

Make WordPress Core

Opened 4 months ago

Closed 4 months ago

Last modified 4 months ago

#43235 closed defect (bug) (fixed)

WP Automatic Updates broken 4.9.3

Reported by: paultgoodchild Owned by: dd32
Milestone: 4.9.4 Priority: normal
Severity: normal Version: 4.9.3
Component: Upgrade/Install Keywords:
Focuses: Cc:

Description

It seems that a somewhat innocuous quick addition to 4.9.3 has broken WP automatic updates for anything except the WordPress core.

How?

wp-includes/update.php the following code has been added:

<?php
        // Trigger background updates if running non-interactively, and we weren't called from the update handler.
        if ( $doing_cron && $has_auto_update && ! doing_action( 'wp_maybe_auto_update' ) ) {
                include_once( ABSPATH . '/wp-admin/includes/update.php' );

                // Only trigger background updates if an acceptable autoupdate is on offer, avoids needless extra API calls.
                if ( find_core_auto_update() ) {
                        do_action( 'wp_maybe_auto_update' );
                }
        }

This is plainly wrong, since you're saying: "Only fire automatic updates if there are available WP core updates"

What about plugins and themes?

Solution is to remove the following check and revert it back to a pre-4.9.3 state.

<?php
                if ( find_core_auto_update() ) { ...

Change History (3)

#1 @dd32
4 months ago

  • Milestone changed from Awaiting Review to 4.9.4
  • Owner set to dd32
  • Status changed from new to accepted

The affected code has started to be reverted with [42653] in #43103.

#2 @dd32
4 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 42654:

Updates: Partially revert [42584], as this branch of code should always be run after a core update check.

This code branch is responsible for running all autoupdates, including plugins and themes - which should run regardless of if there's a core autoupdate available.

This revert does not revert the $timeout changes, as these should still use cached data if it's available.
Ideally this should be decoupled from the core update check to allow background updates to operate even when the core update check is disabled or running more often than twice daily.

Merges [42653] to the 4.9 branch.
Fixes #43103, #43235.

#3 @ocean90
4 months ago

#43247 was marked as a duplicate.

Note: See TracTickets for help on using tickets.