WordPress.org

Make WordPress Core

Opened 5 weeks ago

Last modified 7 days ago

#49199 accepted feature request

Introduce Automatic Update opt-in setting for Themes

Reported by: audrasjb Owned by: audrasjb
Milestone: 5.5 Priority: normal
Severity: normal Version:
Component: Themes Keywords: dev-feedback has-screenshots has-patch needs-dev-note early
Focuses: administration, multisite Cc:
PR Number:

Description

Automatic Updates for core, plugins and themes are one of the key projects for 2019 (and now 2020).

This ticket aims to introduce Automatic Updates for Themes.

For reference, there is already a Trac ticket to introduce Plugins Autoupdates.

For the moment, the goal of this ticket is to introduce Themes Autoupdates as an on-demand/opt-in setting so WordPress admins could choose manually which themes they want to auto-update. They could also disable previously enabled autoupdates as well.

Related: #48850

Attachments (14)

1-theme-autoupdate-appearance-screen-activate.png (335.5 KB) - added by audrasjb 5 weeks ago.
Themes Screen: Activate autoupdate opt-in button
2-theme-autoupdate-appearance-screen-activated.png (386.9 KB) - added by audrasjb 5 weeks ago.
Themes Screen: Autoupdate activated notice
3-theme-autoupdate-appearance-screen-disable.png (645.8 KB) - added by audrasjb 5 weeks ago.
Themes Screen: Deactivate autoupdate button + information about the next scheduled update
4-theme-autoupdate-updatecore-screen-info.png (83.1 KB) - added by audrasjb 5 weeks ago.
Updates screen (update-core.php): Informations about eventual scheduled autoupdates for Themes
49199.diff (8.8 KB) - added by audrasjb 5 weeks ago.
First workaround: Autoupdate opt-in for Themes
49199.1.diff (9.0 KB) - added by xkon 4 weeks ago.
comment 8 feedback
49199.1_2_lines_on_updates.jpg (53.9 KB) - added by xkon 4 weeks ago.
splits info on 2 line in Updates Themes list
49199.1_theme_overlay_under_title_with_update.jpg (156.3 KB) - added by xkon 4 weeks ago.
Automatic update under title on theme_overlay
49199.1_theme_overlay_under_title_without_update.jpg (117.9 KB) - added by xkon 4 weeks ago.
49199.2.diff (9.1 KB) - added by audrasjb 4 weeks ago.
Multisite support
49199.3.diff (10.2 KB) - added by audrasjb 4 weeks ago.
Add constants and functions/filters to disable automatic updates UI and processes
Capture d’écran 2020-01-26 à 07.58.32.png (233.8 KB) - added by audrasjb 3 weeks ago.
TODO: implement the feature on Network Admin Themes screen
49199.4.diff.png (195.4 KB) - added by audrasjb 2 weeks ago.
49199.4.diff: add multisite support for Themes autoupdates.
49199.4.diff (17.6 KB) - added by audrasjb 2 weeks ago.
49199.4.diff: add multisite support for Themes autoupdates.

Change History (45)

@audrasjb
5 weeks ago

Themes Screen: Activate autoupdate opt-in button

@audrasjb
5 weeks ago

Themes Screen: Autoupdate activated notice

@audrasjb
5 weeks ago

Themes Screen: Deactivate autoupdate button + information about the next scheduled update

@audrasjb
5 weeks ago

Updates screen (update-core.php): Informations about eventual scheduled autoupdates for Themes

#1 @audrasjb
5 weeks ago

  • Keywords has-screenshots added; needs-screenshots removed

@audrasjb
5 weeks ago

First workaround: Autoupdate opt-in for Themes

#2 @audrasjb
5 weeks ago

  • Keywords has-patch added; needs-patch removed

49199.diff is a first workaround for this feature.

It’s an adaptation of my previous work on #48850, for themes.

#3 @audrasjb
5 weeks ago

Please note that with 49199.diff, automatic updates are triggered based on WordPress update/version check Cron.

To test this patch, you'll have to wait for the related cron task to happen (or to trigger it manually).

This ticket was mentioned in Slack in #design by karmatosed. View the logs.


5 weeks ago

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


5 weeks ago

