[wp-trac] [WordPress Trac] #49151: Show a warning for plugins in WP admin that haven't received updates in a long time
WordPress Trac
noreply at wordpress.org
Tue Jul 7 00:58:37 UTC 2020
#49151: Show a warning for plugins in WP admin that haven't received updates in a
long time
-------------------------------------+-------------------------------------
Reporter: vincenthasselgard | Owner: audrasjb
Type: feature request | Status: accepted
Priority: normal | Milestone: 5.5
Component: Plugins | Version:
Severity: normal | Resolution:
Keywords: has-screenshots has- | Focuses: ui, administration,
patch | ui-copy
-------------------------------------+-------------------------------------
Comment (by elrae):
@stuffradio - I didn't have enough time earlier to investigate fully but
have had some more time to look into this. We can leverage the plugins_api
function to help reduce the amount of code you've written. A few more
pointers on the code:
add `include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; // For
plugins_api().` above line 830. This will let us use the plugins_api
function.
Then later in the foreach loop we could do something like
`$plugin_slug = explode( '/', $plugin_path );
$plugin_info = plugins_api('plugin_information',
array('slug' => $plugin_slug[0]));`
and that will expose $plugin_info->last_updated which we can use to output
the last updated.
I'm not sure if we need the `&& ! array_key_exists( $plugin_path,
$plugin_updates )` restriction on the display, that's just basically
saying if there is a plugin update then don't display the last time it was
updated. But just because you have a plugin update available doesn't mean
the update that is available is new, so I think we should remove that.
We may also want to include this check in the MU plugins section, since an
MU plugin could be one from the repo and plugins can tap into the
plugins_api to add their info.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49151#comment:27>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list