WordPress.org

Make WordPress Core

Opened 8 weeks ago

Last modified 3 hours ago

#48850 assigned feature request

Plugins Screen: introduce "Automatic updates" column / option

Reported by: jeherve Owned by: audrasjb
Milestone: Awaiting Review Priority: normal
Severity: minor Version: 3.7
Component: Plugins Keywords: has-patch needs-testing has-screenshots dev-feedback needs-dev-note
Focuses: administration, multisite Cc:
PR Number:

Description

WordPress 3.7 introduced us to automatic updates for Core, themes, plugins, and translations. It also brought us filters like auto_update_plugin that allow site owners to automatically update specific plugins if they want to.
WordPress 5.1 went a step further with Fatal Error Protection, and 5.2 made managing any failures caused by broken plugins even easier with Recovery Mode.

At this point, I think it has become relatively safe for a site owner to use the auto_update_plugin filter to enable autoupdates for any or all of their plugins. It removes one of the burdens of site management, and in case of failure (such as a plugin introducing a fatal error with an update) it is relatively easy to access the dashboard and remove the plugin.

All that said, I would like to suggest making plugin autoupdates even more mainstream by adding a new column to the Plugins screen, where one could toggle autoupdates on / off for just about any plugin.

Attachments (22)

plugin-autoupdates-wp-admin.png (590.7 KB) - added by jeherve 8 weeks ago.
New Automatic update field in the Plugins screen
autoupdate-1-selector.png (231.0 KB) - added by audrasjb 3 weeks ago.
Autoupdate - 1 - selector
autoupdate-2-bulk-edit.png (189.6 KB) - added by audrasjb 3 weeks ago.
Autoupdate - 2 - bulk edit
48850.diff (5.4 KB) - added by audrasjb 3 weeks ago.
Add plugin autoupdate management in bulk edit selector - first workaround
48850.1.diff (5.3 KB) - added by audrasjb 3 weeks ago.
Move the "Automatic update activated" text in the plugin description column and add a dashicon
Capture d’écran 2020-01-05 à 00.34.35.png (160.0 KB) - added by audrasjb 3 weeks ago.
48850.1.diff screenshot
48850.2.diff (7.8 KB) - added by xkon 2 weeks ago.
auto update list
auto-update-list.jpg (125.8 KB) - added by xkon 2 weeks ago.
48850.2.diff screenshot
Capture d’écran 2020-01-12 à 15.03.25.png (107.2 KB) - added by audrasjb 11 days ago.
Add autoupdate information to update-core.php screen.
48850.3.diff (9.0 KB) - added by audrasjb 11 days ago.
Add autoupdate information to update-core.php screen.
automatic-update-scheduled-screen-update-plugins.png (84.9 KB) - added by audrasjb 11 days ago.
Plugins update screen: add time until the next scheduled update for plugins that have an available update.
automatic-update-scheduled-screen-update-core.png (61.4 KB) - added by audrasjb 11 days ago.
update-core.php screen: add time until the next scheduled update for plugins that have an available update.
48850.4.diff (11.2 KB) - added by audrasjb 11 days ago.
Adds time before the next scheduled update in both update.php (plugins screen) and update-core.php (updates screen).
48850.5.diff.png (170.9 KB) - added by audrasjb 7 days ago.
48850.5.diff : Replace Activate/Deactivate with Enable/Disable and add Enable/Disable Autoupdate action for each plugin in Plugins screen
48850.5.diff (13.6 KB) - added by audrasjb 7 days ago.
Replace Activate/Deactivate with Enable/Disable and add Enable/Disable Autoupdate action for each plugin in Plugins screen
48850.6.diff (15.1 KB) - added by audrasjb 2 days ago.
Added support for multisite installations
auto-update-plugins-screen.png (24.6 KB) - added by klou 26 hours ago.
48850.7.diff (15.1 KB) - added by xkon 11 hours ago.
fixes nbsp to space char on .6 diff
Automatic-update-wireframe1.jpg (159.7 KB) - added by paaljoachim 4 hours ago.
Adding the icon and automatic text in the plugin column.
Automatic-update-wireframe2.jpg (161.7 KB) - added by paaljoachim 4 hours ago.
Adding the icon and automatic text in the description column.
48850.8.diff (12.8 KB) - added by audrasjb 4 hours ago.
Address enhancements raised in comment 30
enable-automatic-updates-idea.png (27.6 KB) - added by klou 3 hours ago.

Change History (59)

@jeherve
8 weeks ago

New Automatic update field in the Plugins screen

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


5 weeks ago

#2 @paaljoachim
5 weeks ago

That is a very good way of adding auto updates for plugins! As one could then select the plugins that are most stable for auto updating.

I have earlier made this issue: #45783

It basically adds an auto updates section to the existing Dashboard -> Updates screen.

Last edited 3 weeks ago by SergeyBiryukov (previous) (diff)

#3 @audrasjb
3 weeks ago

Hi there,

I really love the proposed approach but I'd like to propose another way to handle this feature: as a very first step for allowing auto update management in WordPress Admin, we could also use the bulk edit selector.

Screenshot and patch (first workaround) coming below ⏬

@audrasjb
3 weeks ago

Autoupdate - 1 - selector

@audrasjb
3 weeks ago

Autoupdate - 2 - bulk edit

@audrasjb
3 weeks ago

Add plugin autoupdate management in bulk edit selector - first workaround

#4 @audrasjb
3 weeks ago

  • Keywords has-patch needs-testing has-screenshots needs-design added

In 48850.diff, as a first workaround and a proof of concept:

  • Allow admins to enable/disable automatic updates by using the plugins bulk selector.
  • Display admin notices when enabling/disabling auto updates on existing plugins.
  • Display a text to show that selected plugins are now updating automatically.
  • Store auto updated plugins in a site option.
  • Make basic controls on the user’s capabilities

The nice point is that we don't add another column to the plugin table list, and the patch is pretty simple. It doesn't need AJAX and it doesn't add a lot of code to the existing codebase. But it will of course need some improvement: it's the first time I try to play with updates/autoupdates so I guess some parts of this patch are probably _doing_it_wrong ;-)

When testing this patch/workaround, please don't forget autoupdates are not running immediately (but twice a day, I believe).

Also adding needs-design keyword as I guess it would be nice to add a dashicon or better wording/visual indications here and there :)

Cheers,
Jb

@audrasjb
3 weeks ago

Move the "Automatic update activated" text in the plugin description column and add a dashicon

@audrasjb
3 weeks ago

48850.1.diff screenshot

#5 @audrasjb
3 weeks ago

  • Keywords needs-design-feedback added; needs-design removed

In 48850.1.diff, I moved the text in the plugin description column and I added a dashicon.

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


2 weeks ago

#7 @afragen
2 weeks ago

FWIW I like this second approach better. There is more space available in this location.

I haven't tested the patch but in a quick look there needs to be a the third parameter for in_array( needle, haystack, true ).

#8 @xkon
2 weeks ago

The Capture d’écran 2020-01-05 à 00.34.35.png looks really nice and clean without making a major change on the screen but I think that we also need a way to "sort" the auto-updated plugins as well similar to the Active / Inactive statuses.

Unfortunately on sites with a lot of plugins the list will eventually become a bit hectic to go through 1 by 1 trying to read a small message to see which plugin has auto-updates on or off.

Since this screen never used any type of sorting on the table itself we can follow the current convention and add 2 extra sorting links for "Auto-Updates On"/"Auto-Updates Off" (I'm not sure about the wording at all by the way :D ).

Any thoughts on this?

@xkon
2 weeks ago

auto update list

@xkon
2 weeks ago

48850.2.diff screenshot

#9 @xkon
2 weeks ago

48850.2.diff adds the strict in_array comparisons as @afragen mentioned and adjusts some minor CS fixes.

As well as introduces the 2 extra lists as "Auto updates on" "Auto updates off" as mentioned in my previous comment (8) for an easier test/look.

#10 @audrasjb
13 days ago

Thanks @xkon, yes I think it's worth adding these 2 filters, this is a nice enhancement for sure!

@audrasjb
11 days ago

Add autoupdate information to update-core.php screen.

@audrasjb
11 days ago

Add autoupdate information to update-core.php screen.

#11 @audrasjb
11 days ago

In 48850.3.diff:

  • Add autoupdate information to update-core.php screen (see screenshot above).

#12 @audrasjb
11 days ago

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

@audrasjb
11 days ago

Plugins update screen: add time until the next scheduled update for plugins that have an available update.

@audrasjb
11 days ago

update-core.php screen: add time until the next scheduled update for plugins that have an available update.

#13 @audrasjb
11 days ago

In the last two screenshots (see above), I added the time until the system will perform the autoupdate.
Patch proposal coming later today.

@audrasjb
11 days ago

Adds time before the next scheduled update in both update.php (plugins screen) and update-core.php (updates screen).

#14 @audrasjb
9 days ago

Related: #49199

(same for themes)

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


8 days ago

#16 @nrqsnchz
8 days ago

I suggest changing from "Automatic update activated" to "Automatic update enabled" (or something similar) to avoid confusion with the "Activate/Deactivate" link below the plugin's name. The fact that both places use the verb "Activate" might make some users think that these two are related actions/labels.

Related to me previous point, is the "Bulk actions" dropdown the only place where I can activate/deactivate automatic updates for a plugin? I think that also having this setting near the label would make it more obvious, at least when one wants to make a change to just one plugin.

Last edited 8 days ago by nrqsnchz (previous) (diff)

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


8 days ago

@audrasjb
7 days ago

48850.5.diff : Replace Activate/Deactivate with Enable/Disable and add Enable/Disable Autoupdate action for each plugin in Plugins screen

@audrasjb
7 days ago

Replace Activate/Deactivate with Enable/Disable and add Enable/Disable Autoupdate action for each plugin in Plugins screen

#18 @audrasjb
7 days ago

Thanks for your feedback @nrqsnchz, that totally makes sense to me.

In 48850.5.diff:

  • Replace Activate/Deactivate with Enable/Disable
  • Add individual Enable/Disable actions for each plugin

See also the related screenshot shared right above.

#19 @nrqsnchz
7 days ago

@audrasjb Looks great! 👍

#20 @ronalfy
2 days ago

@audrasjb is it possible to add some do_actions after updating the options?

An example:

do_action( 'wp_autoupdated_plugins', $autoupdated_plugins )

Also, you'll maybe want to take into account multisite networks. I suggest using update_site_option and get_site_option so that auto-updates can occur on a network level as well.

#21 @audrasjb
2 days ago

  • Focuses multisite added
  • Keywords dev-feedback added; 2nd-opinion needs-design-feedback removed

Thanks @ronalfy, I added support for multisite installations in 48850.diff.

I think actions and filters should come in a second time, after a proper review of the existing patch.

Also removing design feedback as the Design team already provided their feedback on Slack.

@audrasjb
2 days ago

Added support for multisite installations

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


2 days ago

#23 @audrasjb
2 days ago

  • Keywords needs-dev-note added

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


29 hours ago

#25 @klou
26 hours ago

Hey everyone,

here's some feedback regarding the enable/disable automatic updates action.

I see that you're going with the link below the description of the plugin.

I think, since every action regarding the plugin lives under the title, maybe we should think of a solution and keep all the actions together under the title. People are used to find actions there, so maybe we could use that to our advantage?

Also, although I love icons, no other plugin action has an icon, so that might be a consistency issue to think about.

Last edited 26 hours ago by klou (previous) (diff)

#26 @Mista-Flo
13 hours ago

That's a great feature, good job 👏

I have read the patch, it seems pretty solid, good code.

#27 @xkon
11 hours ago

Latest 48850.6.diff seems to be throwing a couple of syntax errors for me, could someone else apply the patch as well for a cross-check :-) ?

#28 @xkon
11 hours ago

