This is annoying (automatic write in wp-config.php)
-
Hi,
Solid Security Plugin sometimes writes lines in our wp-config.php. No problem for me… except if it forces these lines to be added at the beginning of the file !
I’m a professionnal developper using the vinkla/wordplate repository to build my WP websites. This repository changes the structure of the project (files/folders) and uses a .env file to secure the whole thing. On top of that, he needs to have at its first wp-config.php line this declaration :declare(strict_types=1);
You know that this line MUST be on top of the file (if you don’t do so, you got a fatal error). But because Solid Security plugin inject this code without checking anything, the vinkla/wordplate declaration appears in second position and then a fatal error happens.
// BEGIN iThemes Security - Do not modify or remove this line // iThemes Security Config Details: 2 define( 'DISALLOW_FILE_EDIT', true ); // Disable File Editor - Security > Settings > WordPress Tweaks > File Editor // END iThemes Security - Do not modify or remove this line
The most annoying thing with this behavior is that it doesn’t check if this constant is already defined or not. And it is in my original wp-config.php, which create a second problem : I have to to put a :
if(!defined('DISALLOW_FILE_EDIT')) { define('DISALLOW_FILE_EDIT', env('DISALLOW_FILE_EDIT', true)); }
… because a constant can’t be declared 2 times.
The result is that each 30 minutes during my local development, I have to rearrange these things. For sure I can disable the plugin in developement stage, but what will happen in production soon ?
We really need a fix for it :
– Your code should inject this constant only if no line about this constant is found in our wp-config.php file
– And moreover it shouldn’t force to write it on top of the file.
Regards.
- The topic ‘This is annoying (automatic write in wp-config.php)’ is closed to new replies.