#6 @audrasjb
4 weeks ago

  • Keywords needs-dev-note added

This ticket was mentioned in Slack in #design by karmatosed. View the logs.


4 weeks ago

#8 @karmatosed
4 weeks ago

  • Keywords needs-design-feedback removed

I'm going to dive in here and give some feedback. First, I think there's a lot could be done but thinking about a minimum to do and build up, makes a lot of sense with a feature being worked on the whole year.

On the theme details screen, perhaps wouldn't bring another button in for 'disable auto update'. Maybe it's also not be 'live preview' and under the title?

As far as the updates screen makes sense I think using a new line for the scheduling information would make it clearer.

@xkon
4 weeks ago

comment 8 feedback

@xkon
4 weeks ago

splits info on 2 line in Updates Themes list

@xkon
4 weeks ago

Automatic update under title on theme_overlay

#9 @xkon
4 weeks ago

49199.1.diff adjusts the text of the enable/disable actions to be the same as on Plugins proposal (#48850) as "Enable/Disable automatic updates" for consistency. Also moves it under the title in the theme overlay instead of being a button as well as splits the information into 2 lines under Updates page as proposed in comment 8.

Previews with this patch 49199.1_2_lines_on_updates.jpg , 49199.1_theme_overlay_under_title_with_update.jpg and 49199.1_theme_overlay_under_title_without_update.jpg

I hope I didn't miss anything (or misunderstood even 😄).

#10 @audrasjb
4 weeks ago

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

@xkon I definitely vote for your proposal, it looks perfect to me! ⭐️

@audrasjb
4 weeks ago

Multisite support

#11 @audrasjb
4 weeks ago

In 49199.2.diff, I added multisite support by replacing get_option with get_site_option and I replaced the option name for better consistency with plugins.

Also, I have to check but I think we'll probably need some other adjustments to handle properly mulitisites.

#12 @xkon
4 weeks ago

Glad you like it! I just delivered the minor updates on the patch, thanks to 👉 @karmatosed for showing the way haha 😊 ( 8 ). I do like it very much as well, it's way more readable and looks really clean!

One question & noting also that I noticed on the previous (button) iteration.

The button was not visible to select automatic updating on the Active theme (at least for me), was this intentional? By moving the links under the title they are now visible always for all themes active & inactive. I'm mentioning and making it clear to avoid any accidental breaking of flow.

#13 @audrasjb
4 weeks ago

The button was not visible to select automatic updating on the Active theme (at least for me), was this intentional?

I could say it was intentional to save face, but I have to admit it wasn't a feature, it was definitely a bug. 😆

Last edited 4 weeks ago by audrasjb (previous) (diff)

#14 @audrasjb
4 weeks ago

  • Keywords 2nd-opinion removed
  • Milestone changed from Awaiting Review to 5.4

@audrasjb
4 weeks ago

Add constants and functions/filters to disable automatic updates UI and processes

#15 @audrasjb
4 weeks ago

In 49199.3.diff:

  • Added WP_DISABLE_THEMES_AUTO_UPDATE constant to disable auto updates
  • Added wp_is_themes_auto_update_enabled() PHP function to check wether the theme auto updates are enabled or not on the website
  • Added wp_themes_auto_update_enabled filter
  • Added some conditional statements so the auto update UI stuff is hidden if automatic updates are disabled
  • Documented the new functions

It works fine on my side :-)

@audrasjb
3 weeks ago

TODO: implement the feature on Network Admin Themes screen

#16 @audrasjb
3 weeks ago

  • Focuses multisite added

Note: we have to implement the feature on Network Admin Theme screen (see screenshot above).

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


3 weeks ago

@audrasjb
2 weeks ago

49199.4.diff: add multisite support for Themes autoupdates.

@audrasjb
2 weeks ago

49199.4.diff: add multisite support for Themes autoupdates.

#18 @audrasjb
2 weeks ago

In 49199.4.diff:

  • Added multisite/network support for Themes Autoupdates.

Please test.

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


2 weeks ago

#20 @desrosj
2 weeks ago

Left some feedback over on the plugin ticket that also applies to themes: https://core.trac.wordpress.org/ticket/48850#comment:46

