Disable plugins by config

I want to wake this up old topic again. I still vote for a config to disable plugins of choice.

A new take on why it can be beneficial is that different environments may have different needs.

An example

config.localhost.php

c::set('kirby.disable.plugins', ['kirby-html-minifier', 'kirby-ga']); 

config.yourdomain.com.php

c::set('kirby.disable.plugins', ['kirby-panel-brand']); 

Benefits

  • For two of the plugins, I’ve built in an option to disable them already. Unfortunately, far from all plugins a disable feature.
  • In the config.php, It’s much simpler to have one option to control all the plugins, than having a unique config for every plugin that supports disabling.
  • Imagine 300+ plugins with the support for a disable option. Compare the extra code and work to if it was done in the core 1 time.

Sources: