• Resolved eddyferns

    (@eddyferns)


    After updating and activating the plugin I get the following warning message above the Dashboard area:

    Warning: file_put_contents(): Exclusive locks are not supported for this stream in /var/sites/t/test.xyz.com/public_html/wp-content/plugins/ninjafirewall/lib/nfw_misc.php on line 184

    If I deactivate the plugin the message goes away.

    Also the following warning messages showed up immediately after updating the plugin:

    Warning: file_put_contents(): Exclusive locks are not supported for this stream in /var/sites/t/test.xyz.com/public_html/wp-content/plugins/ninjafirewall/lib/nfw_misc.php on line 366

    Warning: file_put_contents(): Exclusive locks are not supported for this stream in /var/sites/t/test.xyz.com/public_html/wp-content/plugins/ninjafirewall/lib/nfw_misc.php on line 367

    Regards,
    Ed

    https://wordpress.org/plugins/ninjafirewall/

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

    (@nintechnet)

    Hi,

    What kind of hosting do you have? It does not seem to support exclusive locks, hence the first warning (line 184):

    $tmp = file_put_contents( $nfdbhash, md5( serialize( $adm_users) ), LOCK_EX );

    Note that adding a ‘@’ at the beginning of ‘file_put_contents’ should prevent any warning:

    $tmp = @file_put_contents( $nfdbhash, md5( serialize( $adm_users) ), LOCK_EX );

    I don’t understand too much the last 2 errors referring to lines 366 and 367, because the /ninjafirewall/lib/nfw_misc.php script has only 250 lines.

    Thread Starter eddyferns

    (@eddyferns)

    Taken the matter to the hosting company. They have eliminated the warning message by doing the following:

    Replaced instances of LOCK_EX to LOCK_SH in the file specified in the error.

    Have they done it right?

    Regards,
    Ed

    Plugin Author nintechnet

    (@nintechnet)

    It is not too much important, your file system does not support exclusive locks, and the shared one (LOCK_SH) isn’t really useful.
    I will make some changes to the next version in order to get rid of the warning message.

    Thread Starter eddyferns

    (@eddyferns)

    Does the firewall becomes deficient when there are no exclusive locks?

    Plugin Author nintechnet

    (@nintechnet)

    The firewall will keep working as usual.
    Exclusive locks are used to prevent race condition: when an application writes to a file, it locks it so that no other instance of that application (or another app) can write to it at the same time.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Warning messages after when updating plugin’ is closed to new replies.