Opened 4 weeks ago
Last modified 13 days ago
#66075 new enhancement
Name the item, or give a count, in the plugin/theme auto-update email subject lines
| Reported by: | JosVelasco | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Upgrade/Install | Version: | |
| Severity: | minor | Keywords: | has-patch needs-testing has-unit-tests |
| Cc: | Focuses: | administration, template, ui-copy |
Description
Follow-up of #50268, where the current subject lines were introduced in 5.5.
The subject line of the plugin/theme auto-update email is the same regardless of how many items were updated, and never says which ones. Plugins release independently of one another, so a run that has anything to do usually has a single plugin to do it for. Among the 100 most popular plugins in the directory, the median gap between releases is around 50 days, and their most recent releases fall on 40 different days. The update check runs twice a day. So the site admin sees, over and over:
[My Site] Some plugins were automatically updated
for a body that reads:
These plugins are now up to date: - Jetpack (from version 16.1.2 to 16.1.3) : https://wordpress.org/plugins/jetpack/
The subject carries none of the information the admin actually wants, so every one of these emails has to be opened before it can be triaged or filed. Someone running a handful of sites receives a stream of identical subjects and has no way to tell, from the inbox, which one is worth a look.
Proposal
When a single item of a single type was updated, name it in the subject. Otherwise, give a count instead of the word "Some".
So the two most common emails become:
[My Site] Jetpack was automatically updated [My Site] 3 plugins were automatically updated
Plugin and theme names are not bounded in length, and some run well past what a mail client shows. A name that long should be truncated before it goes in the subject, around 40 characters with an ellipsis.
Success emails (subject built from $successful_updates):
| Case | Current | Proposed |
| 1 plugin | [%s] Some plugins were automatically updated | [%1$s] %2$s was automatically updated
|
| N plugins | [%s] Some plugins were automatically updated | [%1$s] %2$d plugins were automatically updated
|
| 1 theme | [%s] Some themes were automatically updated | [%1$s] %2$s was automatically updated
|
| N themes | [%s] Some themes were automatically updated | [%1$s] %2$d themes were automatically updated
|
| plugins + themes | [%s] Some plugins and themes have automatically updated | [%1$s] %2$d plugins and %3$d themes were automatically updated
|
Failure and mixed emails (subject built from $failed_updates, as it is today):
| Case | Current | Proposed |
| 1 plugin | [%s] Some plugins have failed to update | [%1$s] %2$s failed to update
|
| N plugins | [%s] Some plugins have failed to update | [%1$s] %2$d plugins have failed to update
|
| 1 theme | [%s] Some themes have failed to update | [%1$s] %2$s failed to update
|
| N themes | [%s] Some themes have failed to update | [%1$s] %2$d themes have failed to update
|
| plugins + themes | [%s] Some plugins and themes have failed to update | [%1$s] %2$d plugins and %3$d themes have failed to update
|
The email body is unchanged in every case.
Sites can already do all of this through the auto_plugin_theme_update_email filter, but the default is what the great majority of admins actually receive, and the information is right there when the subject is built.
Attachments (2)
Change History (10)
#3
@
4 weeks ago
- Focuses template added
- Keywords has-patch needs-testing needs-unit-tests added; needs-copy-review needs-patch removed
Improve plugin and theme auto-update email subjects
See #66075.
#4
@
3 weeks ago
Weighing in since needs-copy-review is tagged.
Naming the plugin or giving a count is the right fix. Site admins managing multiple WordPress installs get the same subject line every time an update runs — there's no way to triage from the inbox without opening each email. This change fixes that.
A few specific points on the copy:
Truncation threshold. "Around 40 characters" needs to be a firm number. Most mobile email clients show 30-40 characters in preview before cutting off. 35 characters with a hard ellipsis gives consistent behaviour across clients.
"was automatically updated" is correct — simple past, direct, no changes needed there.
The failure subject is intentionally more alarming, and that's appropriate. Jetpack failed to update reads more urgent than Some plugins have failed to update. Admins need to act on failure emails, and the subject should signal that.
The mixed case needs a closer look. 3 plugins and 2 themes were automatically updated gets long fast, especially once a site name is prepended. A combined count — 5 items were automatically updated — is shorter and easier to scan. The breakdown is already in the email body.
#5
@
2 weeks ago
Thanks, @rednishat, for your feedback.
I agree we should define the truncation threshold so it’s easier to adjust it if needed.
I think we could simplify the scope of this by leaving the mixed cases for a future round so things don’t get complicated.
What do you think, @yasirkhalifa?
This ticket was mentioned in PR #13658 on WordPress/wordpress-develop by @faisalahammad.
2 weeks ago
#6
- Keywords has-unit-tests added; needs-unit-tests removed
https://core.trac.wordpress.org/ticket/66075
The auto-update email subject does not change with what was updated and never
names anything. A site admin running a few installs gets the same subject again
and again and has to open every message before they can tell which one is worth
a look. The body already says what changed, so the subject can say it too.
When a single plugin or theme is updated, the subject now names it. When more
than one of the same type is updated, the subject gives the count in place of
the word "Some". Names longer than 35 characters are truncated with an
ellipsis, so a long plugin or theme name cannot crowd out the site name in a
mail client preview. The failure subjects follow the same shape and keep their
sharper wording, since those emails ask the admin to act.
Scope:
- In scope: the success, failure, and mixed subjects for a single item type, for both plugins and themes.
- Out of scope: a run that updated both plugins and themes still uses the existing "Some plugins and themes..." subject. The copy review suggested a combined item count there, and the reporter asked to leave the mixed rows for a follow-up so this change stays small. That can build on this patch.
- The email body is unchanged, as is the auto_plugin_theme_update_email filter and the arguments it receives.
Testing:
- npx wp-env run phpunit -- --filter wpAutomaticUpdater
- npx wp-env run phpunit -- --filter test_send_plugin_theme_email_subjects The new data provider covers one and several plugins, one and several themes, success and failure, a name past the 35 character cut, a short name that is left alone, and a single update with no name, which falls back to the count subject.
- To see it by hand, install two plugins with an update pending, run the update check, and confirm the subject names the single update and counts the batch. No visual or RTL change, since only the subject text moves.
Props josvelasco, yasirkhalifa, rednishat.
#7
@
2 weeks ago
Attached patch implements the proposed plugin/theme auto-update email subject improvements and includes unit-test coverage.
The patch uses the item name for a single update, count-based subjects for multiple updates, and builds mixed-result subjects from the failed items. Subject names are entity-decoded, invalid UTF-8 is scrubbed, and long names are limited to 40 Unicode code points with an ellipsis.
Validation on PHP 8.4 completed successfully:
- name-preparation coverage: 7 tests / 7 assertions
- final-subject coverage: 9 tests / 9 assertions
Tests_Admin_WpAutomaticUpdater: 61 tests / 86 assertions- 0 errors, 0 failures, 0 skips
AI assistance disclosure: ChatGPT (GPT-5.6 Sol) was used for implementation/test-development assistance, validation scripting, and review. I reviewed the resulting changes and test results and take responsibility for the contribution.
This ticket was mentioned in PR #13761 on WordPress/wordpress-develop by @raulsalvat.
13 days ago
#8
Improves plugin and theme auto-update email subjects by naming the
individual plugin or theme when there is a single update, and using
counts when multiple items are updated or fail to update.
The change also prepares item names for use in mail subjects by
decoding entities, scrubbing invalid UTF-8, and safely truncating
long names.
PHPUnit coverage is included for success, failure, and mixed-update
subjects; single-item names and multiple-item counts; entity decoding;
Unicode handling; truncation; and final mail subjects.
Trac ticket: https://core.trac.wordpress.org/ticket/66075
Use of AI Tools
AI assistance: Yes
Tool(s): ChatGPT
Model(s): GPT-5.6 Sol
Used for: Investigation support, contribution workflow and validation
planning, review assistance, and drafting. The implementation, tests,
repository state, and submitted contribution were reviewed and
validated by me.
---
This Pull Request is for code review only. Please keep all other
discussion in the Trac ticket. Do not merge this Pull Request. See
GitHub Pull Requests for Code Review
in the Core Handbook for more details.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I'm just here to add 100 points.