Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to display notice for required plugins only? #748

Open
danyj opened this issue Jul 8, 2018 · 29 comments
Open

How to display notice for required plugins only? #748

danyj opened this issue Jul 8, 2018 · 29 comments

Comments

@danyj
Copy link

danyj commented Jul 8, 2018

We have a theme that uses different plugins depending on install.
2 plugins are always required other 5

BudddyPress
bbPress
WooCommerce
LayerSlider
Slider Revolution

are only recommended

How can we display notice only for required plugins?

@CreativeDive
Copy link

It's not possible :-)

I've been waiting for a long time for this feature. But unfortunately there are no new releases for a long time by the author. The last one was 2016.

But you can add a workaround with #733

@danyj
Copy link
Author

danyj commented Jul 8, 2018

@CreativeDive I saw your post but I would have to list each plugin and we are dealing with framework here
and some demos might require different plugin.

has_notices on plugin levels would be favorable

	'bbpress'=> array(
		'name'      => 'bbPress',
		'slug'      => 'bbpress',
		'required'  => false,
		'force_activation'   => false,
                 'has_notices' => false
	),

@danyj
Copy link
Author

danyj commented Jul 8, 2018

And even worse is that the notice is yellow for recommended plugins where in fact should be green because they do not affect the theme functionality.

@CreativeDive
Copy link

I'm wondering about envato's decision to treat this plugin as a required plugin for themeforest themes. There are so many issues that make the user experience seem like a nightmare. I also do not understand why there were no new releases in the past.

@danyj
Copy link
Author

danyj commented Jul 8, 2018

I also do not understand why there were no new releases in the past.

#741

im digging in to code for has_notices on plugin level , might submit PR

@CreativeDive
Copy link

@danyj it's really a nightmare :-(

@danyj
Copy link
Author

danyj commented Jul 8, 2018

no is not ,

add here
https://github.com/TGMPA/TGM-Plugin-Activation/blob/develop/class-tgm-plugin-activation.php#L1156

			if(isset($plugin['has_notices']) && false === $plugin['has_notices']){
				
				continue;
			}

in plugin array set

'has_notices' => false

@CreativeDive
Copy link

@danyj But it is a nightmare. I need the notice for required plugins only. With 'has_notices' => false notices will never displayed. It's not the solution.

@danyj
Copy link
Author

danyj commented Jul 8, 2018

bud , I just showed you how to do it on plugin level ,
not global

@danyj danyj closed this as completed Jul 8, 2018
@danyj danyj reopened this Jul 8, 2018
@danyj
Copy link
Author

danyj commented Jul 8, 2018

add the code I advised and in your plugin array ( not $config ) set the has_notices like this

	'bbpress'=> array(
		'name'      => 'bbPress',
		'slug'      => 'bbpress',
		'required'  => false,
		'force_activation'   => false,
		'has_notices' => false // This plugin wont be listed in the notice
	),

@CreativeDive
Copy link

@danyj you are fabulous :-) Yes, it does solve one problem, but the user can dismiss this notice for required plugins. He should not.

So i will use a combination of your and my solution #733

Thanks so much!

@danyj
Copy link
Author

danyj commented Jul 8, 2018

I would not use this on required plugins ,
only on recommended

@danyj
Copy link
Author

danyj commented Jul 8, 2018

And this does not touch any dismiss settings, it simply removes the plugin from the notice array and if there are no plugins in that array no notice is displayed either way.

@CreativeDive
Copy link

CreativeDive commented Jul 8, 2018

@danyj Yes you can use 'force_activation' => true, to activate required plugins after theme activation. Therefore you don't need this notice. But I think it's a user decision to activate plugins. Also the notice should be visible, if the user deactivate a required plugin of a theme.

But the user does not get a notice again if the user has dismissed it in the past.

@danyj
Copy link
Author

danyj commented Jul 8, 2018

Also the notice should be visible, if the user deactivate a required plugin of a them

Not sure what you have setup , but here ,

first 3 required , other recommended
screenshot_1

Assigned Widgets ( required ) disabled and notice showed up

download

@danyj
Copy link
Author

danyj commented Jul 8, 2018

tested dismissable, works as it should

http://take.ms/VmeJQ

@CreativeDive
Copy link

CreativeDive commented Jul 8, 2018

@danyj I don't know what is wrong in my file. But if I dismiss the required plugin notice before activating and deactivate the plugin again, I do not get the notice again.

bildschirmfoto 2018-07-08 um 18 32 33

@CreativeDive
Copy link

@danyj But I means the "Dismiss this notice" link, not the close button.

bildschirmfoto 2018-07-08 um 18 40 29

@danyj
Copy link
Author

danyj commented Jul 8, 2018

I dont see that anymore , http://prntscr.com/k3z1o3

using the actual dev . Watch this please #749

@jrfnl
Copy link
Contributor

jrfnl commented Jul 8, 2018

But if I dismiss the required plugin notice before activating and deactivate the plugin again, I do not get the notice again.

@CreativeDive This is a known bug - see #353, #482

@CreativeDive
Copy link

@danyj I think you can't see it, because you have set 'dismissable' => false, or 'dismissable' => '',

@jrfnl Thanks for the response. Yes I know, it's a bug. But it's not fixed and ready for a new release. Why?

@jrfnl
Copy link
Contributor

jrfnl commented Jul 8, 2018

@CreativeDive Because it's darn bloody complex to fix. You're welcome to have a go.

@CreativeDive
Copy link

@jrfnl If my knowledge were sufficient, I would like to help. But they do not do it. I love ❤️this plugin, but this bug is a nightmare for the user experience. 🤕

@Tofandel
Copy link

Tofandel commented Aug 1, 2018

The recommended plugins shouldn't be green, I think the required should be red and the optionnal yellow..

I just have a question, why would you have suggested plugins in the list if you don't want to show the notice ?

The user cannot install them without the notice so they might as well not be in the list,
or do you have your plugin using this array to display recommended plugins somewhere ?

Thanks for the clarification

@danyj
Copy link
Author

danyj commented Aug 1, 2018

why would you have suggested plugins i

Recommended and required should not belong to same array. We dont have only recommended ones , if that were the case we would not bother but we have 3 required and depending on demo we have recommended. Recommended do not have to be used for theme to function properly.

The user cannot install them

yes user can still install recommended plugins http://prntscr.com/kddhle

@Tofandel
Copy link

Tofandel commented Aug 1, 2018

Ok thanks for the clarification and forgive my ignorance, I didn't know this menu was here

@danyj
Copy link
Author

danyj commented Aug 1, 2018

Don't worry about it, all valid questions.
Things is that users HATE the popups , and one theme can recommend 5 so with yellow notice and no distinction between recommended and required users thik this guy wants me to install dozen of plugins for this theme. Hope this makes sense.

@Tofandel
Copy link

Tofandel commented Aug 1, 2018

Ah yeah I got what your saying, I have the same issue indeed, some users think all the recommended plugins are required and install everything, while only one is required, and 2 are recommended

@danyj
Copy link
Author

danyj commented Aug 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants