Custom Code Stripped when running Setup Wizards

Home Forums BulletProof Security Pro Custom Code Stripped when running Setup Wizards

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #42123
    Living Miracles


    We’ve run into a situation recently where code saved in the BPS Pro Custom Code section of the plugin unexpectedly gets stripped when running the BPS Pro Setup Wizards

    As part of a recent website sweep, we changed the “display_errors” PHP variable from “Yes” to “No” on the hosting platform for all our WordPress websites. When changing this variable, a new php.ini file in the website root was created and two lines of custom code were directly added to the .htaccess file by SiteGround.

    This is immediately caught by BPS Pro as expected, and we get a warning message that there is code in our .htaccess file that is not included in the Custom Code area of BPS Pro. We ran the Setup Wizard to reset BPS Pro so that the new file is not quarantined and the direct modifications to the .htaccess file are accepted. However, when we run the setup wizard, we notice that all the custom code that was saved in BPS Pro > Custom Code > Root htaccess File Custom Code is stripped except for Box #1, where the modification occurred. That is, boxes 2-14 are completely empty and contain no saved code. However, when we change the PHP variable, and do not run the setup wizards immediately after, the custom code stays present if we manually add the two lines to Custom Code Box #1 and wait to restore the new php.ini file from quarantine.

    Essentially, what I take away from these scenarios is that it seems like there may be an unexpected behavior in BPS Pro where if the setup wizards are run right after a direct modification to the .htaccess file (without using the BPS Pro Custom Code boxes), the setup wizards permanently delete all the stored code in the Custom Code Boxes #2-14. Are you aware of why this may be happening, and could this issue be fixed when you have time?

    Thanks for taking a look at this!

    AITpro Admin

    Currently there are no bugs in Custom Code. So post the code that you are trying to add.  Maybe the code itself is causing this problem.

    Living Miracles

    Hm, that’s curious.

    The two lines added directly to .htaccess were:

    # PHP/php.ini handler htaccess code
    SetEnv PHPRC /XXXXXXXX/public_html/php.ini

    Additionally, a small file named “php.ini” was added to our public_html folder. This file contained 2 lines of code as well:

    display_errors = Off
    zend_extension = <full_path_to_extension_so_file>

    These were the only two changes made before we ran the Setup Wizards and noticed that the Custom Code boxes #2-14 were empty. Box #1 was fine, and the first block of code above was added automatically to the top of Box #1 in the Custom Code area after the Setup Wizards finished running. Does any of this help clarify what might be happening?

    AITpro Admin

    The only logical explanation I can think of is there never was any code in Custom Code text boxes 2-14.  Send me a WP Admin login to this site to:

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.