WordPress.org

Make WordPress Core

Opened 8 weeks ago

Last modified 3 days ago

#50774 assigned enhancement

include version updated FROM in plugin/theme auto-updates emails

Reported by: pbiron Owned by: audrasjb
Milestone: 5.6 Priority: normal
Severity: normal Version: 5.5
Component: Upgrade/Install Keywords: has-patch needs-testing
Focuses: Cc:

Description

This is a followup to #50350.

In 5.5, when a plugin/theme successfully auto-updates, an email is sent to the site admin listing the plugins/themes and the versions they were updated TO.

The versions they updated FROM would be very helpful, in case admins realize that the update (although successful) causes compatibility problems (with other plugins, etc) and they need to rollback to the previous version (many admins probably won't remember what version they were running).

Unfortunately, by the time the email is generated the version updated FROM is no longer available.

5.6 should refactor the WP_Automatic_Updater so that the version updated FROM is available when the emails are generated.

Attachments (4)

50774.diff (3.1 KB) - added by dkotter 3 weeks ago.
Screen Shot 2020-08-27 at 4.36.40 PM.png (89.6 KB) - added by dkotter 3 weeks ago.
Email notification received during tests
50774.1.diff (3.3 KB) - added by audrasjb 9 days ago.
Upgrade/install: Include version updated from in plugin and theme auto-updates email notifications
50774.2.diff (3.7 KB) - added by pbiron 8 days ago.

Download all attachments as: .zip

Change History (16)

#1 @SergeyBiryukov
8 weeks ago

  • Milestone changed from Awaiting Review to 5.6

@dkotter
3 weeks ago

#2 @dkotter
3 weeks ago

I've uploaded a patch that adds the current plugin and/or theme version to the data that is used when handling auto updates. This current version is then used in the update/failed email for plugins and themes. Current language for this is - plugin/theme (from CURRENT_VERSION to NEW_VERSION).

Happy to update that message if there's something else that makes more sense.

@dkotter
3 weeks ago

Email notification received during tests

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


2 weeks ago

#4 @pbiron
2 weeks ago

  • Keywords has-patch needs-testing added

This ticket was mentioned in Slack in #core-auto-updates by audrasjb. View the logs.


10 days ago

#6 @johnbillion
10 days ago

  • Version set to 5.5

@audrasjb
9 days ago

Upgrade/install: Include version updated from in plugin and theme auto-updates email notifications

#7 @audrasjb
9 days ago

  • Owner set to audrasjb
  • Status changed from new to assigned

In 50774.1.diff, I made the "N/A" strings translatable as it may changes from one Locale to another. I contextualized those strings just in case translations would be different in some languages.

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


8 days ago

#9 follow-up: @Presskopp
8 days ago

just to mention, I wanted to have this from the beginning, but it was neglegted. Can't remember who said what, but it happened on slack.

#10 in reply to: ↑ 9 @pbiron
8 days ago

I've done some initial testing of 50774.1.diff. It seems to work as expected for plugins hosted in the .org repo.

However, for externally hosted plugins, depending on how the update information is injected into the site transient, the current version may still not be available when the email notifications are sent.

For example, if a plugin hooks into pre_set_site_transient_update_plugins or site_transient_update_plugins to inject their info into $transient->response then current_version will not be set.

With that patch, the only way current_version will be set (to other than "N/A") is if one of the low-level Requests hooks (e.g., http_response) is used to inject the update info...and using those hooks to inject update info for externally hosted plugins is very uncommon in my experience.

I've got a couple of different ideas of how to remedy this, will investigate and upload a revised patch when I've done that.

p.s. all of the above applies to externally hosted themes as well.

@pbiron
8 days ago

#11 @pbiron
8 days ago

50774.2.diff addresses the problem mentioned in comment:10 by setting the current version in WP_Automatic_Updater::update(), rather than trying set in the transient. It also uses "Unknown" as the string if the current version can't be determined, instead of "N/A".

I'm not 100% sold on how the version information appears in the email text, but functionally this works for plugins and themes, whether they are in the .org repo or externally hosted.

This ticket was mentioned in Slack in #core-auto-updates by pbiron. View the logs.


3 days ago

Note: See TracTickets for help on using tickets.