WordPress.org

Make WordPress Core

Opened 4 months ago

Closed 5 weeks ago

Last modified 5 weeks ago

#50774 closed enhancement (fixed)

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 (6)

50774.diff (3.1 KB) - added by dkotter 3 months ago.
Screen Shot 2020-08-27 at 4.36.40 PM.png (89.6 KB) - added by dkotter 3 months ago.
Email notification received during tests
50774.1.diff (3.3 KB) - added by audrasjb 3 months ago.
Upgrade/install: Include version updated from in plugin and theme auto-updates email notifications
50774.2.diff (3.7 KB) - added by pbiron 3 months ago.
50774.3.diff (4.9 KB) - added by dkotter 6 weeks ago.
50774.4.diff (4.9 KB) - added by garrett-eclipse 6 weeks ago.
Minor refresh from code review to fix grammar of code comments.

Download all attachments as: .zip

Change History (28)

#1 @SergeyBiryukov
4 months ago

  • Milestone changed from Awaiting Review to 5.6

@dkotter
3 months ago

#2 @dkotter
3 months 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 months ago

Email notification received during tests

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


3 months ago

#4 @pbiron
3 months ago

  • Keywords has-patch needs-testing added

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


3 months ago

#6 @johnbillion
3 months ago

  • Version set to 5.5

@audrasjb
3 months ago

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

#7 @audrasjb
3 months 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.


3 months ago

#9 follow-up: @Presskopp
3 months 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
3 months 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
3 months ago

#11 @pbiron
3 months 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.


2 months ago

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


2 months ago

#14 @jorbin
2 months ago

I'm not sure there is much value in unknown being the old version. It feels like it will be of little value, and in that case we might be best keeping the existing string. It keeps the message simple and direct.

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


8 weeks ago

@dkotter
6 weeks ago

#16 @dkotter
6 weeks ago

50774.3.diff addresses the latest concerns, where if we can't determine the old version number, instead of using the value Unknown, we keep the message the same as it currently is

@garrett-eclipse
6 weeks ago

Minor refresh from code review to fix grammar of code comments.

#17 @garrett-eclipse
6 weeks ago

I made a minor refresh of @dkotter latest patch in 50774.4.diff just to update the two comments for grammar. In the below two code comments just changes the to that;

Add the current version so the it can be reported in the notification email.
Add the current version so the it can be reported in the notification email.

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


6 weeks ago

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


6 weeks ago

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


5 weeks ago

#21 @helen
5 weeks ago

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

In 49242:

Upgrade/Install: Include "from" version for plugins/themes in email.

This can help with chasing down any issues that may arise and rolling back if necessary. We hope it's not, but it might be.

Props dkotter, garrett-eclipse, pbiron, audrasjb.
Fixes #50774.

#22 @SergeyBiryukov
5 weeks ago

In 49249:

Coding Standards: Fix WPCS issues in [49242].

See #50774.

Note: See TracTickets for help on using tickets.