NinjaFirewall (WP edition)
[resolved] "wp-content" is hard-coded in the code (5 posts)

  1. theiceman.blog
    Posted 1 year ago #

    Based on better-wp-security plugin I changed the wp-content dir name on my WP installation. this prevent from NinjaFirewall to work properly and it not allowing me to finish the installation.


  2. nintechnet
    Plugin Author

    Posted 1 year ago #

    Do you mean that you changed WP_CONTENT_DIR while NinjaFirewall was already installed ?
    If you did so, then you need to modify the full path to the firewall.php file in your PHP ini file. Or delete the lines from PHP ini and .htaccess, uninstall and re-install it all.
    Otherwise, there is no problem to install it if you have a different WP_CONTENT_DIR, because the installer relies on the WP plugin_dir_path() function which will return the correct path.
    The 'wp-content' hard-coded string affects only some rules from the "Firewall > Policies" menu (that was fixed in the 1.1.2 version that will be released later this week) but does not affect the installation or the firewall.

  3. theiceman.blog
    Posted 1 year ago #

    Thank you for you answer, i did removed the plugin and reinstall it again, and it did work for me now. (I think i forgot to restart apache)

    but still some of the code dose mention wp-content as fixed string

    grep -n wp-content *

    ninjafirewall.php:1833: $tmp .= '/wp-content/uploads/|';
    ninjafirewall.php:1848: $nfw_options['no_post_themes'] = '/wp-content/themes/';
    ninjafirewall.php:1996: '/wp-content/uploads/|/cache/';

  4. nintechnet
    Plugin Author

    Posted 1 year ago #

    The wp-content strings were removed in the next version 1.1.2. This new update will be available later this week.

  5. theiceman.blog
    Posted 1 year ago #

    Thank you for your help

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • NinjaFirewall (WP edition)
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic