Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#50052 closed enhancement (fixed)

Plugins & Themes Auto-Updates ๐Ÿค–

Reported by: whyisjake's profile whyisjake Owned by: whyisjake's profile whyisjake
Milestone: 5.5 Priority: normal
Severity: normal Version: 5.5
Component: Security Keywords: needs-testing needs-design-feedback needs-docs has-patch has-dev-note
Focuses: ui, administration Cc:

Description (last modified by audrasjb)

WordPress Auto-updates ๐Ÿค–

With the maturity of the โ€‹WordPress AutoUpdates plugin, let's get this merged to core for WordPress 5.5.

Recent Changes

0.7.0 ๐Ÿฆข

May 6, 2020

0.6.0 ๐Ÿฆ‹

April 22, 2020

  • Add Ajax to Plugin and Themes Screen - โ€‹#61
  • Accessibility: Communicate AJAX enabling/disabling changes to screen readers - โ€‹#85
  • Add Better Handling to Ajax Errors - โ€‹#90
  • Prevent CSS from being enqueued on sub-site plugins & themes screens in multisite - โ€‹#91

0.5.1 ๐Ÿฆ’

April 16, 2020

  • Add the plugin version when enqueueing styles, for cache busting - โ€‹#79

0.5.0 ๐Ÿฆš

April 15, 2020

  • Replace Disable strings with Disable auto-updates - โ€‹#78
  • Update confirmation message wording - โ€‹#77
  • Remove Automatic Updates column from the Network Admin > Sites > Edit > Themes screen - โ€‹#76
  • Replace "Enable" string with "Enable auto-updates" - โ€‹#75
  • Remove dashicons from the UI - โ€‹#74
  • Fix documentation and comment standards - โ€‹#73
  • Remove green and red colors on texts and links - โ€‹#70
  • Don't display the Enable/Disable link in the Theme Details modal on a subsite in multisite - โ€‹#68
  • Documentation: Improve DocBlocks - โ€‹#62
  • I18n - Merge with similar string - โ€‹#60
  • Add filters and constant to allow developers to disable plugins and themes autoupdate email notifications - โ€‹#57
  • Switch disable link to red on Multisite Themes Screen - โ€‹#54
  • Wrong kick off year in readme.txt - โ€‹#42

0.4.1 ๐Ÿบ

April 2, 2020

  • Network > Sites > Edit > Themes screen doesnโ€™t have the Autoupdates column - โ€‹#50

0.4.0 ๐ŸŒน

March 30, 2020

This release brings full support for Themes auto-updates.

It also changes the plugin structure to allow self deactivation when the feature gets merged into WordPress Core.

Please note: the development repository was also migrated from @audrasjbโ€™s personal GitHub account to WordPress.org official GitHub account.

Other changes:

  • Change plugin structure to ensure it can self-deactivate when the feature is merged into Core - โ€‹#37
  • Handle both themes and plugins email notifications - โ€‹#36
  • i18n: Merge similar translation strings - โ€‹#35

Add and populate Automatic updates column, add and handle enable/disable auto-updates bulk actions to the multisite themes list * table - โ€‹#33

  • Avoid duplicate Updatingโ€ฆ dialog - โ€‹#32

Attachments (4)

50052.diffโ€‹ (62.0 KB) - added by pbiron 4 years ago.
50052.2.diffโ€‹ (65.7 KB) - added by pbiron 4 years ago.
refreshes against trunk and adds a few changes from the forthcoming version 0.8.1 of the feature plugin
50052.3.diffโ€‹ (65.3 KB) - added by azaozz 4 years ago.
Diff from โ€‹https://github.com/WordPress/wordpress-develop/pull/281
50052.4.diffโ€‹ (1.5 KB) - added by whyisjake 4 years ago.

Download all attachments as: .zip

Change History (54)

#1 @whyisjake
4 years ago

  • Keywords needs-patch needs-testing needs-design-feedback needs-codex needs-docs added
  • Milestone changed from Awaiting Review to 5.5
  • Type changed from defect (bug) to enhancement
  • Version set to trunk

#2 @audrasjb
4 years ago

  • Keywords needs-dev-note added

Related: #48850, #49199

#3 @whyisjake
4 years ago

  • Focuses ui administration added
  • Keywords needs-dev-note removed

#4 @whyisjake
4 years ago

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

#5 @whyisjake
4 years ago

  • Component changed from General to Security

#6 follow-ups: @afercia
4 years ago

One of the criteria to merge features-as-plugins into core is that the new code meets the WordPress coding standards.

โ€‹https://make.wordpress.org/core/handbook/about/release-cycle/features-as-plugins/#feature-plugin-merge-criteria

