• Hello,

    after moving my website from server A to B, I wanted to install the Ninja Firewall again. It gets installed but I get this error upon activating it:

    Plugin could not be activated because it triggered a?fatal error.

    I checked the PHP log files and I see these errors:

    [28-Sep-2024 11:09:00 UTC] PHP Fatal error: Uncaught Error: Undefined constant "NFW_RULES" in /var/www/website/public_html/wp-content/plugins/ninjafirewall/lib/install_default.php:171
    Stack trace: 0 /var/www/website/public_html/wp-content/plugins/ninjafirewall/ninjafirewall.php(161): nfw_load_default_conf() 1 /var/www/website/public_html/wp-includes/class-wp-hook.php(324): nfw_activate(false) 2 /var/www/website/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) 3 /var/www/website/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) 4 /var/www/website/public_html/wp-admin/includes/plugin.php(703): do_action('activate_ninjaf…', false) 5 /var/www/website/public_html/wp-admin/plugins.php(60): activate_plugin('ninjafirewall/n…', 'https://ivansal…', false) 6 {main}
    thrown in /var/www/website/public_html/wp-content/plugins/ninjafirewall/lib/install_default.php on line 171

    What is the problem?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author nintechnet

    (@nintechnet)

    I can’t reproduce the problem.
    Did you try to uninstall it and then to reinstall it ?
    Make sure to remove any line in your PHI INI (.user.ini) file when you reinstall it, just in case.

    Thread Starter Ivan Salloum

    (@ivansalloum1)

    I uninstalled it before the migration to ensure no 500 error code.

    I re-installed it after the migration but I can’t activate it. There is no .user.ini file, it is deleted. I can’t activate the plugin, I get the same error.

    Plugin Author nintechnet

    (@nintechnet)

    Can you run the troubleshooter script: https://nintechnet.com/share/wp-check.txt

    1. Rename it to “wp-check.php”.
    2. Upload it into your WordPress root folder.
    3. Go to https://YOUR WEBSITE/wp-check.php
    4. Delete it afterwards.

    Hi!

    I got exactly the same problem today, move my website and being unable to activate NinjaFirewall. I deleted the whole folder from the plugins folder and installed NinjaFirewall again afterwards, but not success.

    [09-Oct-2024 13:06:16 UTC] PHP Fatal error:  Uncaught Error: Undefined constant "NFW_RULES" in /home/website/domains/website.nl/public_html/wp-content/plugins/ninjafirewall/lib/install_default.php:171
    Stack trace:
    #0 /home/website/domains/website.nl/public_html/wp-content/plugins/ninjafirewall/ninjafirewall.php(161): nfw_load_default_conf()
    #1 /home/website/domains/website.nl/public_html/wp-includes/class-wp-hook.php(324): nfw_activate()
    #2 /home/website/domains/website.nl/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #3 /home/website/domains/website.nl/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 /home/website/domains/website.nl/public_html/wp-admin/includes/plugin.php(703): do_action()
    #5 /home/website/domains/website.nl/public_html/wp-admin/plugins.php(60): activate_plugin()
    #6 {main}
    thrown in /home/website/domains/website.nl/public_html/wp-content/plugins/ninjafirewall/lib/install_default.php on line 171

    Here is the result from the wp-check.php file:

    NinjaFirewall (WP edition) troubleshooter
    HTTP server : LiteSpeed
    PHP version : 8.3.11
    PHP SAPI : LITESPEED

    auto_prepend_file : none
    wp-config.php : found in /home/website/domains/website.nl/public_html/wp-config.php
    NinjaFirewall detection : NinjaFirewall is not loaded

    Loaded INI file : /opt/alt/php83/etc/php.ini
    user_ini.filename : .user.ini
    user_ini.cache_ttl : 300 seconds
    User PHP INI : none found

    DOCUMENT_ROOT : /home/website/domains/website.nl/public_html
    ABSPATH : /home/website/domains/website.nl/public_html/
    WordPress version : 6.6.2
    WP_CONTENT_DIR : /home/website/domains/website.nl/public_html/wp-content
    Plugins directory : /home/website/domains/website.nl/public_html/wp-content/plugins
    User Role : Administrator
    User Capabilities : manage_options: OK - unfiltered_html: OK
    Log dir permissions : /home/website/domains/website.nl/public_html/wp-content/nfwlog dir is writable
    Cache dir permissions : /home/website/domains/website.nl/public_html/wp-content/nfwlog/cache dir is writable
    Configuration & Rules :
    * Options: not found

    * Rules: not found

    NinjaFirewall (WP edition) troubleshooter v1.10

    Thank you!

    • This reply was modified 1 month, 2 weeks ago by janij. Reason: Additional information
    Plugin Author nintechnet

    (@nintechnet)

    Can you run this script: https://nintechnet.com/share/ninja-connect.txt
    1. Rename it to “ninja-connect.php”.
    2. Upload it into your website root folder.
    3. Go to https://YOUR WEBSITE/ninja-connect.php
    4. Delete it afterwards.

    That will check if your site can connect to download the rules during the installation process.

    Didn’t change a thing after my last message, but just now I managed to activate the plug-in.

    After it I did try the ninja-connect.php file and got this back:

    Attempting to connect to:
    * updates.nintechnet.com/index.php (HTTPS): OK
    * wordpress.nintechnet.com/index.php (HTTPS): OK
    * pro.nintechnet.com/index.php (HTTPS): OK
    * api.nintechnet.com/test (HTTPS): OK
    * plugins.svn.www.ads-software.com/ninjafirewall/updates/version3.txt (HTTPS): OK


    NinjaFirewall (WP/WP+/Pro/Pro+ editions) connection test script v1.3

    Don’t know what changed since last time, but the problem is fixed for me now.

    SHAO

    (@shao0922)

    I encountered the same issue. After deleting /wp-content/nfwlog, I was able to activate it properly.

    I got the very same problem. Would be great if there would be a fix sometime? Have to move websites from one server to another server fromt time to time.

    This problem seems to be new, because otherwise a migration usually went smoothly (deactivate full-WAFF mode, deactivate Ninja Firewall and uninstall. After the migration, reinstalling the Ninja Firewall always went smoothly)

    Edit: After deleting /wp-content/nfwlog, I was able to activate it properly. Thanks SHAO!!!

    Plugin Author nintechnet

    (@nintechnet)

    I’m currently looking at it.
    The issue seems very new but the code where the error occurred hasn’t been changed for years.

    Plugin Author nintechnet

    (@nintechnet)

    I found the problem. I will be fixed in the next release.

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