TGMPA / TGM-Plugin-Activation

TGM Plugin Activation is a PHP library that allows you to easily require or recommend plugins for your WordPress themes (and plugins). It allows your users to install, update and even automatically activate plugins in singular or bulk fashion using native WordPress classes, functions and interfaces. You can reference bundled plugins, plugins from the WordPress Plugin Repository or even plugins hosted elsewhere on the internet.
http://tgmpluginactivation.com/
GNU General Public License v2.0
1.76k stars 429 forks source link

Don't prompt for plugin updates #489

Open ollietreend opened 9 years ago

ollietreend commented 9 years ago

Hi,

It would be great to have an configuration option which disables the 'There is an update available' prompt for plugins. It would be even better if this could be selectively disabled, based on whether the user has permission to install plugin updates.

One problem I'm currently faced with is that I have non-administrator users using the WordPress admin interface. If there are updates available for required plugins, they see a prompt which says 'Sorry, but you do not have the correct permissions to update the [...] plugin.'

This message appears at the top of every page for my non-administrator users, until an administrator logs in and performs the necessary updates. Not only is the wording of this message confusing for users – because it suggests that the user has tried to perform an action (update plugins) which they didn't – but it also adds an annoying nag which appears at the top of every page.

Screenshot of update nag

In this screenshot I am logged in as an Editor. I have simply loaded the 'All Pages' list, and haven't attempted to perform any plugin updates. But I am greeted with a warning message to tell me that I don't have permission. This is not a good user experience.

I've looked into the TGM class to resolve this, but I can't see any convenient actions or filters for me to hook in to. Nor can I find a configuration option to disable update nags.

Your thoughts and ideas for implementation would be great. I'm thinking either a configuration option, or the ability to hook into a filter (or even both) would provide suitable flexibility. Beyond that, perhaps there is no need to show the 'Sorry' message at all when a user doesn't have permission to perform updates – after all, they didn't try to install anything, so why should they see the message?

jrfnl commented 9 years ago

Related #414

cjgrasso commented 8 years ago

This was posted a year ago, is there any update on this? Every user role is getting the plugin installation and activation nags even though these should only be showed to administrators.

thanks

jrfnl commented 8 years ago

@cjgrasso A lot was done - see PR #507.

cjgrasso commented 8 years ago

@jrfnl thank you for the help.

paulcanning commented 5 years ago

@jrfnl how do i actually go about disabling these notices for non-super-admins?

jrfnl commented 5 years ago

@paulcanning You hook into the tgmpa_show_admin_notice_capability filter and return a different capability.

See the first bullet in Enhancements in the TGMPA 2.6.0 changelog, as well as the detailed description in PR #507.

Does that answer your question ?