The code conforms to the WordPress coding standards.

Looking at the latest version of the plugin on GitHub, I see the main JS file needs quite a bit of adjustments to meet the coding standards. See โ€‹https://github.com/WordPress/wp-autoupdates/blob/3c7032b7310569e830a9dadcab0fdb06cacba23e/js/wp-autoupdates.js

#7 in reply to: โ†‘ย 6 @pbiron
4 years ago

Replying to afercia:

Looking at the latest version of the plugin on GitHub, I see the main JS file needs quite a bit of adjustments to meet the coding standards.

Agreed. See โ€‹PR: Fix enabled/disabled count updating for the first step towards that goal.

#8 in reply to: โ†‘ย 6 @pbiron
4 years ago

Replying to afercia:

Looking at the latest version of the plugin on GitHub, I see the main JS file needs quite a bit of adjustments to meet the coding standards.

See โ€‹Simplifies Ajax on both the JS and PHP sides. for a more complete attempt to correct that (which is intended to superseded the other PR I linked to yesterday).

#9 @afercia
4 years ago

@pbiron thanks for clarifying. I was concerned โ€‹the post published on Make 3 days ago claimed the feature plugin as "ready for a core merge", while it appears it's not ready, yet.

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


4 years ago

#11 @jorbin
4 years ago

Some things worth testing that I remember from Shiny Updates v1 (though not super well, it's been a while):

1) make sure to test plugins who's update contains syntax errors. โ€‹https://plugins.trac.wordpress.org/browser/this-plugin-should-not-be-used exists for this purpose. You can install version 0.1 and then if you update to 0.2, there is a syntax error.

2) There are some JS events that plugins rely on with updates. Should make sure that there are adequate replacements if needed. See #37216 #37512

3) There is alot of logic for ftp/ssh credentials in the existing workflow. Obviously won't matter for autoupdates, but we should ensure it's not broken for manual updates

#12 @pbiron
4 years ago

@jorbin Thank you. Can you also open an issue on the โ€‹Feature Plugin repo so we have your thoughts there as well?

#13 @jorbin
4 years ago

@pbiron no. This isn't an issue with the plugin, this is thoughts of what needs to happen for core which is developed here.

#14 @audrasjb
4 years ago

  • Description modified (diff)

Updated the description of the ticket to add last plugin version.

@pbiron
4 years ago

#15 @pbiron
4 years ago

  • Keywords has-patch added; needs-patch removed

50052.diff contains all the functionality from version 0.8.0 of the feature plugin (to be released shortly), except for the help tabs, because the copy for those isn't ready yet.

#16 @azaozz
4 years ago

50052.diff looks good here.

Can see couple of tiny optimizations/improvements, like setting __( 'Auto-updates enabled' ) to a var as it is used in two loops in WP_Debug_Data, but really minor thing. Also perhaps breaking up the long lines for printf() in WP_List_Table for better readability, another minor thing :)

This ticket was mentioned in โ€‹Slack in #core by azaozz. โ€‹View the logs.


4 years ago

#18 follow-up: @audrasjb
4 years ago

  • Keywords needs-dev-note added; needs-codex removed

I tested/compared each feature with the feature plugin ones, and I didn't see any issue on the proposed patch.
Thanks for putting this together @pbiron!


I also took the time to list all those who contributed to the development of this feature from version 0.1.0 to 0.8.0, so they can get props on the first commit of this ticket:

audrasjb, xkon, azaozz, desrosj, pbiron, gmays, pedromendonca, javiercasares, karmatosed, 
mapk, afercia, gmays, knutsp, whodunitagency, passionate, nicolaskulka, bookdude13, whyisjake, 
nielsdeblaauw, mukesh27, wpamitkumar, netweb, afragen, davidperonne, paaljoachim

Thanks y'all for your contributions!

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

This ticket was mentioned in โ€‹Slack in #core-site-health by pbiron. โ€‹View the logs.


4 years ago

@pbiron
4 years ago

refreshes against trunk and adds a few changes from the forthcoming version 0.8.1 of the feature plugin

#20 @whyisjake
4 years ago

This is looking great, and I think we are ready for merge. @azaozz anything else to add?

This ticket was mentioned in โ€‹Slack in #core by whyisjake. โ€‹View the logs.


4 years ago

#22 @TimothyBlynJacobs
4 years ago

Seems like wp_is_auto_update_enabled_for_type would be useful in wp-includes/update.php since it seems like it isn't just about the admin UI.

The logic in the WP_Automatic_Updater seems wrong to me. As far as I can tell, this will stop autoupdates being triggered from the API if the corresponding filter is disabled. I think it should be...

