How to auto enable a plugin after install? I am developing a plugin for craft 3 and the plugin just got published to the store.
I can browse through the store and install the plugin but it stays disabled. The user will have to goto Settings -&gt; Plugins and then manually enable the plugin even after installing. Is there a way to auto enable the plugin after install?
It's because the plugin is doing this in the init():
https://github.com/poptins/craftcms-poptin-app/blob/master/src/Poptin.php#L69-L74
That's basically overwriting Craft's default Project Config settings for a plugin (which is to be enabled).
https://github.com/craftcms/cms/blob/develop/src/services/Plugins.php#L536-L545
If you keep it there, then you'll have to explicitly set it to enabled in Project Config as well, but ideally, you'll want to move that logic out of init() and into something like an EVENT_AFTER_INSTALL_PLUGIN event.