• Resolved barnez

    (@pidengmor)


    Have you had any reports of a fatal error on update to v.4.6? The update has failed on one site with the following error logged:

    [12-Aug-2024 07:24:47 UTC] Automatic updates starting...
    [12-Aug-2024 07:24:47 UTC] Automatic plugin updates starting...
    [12-Aug-2024 07:24:47 UTC] Upgrading plugin 'ninjafirewall'...
    [12-Aug-2024 07:24:48 UTC] Plugin 'ninjafirewall' has been upgraded.
    [12-Aug-2024 07:24:50 UTC] Scraping home page...
    [12-Aug-2024 07:24:50 UTC] PHP Fatal error: Cannot declare class NinjaFirewall_helpers, because the name is already in use in /home/xxxx/public_html/xxxx.xx/wp-content/plugins/ninjafirewall/lib/class-helpers.php on line 14
    [12-Aug-2024 07:24:50 UTC] '###### wp_scraping_result_start:4078c5eca0f71757fdb579d39ceab152 ######
    {"type":"64","message":"Cannot declare class NinjaFirewall_helpers, because the name is already in use","file":"wp-content\\/plugins\\/ninjafirewall\\/lib\\/class-helpers.php","line":"14"}
    ###### wp_scraping_result_end:4078c5eca0f71757fdb579d39ceab152 ######
    '
    [12-Aug-2024 07:24:51 UTC] The update for 'ninjafirewall' contained a fatal error. The previously installed version has been restored.
    [12-Aug-2024 07:24:51 UTC] Automatic plugin updates complete.
    [12-Aug-2024 07:24:51 UTC] Automatic updates complete.

    I have tried disabling all other plugins and enabling a Twenty^ theme, but the update still fails with the same error. Another site on the same server has updated to v.4.6 without any issues. There are three issues in Site Health:

    An active PHP session was detected
    The REST API encountered an error
    Your site could not complete a loopback request

    But these appear to be browser-cache related, as when I open the back-end in a private browser window, they do not appear in Site Health. If I try to update NinjaFirewall in that same private browser session with no Site Health issues, I again get: “Plugin could not be activated because it triggered a fatal error“.

    The page I need help with: [log in to see the link]

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

    (@nintechnet)

    Another person had the same issue: https://www.ads-software.com/support/topic/update-to-4-6-generates-a-fatal-error/
    But I can’t reproduce it yet.

    Plugin Author nintechnet

    (@nintechnet)

    Do you have another website in a parent folder with NinjaFirewall installed ?

    Thread Starter barnez

    (@pidengmor)

    Do you have another website in a parent folder with NinjaFirewall installed ?

    Yes! The website in the parent folder has NinjaFirewall installed and updated to 4.6 without any problems. There are two sites in child folders with NinjaFirewall installed. Site A updated to 4.6, but Site B has the problem described above.

    Plugin Author nintechnet

    (@nintechnet)

    Can you run this code on site B ? Create a script named ‘test.php’, and add this code:

    <?php
    header('Content-type: text/plain');
    require 'wp-config.php';
    $res = get_declared_classes();
    foreach( $res as $class ) {
    if ( $class == 'NinjaFirewall_helpers') {
    echo "NinjaFirewall_helpers is declared\n";
    }
    }

    Go to https://site B/test.php. Does it display the “NinjaFirewall_helpers is declared” message?

    Thread Starter barnez

    (@pidengmor)

    Yes, the “NinjaFirewall_helpers is declared” message is returned.

    Plugin Author nintechnet

    (@nintechnet)

    The child site inherits the parent site’s classes declaration. That’s very annoying.
    Can you try that new version: https://nintechnet.com/ninjafirewall.4.6.zip

    Thread Starter barnez

    (@pidengmor)

    Perfect. The new version activates on the child site without any problems at all. Thanks!

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