• Resolved moxymore

    (@moxymore)


    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support chandelierrr

    (@shanedelierrr)

    Hi @moxymore, thank you for reaching out!

    I understand that Solid Security’s automatic writing is causing a conflict with your website setup. I’ve relayed this to our development team to see if this is something we can fix, and I’ll update you here once I receive feedback.

    For now, the alternative solution is to turn OFF the “Write to Files” setting in?Security > Global Settings to prevent the plugin from automatically writing to the server files and avoid crashes. Instead, manually add the plugin’s rules to your wp-config.php and .htaccess files. You can see the generated rules in Security > Tools > wp-config.php Rules and Server Config Rules. You can find?here?what features are enforced by?.htaccess (block and ban lists will still be enforced by the plugin even if Write to Files is disabled).

    Let me know if this works!

    Thread Starter moxymore

    (@moxymore)

    Allright, thanks for the answer. For sure it will work by copy/pasting the generated lines, but in a future I expected your plugin to put these lines under the first (let’s say) 10 lines. It’s totally doable, because native PHP functions allows you to analyse breaking lines.

    Regards.

    • This reply was modified 11 months, 3 weeks ago by moxymore.
    Plugin Support chandelierrr

    (@shanedelierrr)

    Hi @moxymore, thank you for the feedback!

    I’m happy to inform you that this request has been added to our feature request list, and our team has noted your suggestions. Still, we can’t provide a confirmation or ETA of the implementation since there are factors in place that we must consider.

    Thank you for understanding, and we appreciate your input as we continually work to enhance the plugin’s features! Please feel free to open a new thread if you need help with our plugin!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘This is annoying (automatic write in wp-config.php)’ is closed to new replies.