<?php
$update =  ! empty( $item->autoupdate );
if ( ! $update && wp_is_auto_update_enabled_for_type( $type ) ) {
    $auto_updates = (array) get_site_option( "auto_update_{$type}s", array() );
    $update      = in_array( $item->{$type}, $auto_updates, true );
}

This ticket was mentioned in โ€‹PR #279 on โ€‹WordPress/wordpress-develop by โ€‹whyisjake.


4 years ago
#23

PR to bring auto-updates to WordPress themes and plugins.

This is an extension of โ€‹https://github.com/WordPress/wp-autoupdates

Trac ticket: https://core.trac.wordpress.org/ticket/50052

This ticket was mentioned in โ€‹PR #280 on โ€‹WordPress/wordpress-develop by โ€‹whyisjake.


4 years ago
#24

PR to bring auto-updates to WordPress themes and plugins.

Closing #279 in favor of this updated PR.

This is an extension of โ€‹https://github.com/WordPress/wp-autoupdates

Trac ticket: https://core.trac.wordpress.org/ticket/50052

โ€‹whyisjake commented on โ€‹PR #279:


4 years ago
#25

Thanks to @ocean90 and @TimothyBJacobs for their comments here. Moving over to #280 for a proper forked pull request.

This ticket was mentioned in โ€‹PR #281 on โ€‹WordPress/wordpress-develop by โ€‹azaozz.


4 years ago
#26

Trac ticket: https://core.trac.wordpress.org/ticket/50052

This is an extension/additional PR to @whyisjake branch: โ€‹https://github.com/whyisjake/wordpress-develop/tree/auto-updates-50052 that contains the core patch for "Plugin and Theme Auto-Updates".

#27 @azaozz
4 years ago

Thinking 50052.3.diff is ready for commit. There may be few places where the code perhaps can be a bit more readable or simplified, but it overall follows the way the pre-existing/surrounding code was written.

#28 in reply to: โ†‘ย 18 @pbiron
4 years ago

Replying to audrasjb:

I also took the time to list all those who contributed to the development of this feature from version 0.1.0 to 0.8.0, so they can get props on the first commit of this ticket:

audrasjb, xkon, azaozz, desrosj, pbiron, gmays, pedromendonca, javiercasares, karmatosed, 
mapk, afercia, gmays, knutsp, whodunitagency, passionate, nicolaskulka, bookdude13, whyisjake, 
nielsdeblaauw, mukesh27, wpamitkumar, netweb, afragen, davidperonne, paaljoachim

Thanks y'all for your contributions!

passionate should be passoniate

#29 @whyisjake
4 years ago

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

In 47835:

Security: Add user interface to auto-update themes and plugins.

Building on core update mechanisms, this adds the ability to enable automatic updates for themes and plugins to the WordPress admin.

Fixes: #50052.
Props: afercia, afragen, audrasjb, azaozz, bookdude13, davidperonne, desrosj, gmays, gmays, javiercasares, karmatosed, knutsp, mapk, mukesh27, netweb, nicolaskulka, nielsdeblaauw, paaljoachim, passoniate, pbiron, pedromendonca, whodunitagency, whyisjake, wpamitkumar, and xkon.

โ€‹whyisjake commented on โ€‹PR #281:


4 years ago
#30

Merged!

โ€‹whyisjake commented on โ€‹PR #280:


4 years ago
#31

Merged!

#32 follow-up: @SergeyBiryukov
4 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Great work, everyone! Reopening for some minor cleanup.

Could these two filters use a consistent naming pattern?

  • auto_plugin_update_send_email
  • send_theme_auto_update_email

For reference, here are the other three new filters:

  • auto_plugin_theme_update_email
  • wp_plugins_auto_update_enabled
  • wp_themes_auto_update_enabled

Do the latter two need the wp_ prefix?

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

#33 @SergeyBiryukov
4 years ago

In 47836:

Docs: Add missing @since tag for auto_plugin_theme_update_email filter.

See #50052.

#34 @garrett-eclipse
4 years ago

@SergeyBiryukov 's question mimicks the one I posted to #core-auto-updates, for reference;
โ€‹https://wordpress.slack.com/archives/CULBN711P/p1589999882115000

#35 in reply to: โ†‘ย 32 ; follow-up: @pbiron
4 years ago

Replying to SergeyBiryukov:

Great work, everyone! Reopening for some minor cleanup.

Could these two filters use a consistent naming pattern?

  • auto_plugin_update_send_email
  • send_theme_auto_update_email

