Skip to content
This repository has been archived by the owner on May 29, 2020. It is now read-only.

Commit

Permalink
Prevent mis-match between count in Auto-updates Enabled view and the …
Browse files Browse the repository at this point in the history
…number of plugins displayed for that view by applying 'all_plugins' filter before computing that count.

Fixes #50.
  • Loading branch information
pbiron committed Mar 16, 2020
1 parent a04b1ae commit 3dc0f9e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion wp-autoupdates.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,10 @@ function wp_autoupdates_plugins_status_links( $status_links ) {
return $status_links;
}

/** This filter is documented in wp-admin/includes/class-wp-plugins-list-table.php */
$all_plugins = apply_filters( 'all_plugins', get_plugins() );
$wp_autoupdate_plugins = get_site_option( 'wp_auto_update_plugins', array() );
$wp_autoupdate_plugins = array_intersect( $wp_autoupdate_plugins, array_keys( get_plugins() ) );
$wp_autoupdate_plugins = array_intersect( $wp_autoupdate_plugins, array_keys( $all_plugins ) );
$enabled_count = count( $wp_autoupdate_plugins );

// when merged, these counts will need to be set in WP_Plugins_List_Table::prepare_items().
Expand Down

0 comments on commit 3dc0f9e

Please sign in to comment.