Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#25841 closed enhancement (fixed)

Action to occur after Automatic Updates have finished

Reported by: pento Owned by: dd32
Priority: normal Milestone: 3.8
Component: Upgrade/Install Version: 3.7
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

After an automatic update finishes, it'd be good to have an action trigger.

I see it being particularly useful for site owners who'd like to run some automated tests after the update, to ensure everything is running properly.

Attachments (2)

25841.diff​ (650 bytes ) - added by pento 13 years ago.
25841.2.diff​ (649 bytes ) - added by pento 13 years ago.

Download all attachments as: .zip

Change History (10)

#1 @pento
13 years ago

Another use: Automatic Updates doesn't send emails for plugin/theme updates (unless you have debug emails enabled). It'd be good to be able to send emails for them, too.

#2 @SergeyBiryukov
13 years ago

$update_results should probably be marked as array rather than mixed.

#3 @pento
13 years ago

On second thoughts, yes. It's an array of arrays of mixed, it's probably saner to go with the first level.

#4 @dd32
13 years ago

  • Owner set to dd32
  • Resolution → fixed
  • Status new → closed

In 26155:

Background Updates: Add a 'automatic_updates_complete' hook that fires after any updates have run. Props pento. Fixes #25841

#5 @nacin
13 years ago

  • Resolution fixed
  • Status closed → reopened

I could go either way on this, but — should this hook fire only when there are update results? If there is nothing to update, and there was never actually an update performed, then "complete" is kind of ambiguous.

The filter description is perfect for what [26155] adds, but firing this hook every 12 hours is probably not very intuitive. Maybe move it to within the ! empty( $this->update_results ) branch above it that sends the debug email.

#6 @dd32
13 years ago

I can go either way on it as well. On one hand I felt like it should go into the if statement, on the other it seemed like it's correct in saying the auto update stuff has completed.

Perhaps we should just put it in the if after all.

#7 @nacin
13 years ago

If someone really wanted to catch every auto update attempt, they could always hook into wp_maybe_auto_update at priority > 10. A simple is_disabled() check in a callback there will cover the major case where the hook in [26155] would not fire (another is not receiving the lock). Ultimately I just doubt it is a compelling hook when it always fires.

#8 @dd32
13 years ago

  • Resolution → fixed
  • Status reopened → closed

In 26164:

Bacground Updates: Move the 'automatic_updates_complete' hook to only fire when some updates have actually been completed. Props nacin. Fixes #25841

Note: See TracTickets for help on using tickets.