For reference, here are the other three new filters:

  • auto_plugin_theme_update_email
  • wp_plugins_auto_update_enabled
  • wp_themes_auto_update_enabled

Do the latter two need the wp_ prefix?

send_theme_auto_update_email should be changed to auto_theme_update_send_email.

For reference, the existing filter for whether to send core auto-update notifications is auto_core_update_send_email. I changed the filter name for plugin auto-update notifications (from what is in the feature plugin) to have that form, but it looks like I just forgot to change the one for themes.

As for the wp_ prefix, they have that prefix in the feature plugin and since there are ALOT of existing filters in core with that prefix I didn't think to remove it. I have no objection to removing it. @audrasjb what do you think?

#36 in reply to: โ†‘ย 35 @audrasjb
4 years ago

As for the wp_ prefix, they have that prefix in the feature plugin and since there are ALOT of existing filters in core with that prefix I didn't think to remove it. I have no objection to removing it. @audrasjb what do you think?

No objection either ๐Ÿ‘

#37 @SergeyBiryukov
4 years ago

In 47840:

Coding Standards: Fix WPCS issues in wp-admin/includes/class-wp-debug-data.php.

Follow-up to [47550], [47557], [47835].

See #50052.

#38 @desrosj
4 years ago

Great work here everyone! Great to see this get merged. I did some testing today, and have a bit of feedback.

First, a bug that I found on the themes page.

  • Click on Theme Details for a theme.
  • Click "Enable auto-updates".
  • Auto-updates are correctly enabled.
  • Close that theme's overlay.
  • Click on Theme Details for the same theme and note that it says "Enable auto-updates" again.
  • Refresh the page and view that theme again to see auto-updates is correctly enabled.

The emails also feel like they are lacking a bit of context. For example, the site is not linked to anywhere in the email. It's also not clear if any action is required when receiving the email, and there's no direction where they should navigate if they experience issues.

I think the first two sentences in the Core update email could be repurposed a bit:

Howdy! Some plugins and/or themes on your site at โ€‹https://site.com have been updated automatically to new versions.

No further action is needed on your part. Here are some helpful links for managing plugins and themes on your site:

It's possible that this could have been discussed previously and I missed it while I was out on leave.

I also agree with @SergeyBiryukov and @pbiron above that send_theme_auto_update_email should be changed to auto_theme_update_send_email and I don't think that the wp_ prefix is necessarily needed.

The filters could also be moved into the if( ! empty( $update_results['type'] ) ) checks. This is probably a micro-optimization, but this would ensure the filters only run when there are actually updates for that filter type.

I'll continue testing and update with anything else I find!

#39 @whyisjake
4 years ago

I missed giving props to @ronalfy on the commit. Going to work that in on an update.

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

#40 @whyisjake
4 years ago

In 47857:

Coding Standards: Change auto-update filters to be more consistent.

  • send_theme_auto_update_email ๐Ÿ‘‰ auto_theme_update_send_email
  • wp_plugins_auto_update_enabled ๐Ÿ‘‰ plugins_auto_update_enabled
  • wp_themes_auto_update_enabled ๐Ÿ‘‰ themes_auto_update_enabled

Want to make sure that @ronalfy gets props for his work in #50052 too.

See #50052.
Props: ronalfy, pbiron, azaozz, audrasjb, whyisjake.

This ticket was mentioned in โ€‹Slack in #core by whyisjake. โ€‹View the logs.


4 years ago

#42 @desrosj
4 years ago

I branched out #50268 for improving the emails.

#43 @whyisjake
4 years ago

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

I am going to close this ticket again since we covered the filter name changes. Future issues, like #50268, can be opened as needed.

#44 @johnbillion
4 years ago

In 48097:

Docs: Corrections and improvements to inline docs related to plugin and theme auto-updates.

See #50052, #49572

#45 @SergeyBiryukov
4 years ago

In 48148:

I18N: Include placeholder in translator comments in wp_get_auto_update_message().

See #50436, #50052.

This ticket was mentioned in โ€‹Slack in #accessibility by afercia. โ€‹View the logs.


4 years ago

#47 @johnbillion
4 years ago

In 48183:

Docs: Clarify the description of functions that check for and perform updates.

See #49572, #50052.

This ticket was mentioned in โ€‹Slack in #design by afercia. โ€‹View the logs.


4 years ago

#49 @afercia
4 years ago

In 48479:

Accessibility: Security: Improves the accessible audible messages for Plugins & Themes Auto-Updates.

  • changes the politeness level of the two error messages introduced in [47835] to assertive
  • remove unnecessary polite parameters as that's the default value

See #50512, #50052.

Note: See TracTickets for help on using tickets.