#21 @karmatosed
12 days ago

Related to the work that's gone on with plugins, I began to explore themes a bit. I think the extra button could be replaced by a section, a section makes it clearer. This could go below but also swap to the top.

http://cldup.com/k9SAXqh0PB.png

http://cldup.com/soZOEQdaxr.png

This is clear, allows for messaging and causes less finger traps than a new button, clearer as a section.

When viewing all themes in multisite, it would be great to add that new auto update column from the plugins ticket @audrasjb - is that possible?

Last edited 12 days ago by karmatosed (previous) (diff)

#22 @karmatosed
12 days ago

Relating to the above, we need to make sure the language is the same as the plugin work being done, to align. That's where my explorations are coming from right now.

#23 @karmatosed
12 days ago

A question regarding themes, how would you bulk enable or disable auto updates? I think as with plugins this might be useful.

#24 @xkon
12 days ago

The button was removed some patches earlier from your previous comment at 8 and was moved right below the title as seen at 49199.1_theme_overlay_under_title_without_update.jpg.

Just mentioning in case it was missed :-), moving it at the bottom though seems like a much better positioning also as it's closer to the "actions" in general and doesn't get easily lost from the surrounding text!

#25 @karmatosed
12 days ago

Thanks for clarity, I wasn't sure if the text was staying so happy about the button going. My point does still stand about it being a section I think feels better in this case, I am glad you seem to feel that too.

#26 @xkon
12 days ago

Yep, I totally agree from what I see in the mockups!

Regarding the bulk since single sites don't have a "table" view, that will definitely need some extra thinking 😅.

Would be possible to introduce a checkbox for example on the Single site Theme listing? I'm thinking maybe in a similar way as we have Bulk Select on Media? Not really sure if that would fit the overall design here though at all.

#27 @desrosj
12 days ago

I am wondering if for the first pass on themes, not including a bulk enable/disable mechanism (except in multisite on the network admin themes page where there is a list table) is reasonable.

While it's not uncommon for sites to have many installed themes, it is less common than having many plugins.

But, because the themes page is different, maybe adding something in the top bar next to the search input field would work?

https://cldup.com/ZhBg4HiuK5.png

#28 @karmatosed
12 days ago

One consideration is that the message at the top is really quite prominent, however, I think that's being added not by this update and already in core? Just wanted to check that. Would we at all be able to move that to the bottom also and consider moving the update scheduling information outside? Maybe like this?

http://cldup.com/T8FxdSsxdV.png

#29 @peterwilsoncc
12 days ago

Added some general thoughts to the plugins ticket, sharing those that apply here too.

  • If WP_DISABLE_THEMES_AUTO_UPDATE === true, wp_is_themes_auto_update_enabled() should return early and never hit the filter. This will prevent developers overriding the site owner's hard coded choice.
  • For themes that use semantic versioning and therefore may have breaking changes between versions, do we need to modify the .org API to return offer_minor and offer_patch to allow the theme additional control over how it may be auto updated
  • To prevent malicious-plugin from messing what's offerer to good-honest-themes, do we need to use PHP Reflections to limit filters running on the the plugin to the theme itself. This is super complex I know but keep in mind the offered file can be changed from wp.org to malicious.org via filters. This is perhaps a topic for another time.
  • if WP_DISABLE_THEMES_AUTO_UPDATE === true and for sites using version control then the auto-updates UI ought not be displayed.
  • It looks like WP_DISABLE_THEMES_AUTO_UPDATE is a new constant, in which case please figure out a positive/negative setup so it matches the proposed WP_AUTO_UPDATE_PLUGINS in the plugins ticket.

As with plugins, I think this is too late for 5.4. Could it be released as a feature plugin prior to the release of 5.5? Again, given everyone's hard work I apologise for the lateness of my feedback.

#30 @audrasjb
7 days ago

  • Milestone changed from 5.4 to 5.5

Thanks all for your contribution to this ticket ♥️

Let's punt #49199 and #48850 to 5.5 with early keyword.
Please follow make.wordpress.org/core for further details about the next steps.

Cheers,
Jb

#31 @audrasjb
7 days ago

  • Keywords early added
Note: See TracTickets for help on using tickets.