Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#49199 closed feature request (fixed)

Introduce Automatic Update opt-in setting for Themes

Reported by: audrasjb's profile audrasjb Owned by: audrasjb's profile audrasjb
Milestone: 5.5 Priority: normal
Severity: normal Version:
Component: Themes Keywords: has-screenshots has-patch
Focuses: administration, multisite Cc:

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 4 years ago.
Themes Screen: Activate autoupdate opt-in button
2-theme-autoupdate-appearance-screen-activated.png​ (386.9 KB) - added by audrasjb 4 years ago.
Themes Screen: Autoupdate activated notice
3-theme-autoupdate-appearance-screen-disable.png​ (645.8 KB) - added by audrasjb 4 years 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 4 years ago.
Updates screen (update-core.php): Informations about eventual scheduled autoupdates for Themes
49199.diff​ (8.8 KB) - added by audrasjb 4 years ago.
First workaround: Autoupdate opt-in for Themes
49199.1.diff​ (9.0 KB) - added by xkon 4 years ago.
comment 8 feedback
49199.1_2_lines_on_updates.jpg​ (53.9 KB) - added by xkon 4 years 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 years ago.
Automatic update under title on theme_overlay
49199.1_theme_overlay_under_title_without_update.jpg​ (117.9 KB) - added by xkon 4 years ago.
49199.2.diff​ (9.1 KB) - added by audrasjb 4 years ago.
Multisite support
49199.3.diff​ (10.2 KB) - added by audrasjb 4 years 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 4 years ago.
TODO: implement the feature on Network Admin Themes screen
49199.4.diff.png​ (195.4 KB) - added by audrasjb 4 years ago.
49199.4.diff: add multisite support for Themes autoupdates.
49199.4.diff​ (17.6 KB) - added by audrasjb 4 years ago.
49199.4.diff: add multisite support for Themes autoupdates.

Change History (50)

@audrasjb
4 years ago

Themes Screen: Activate autoupdate opt-in button

@audrasjb
4 years ago

Themes Screen: Autoupdate activated notice

@audrasjb
4 years ago

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

@audrasjb
4 years ago

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

#1 @audrasjb
4 years ago

  • Keywords has-screenshots added; needs-screenshots removed

@audrasjb
4 years ago

First workaround: Autoupdate opt-in for Themes

#2 @audrasjb
4 years 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
4 years 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.


4 years ago

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


4 years ago

#6 @audrasjb
4 years ago

  • Keywords needs-dev-note added

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


4 years ago

#8 @karmatosed
4 years 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 years ago

comment 8 feedback

@xkon
4 years ago

splits info on 2 line in Updates Themes list

@xkon
4 years ago

Automatic update under title on theme_overlay

#9 @xkon
4 years 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 years 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 years ago

Multisite support

#11 @audrasjb
4 years 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 years 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 years 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 admin it wasn't a feature, it was definitely a bug. πŸ˜†

Version 0, edited 4 years ago by audrasjb (next)

#14 @audrasjb
4 years ago

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

@audrasjb
4 years ago

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

#15 @audrasjb
4 years 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
4 years ago

TODO: implement the feature on Network Admin Themes screen

#16 @audrasjb
4 years 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.


4 years ago

@audrasjb
4 years ago

49199.4.diff: add multisite support for Themes autoupdates.

@audrasjb
4 years ago

49199.4.diff: add multisite support for Themes autoupdates.

#18 @audrasjb
4 years 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.


4 years ago

#20 @desrosj
4 years 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
4 years 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 4 years ago by karmatosed (previous) (diff)

#22 @karmatosed
4 years 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
4 years 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
4 years 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
4 years 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
4 years 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
4 years 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
4 years 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
4 years 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
4 years 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
4 years ago

  • Keywords early added

This ticket was mentioned in ​Slack in #core by david.baumwald. ​View the logs.


4 years ago

This ticket was mentioned in ​Slack in #core by david.baumwald. ​View the logs.


4 years ago

#34 @pbiron
4 years ago

Work on this has continued in the ​WordPress Auto-updates feature plugin (via it's ​GitHub repo).

The development of the feature plugin is close to being "feature complete" and we are getting ready to put together a merge proposal.

#35 @audrasjb
4 years ago

  • Keywords dev-feedback needs-dev-note early removed
  • Resolution set to fixed
  • Status changed from accepted to closed

Closing this ticket as the feature was introduced in #50052

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

This ticket was mentioned in ​Slack in #hosting-community by mike. ​View the logs.


4 years ago

Note: See TracTickets for help on using tickets.