For some reason 2 of the } else { seems to be causing these issues for me. Even PHPCS throws out warnings. Deleting and re-writing just the word else resolves it 😂.

Do tell me if the latest works for you just in case it's something only with my setup. Seems really weird though and first time I see a char encoding issue like this to be honest.

Only 2 instances of the else word are doing this.

Parse error: syntax error, unexpected '{' in D:\laragon\www\wp-core\src\wp-admin\plugins.php on line 190

And

PHP Parse error:  syntax error, unexpected '{' in D:\laragon\www\wp-core\src\wp-admin\includes\update.php on line 493

Not sure yet if I should update the patch so just informing for now 🙂.

@xkon
11 hours ago

fixes nbsp to space char on .6 diff

#29 @xkon
11 hours ago

I wasn't going crazy as it seems. Had a quick DM with @audrasjb and while viewing 48850.6.diff those else didn't had spaces between curly braces on the right side but nbsp chars instead as it seems 🤷‍♂️. I accidentally saw it while viewing the diff and showing all spaces/tab chars also.

48850.7.diff adjusts those 2 and fixes these errors, nothing else was touched.

#30 @ocean90
10 hours ago

Quick feedback on 48850.7.diff:

  • To simplify the code you can always use get_site_option(). It falls back to get_option() for non-Multisite. In a Multisite plugins can only be updated on the network screen, so it shouldn't use the single site option there anyway.
  • There's no need to add the string for automatic update information via another placeholder (%7$s) to the existing string. Just print it afterwards.
  • I think the option name should be wp_auto_update_plugins since it contains plugins to auto update.

#31 @audrasjb
9 hours ago

Thanks for the investigations @xkon

@ocean90 those points are very useful, thanks!
I should be able to fix them later today.

#32 @karmatosed
7 hours ago

This looks like a great first step. I think over the year it can be iterated but seems a good use of the same UI. As some feedback, I wonder if the arrow circle is even needed or works at that size, but that's to see in experience.

I do think @klou has a valid point about actions being beside the plugin title. I wonder what this limits though? I'd probably recommend removing the icon if it was moved to the side.

#33 @xkon
6 hours ago

Hm, actions usually are seen as 1-line I believe throughout the admin area and unfortunately the text here is kinda large by itself to at least fit at the same line and have Deactivate | Settings | Docs | Enable Automatic updates, don't you think? Also we have to take under account plugins that might be adding more links there :/.

Except if the naming gets shorter i.e. Enable Auto Updates ( or as in the filter Auto Update On/Off but this will be confusing as a switch most likely).

One iteration of "looks-like" a 2-liner ( since the comments are long and might've been missed on scrolling fast :D ) on the left side is similar to autoupdate-2-bulk-edit.png with a notice right under the title but I personally think that it looks better & reads more easily where it is on the latest patches.

Last edited 6 hours ago by xkon (previous) (diff)

#34 @paaljoachim
4 hours ago

I took a closer look by creating two wireframes.

The first wireframe I placed the icon and Automatic text below the text under the title.
The second wireframe I placed them under the description.
(The text is a bit squashed in both columns.)

The most important actions in the plugin screen are the links below the title. It is good to keep this area more spacious.
There is more consistency in the Plugin title column. The Description column contains a lot more variation and can easier also contain additional text without it feeling as crowded as the Plugin column.

But then again important actions would also remain in the plugin column.

Last edited 4 hours ago by paaljoachim (previous) (diff)

@paaljoachim
4 hours ago

Adding the icon and automatic text in the plugin column.

@paaljoachim
4 hours ago

Adding the icon and automatic text in the description column.

@audrasjb
4 hours ago

Address enhancements raised in comment 30

#35 @audrasjb
4 hours ago

Thanks all for contributing to the discussion.

In the meantime, I added 48850.8.diff, which addresses the concerns @ocean90 raised in Comment:30.

  • Simplify the code by using get_site_option()instead of get_option()
  • Remove a useless placeholder.
  • Rename the option to use wp_auto_update_plugins since it contains plugins to auto update. I also renamed the corresponding PHP variables.

#36 @audrasjb
3 hours ago

@klou @karmatosed @paaljoachim thanks for your design feedback 👍

I'm not convinced by the idea of moving the button-link in the "Plugin" column. Indeed, the text of the link is pretty long, and I think it just can't be both shorter and understandable/accessible.

Also, we have to think about translations.
For example (in those examples, I'll use fr_FR but I'm pretty sure the issue also exists in other languages!), "Enable automatic update" will be translated as "Activer les mises à jour automatiques" in French :-) Pretty long, but we just can't make is shorter. Even worst: there is no short equivalent to "Auto Update" expression in French.

Therefore, I'd say we keep the action in the Description column. And I initially added the dashicon to make it more discoverable because it's in the Description column :-)

Does it makes sense for you? Any opposite thoughts on this?

(in any case, I think we shouldn't use the short version "auto update" at all, even in the filters on the top of the page but that's another question)

Last edited 3 hours ago by audrasjb (previous) (diff)

#37 @klou
3 hours ago

Correct me if I'm wrong, but despite the fact that "enable automatic updates" is quite big, I don't think that it will break into 2 lines, because of the fluidity of the second column.

I think the wording of this action should be: "enable/disable automatic updates" as a link. I would prefer automatic from auto because I think it'll be clearer for the translators to scan it and translate it in other languages without any issues.

Also, I think we should always group the core actions of a plugin ( activate / enable automatic updates ) and then let the plugin authors add their own actions.

@karmatosed Regarding the use of icons, instead of using an icon for the actual link, we could use it in front of the plugin title, to indicate it has automatic updates enabled.

Note: See TracTickets for help on using tickets.