When I setup my environment the way I want, I configure it beforehand with configs which I prefer.
Installing and visiting DevKits, automatically inserts these variables without permission or acknowledgement. Thats why I get the error that they are already defined.
define( 'WP_DEBUG_LOG', true);
define( 'WP_DEBUG_DISPLAY', true);
define( 'SCRIPT_DEBUG', true);
define( 'SAVEQUERIES', true);
I use the official docker WordPress image. https://hub.docker.com/_/wordpress
It lets you define extra variables via the env variable:
WORDPRESS_CONFIG_EXTRA=''
What I would expect is to have something like this or have a check before injecting if they exist already.
defined('WP_DEBUG_LOG') || define( 'WP_DEBUG_LOG', false );
defined('WP_DEBUG_DISPLAY') || define( 'WP_DEBUG_DISPLAY', false );
defined('SCRIPT_DEBUG') || define( 'SCRIPT_DEBUG', false );
defined('SAVEQUERIES') || define( 'SAVEQUERIES', false );
The bigger problem is that they stay active because in my docker config they are always set to active. When I try turning it off, it modifies the value in the wp-config.php file to the correct value but it gets ignored because of the previous defined constant by me.
Maybe if they are already defined set the checkbox toggles to disabled with a hint that they are already defined. Any modification wouldn't have any effect anyway.
It is not enabled by default, you are the one who can enable it from the settings. Kindly check the docs.
Regards,
Arshad
DPlugins Support
It is enabled by me that is true (thats why they are switched on) but it also lets me click on the toggles which injects these lines. When I try to disable it I get these warning that the constants are already defined.
Disabling the toggles when the constants are already defined by the user would be better because toggling it off won’t remove the injected lines. I would have to do it manually.
This is solved in development. It will be available with the next release.
Regards,
Arshad
DPlugins Support
Great to hear, thanks!
The plugin now respects already defined constants. This solves the issue not receiving the warning of duplicate constant definitions.
You can still use the toggle but it does basically nothing which is expected. However sometimes configs can be more complex and having an explanation on why nothing is happening when I use this toggle, would be more transparent for the user. Or explaining why the toggle flips back when I reload the page but this is of course subjective and up to you. 🙂
If the CONSTANTs defined elsewhere, then mostly it is known to developer/user already, he then didn’t even try to use our feature.
There is no need to show explanation anymore. Closing this feature request as fulfilled, and the ticket as well.
Regards,
Arshad
DPlugins Support