• I recently updated to WP-Fail2ban 4.2.2 and my previously recognised constants are no longer visible in the WP-fail2ban settings window.

    The settings are either blank even though they have defined constants, or they are using the default WP-fail2ban constants. I am running PHP 7.2. I am bit confused as to why this is happening and I wouldn’t mind rolling back WP-Fail2ban to the last version that worked for me. If that is an option.

    • This topic was modified 5 years, 10 months ago by overturn.
    • This topic was modified 5 years, 10 months ago by overturn.
Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author invisnet

    (@invisnet)

    I’d need to see what your settings are – can you share them here, or if there’s something private in there (proxies, blocked users, etc) email them to me?

    Thread Starter overturn

    (@overturn)

    Thanks for the reply. My settings are quite generic:

    define(‘WP_FAIL2BAN_BLOCK_USER_ENUMERATION’, true);
    define(‘WP_FAIL2BAN_BLOCKED_USERS’, [‘admin’, ‘another’, ‘user’, ‘administrator’]);
    define(‘WP_FAIL2BAN_LOG_PASSWORD_REQUEST’, true);
    define(‘WP_FAIL2BAN_LOG_PINGBACKS’, true);

    I have the same issue on two identically built websites.

    Plugin Author invisnet

    (@invisnet)

    Those work fine for me. I don’t know if it’s something that got added when you did a copy/paste, but the single quotes in your defines (‘) aren’t really single quotes (‘) – if that’s what you’ve got in wp-config.php then it won’t work.

    Thread Starter overturn

    (@overturn)

    I think that is a formatting issue here. My entire wp-config.php file has those single quotes for wordpress and other plugins with no issues.

    As a sanity check i removed all the constants, type one single constant in a text editor and pasted it into wp-config.php. It still does not show in wp-fail2ban. WP-Fail2ban only has the User Enumeration web document link when you view it in wp-fail2ban -> settings -> users.

    This is the current sole wp-fail2ban constant in my wp-config.php file

    define(‘WP_FAIL2BAN_BLOCK_USER_ENUMERATION’, true);

    Thread Starter overturn

    (@overturn)

    Ah yes it’s definitely a formatting issue here. The single quotes in my above message do not match what was in the text box before i submitted it.

    Plugin Author invisnet

    (@invisnet)

    Not sure what else to suggest – does enabling WP_DEBUG give any clues?

    Thread Starter overturn

    (@overturn)

    I think i know what the issue might be, i will report back in a few mins

    Thread Starter overturn

    (@overturn)

    The issue is version 4.2.2, here is how i came to the conclusion:

    I did not touch the wp-config.php constants that were not working with V4.2.2, this was left as is.
    I uninstalled WP-Fail2ban v4.2.2 and then installed an old backup i had of WP-Fail2ban v4.0.2.
    In version v4.0.2 the constants are being picked up and reflected in the settings.

    • This reply was modified 5 years, 10 months ago by overturn.
    Plugin Author invisnet

    (@invisnet)

    Unfortunately, that doesn’t give me any new information to work with. There has to be something unique about your system or configuration, but without an error from WP_DEBUG or some other information – even a screenshot – there’s nothing more I can do.

    Thread Starter overturn

    (@overturn)

    I am now currently on wp-fail2ban v4.2.2 and i am not getting anything come up in the php log using the define(‘WP_DEBUG’, true); constant.
    However i can see this error repeated a lot in the logs, when i downgraded to v4.0.2 earlier during my test:

    Use of undefined constant ‘WP_FAIL2BAN_BLOCK_USER_ENUMERATION’ – assumed ‘‘WP_FAIL2BAN_BLOCK_USER_ENUMERATION’’ (this will throw an Error in a future version of PHP) in /var/www/wp-config.php on line 99″

    • This reply was modified 5 years, 10 months ago by overturn.
    Plugin Author invisnet

    (@invisnet)

    OK, that makes a bit more sense. That error isn’t directly to do with WPf2b – it’s a PHP error that means the syntax of that define() is wrong, and coincidentally, exactly the same error you’d get if the quotes were the wrong kind….

    • This reply was modified 5 years, 10 months ago by invisnet.
    Thread Starter overturn

    (@overturn)

    Wow you did suggest that initially. There is must be something going on with my formatting. I will restore my wp-config file and start again with the constants. Thanks

    Hi,

    Encountered a similar problem (WP_FAIL2BAN_PROXIES wasn’t recognized and not showing on the options page).

    After commenting out the _load function for this variable in lib/loader.php it was working fine, something you might want to check.

    Thanks!

    Thread Starter overturn

    (@overturn)

    Thanks @sjhand
    I will try this later today. I kind of gave up on the plugin to be honest. Sanity check after sanity check confirm the issue wasn’t my single quotes.

    Plugin Author invisnet

    (@invisnet)

    @overturn and @sjhand – any chance you could give me some more system details?

    I can’t reproduce any of these issues on a completely standard DigitalOcean WordPress droplet.

    Clearly there’s something odd going on and I’d like to work out what it is – any more information you can provide would be appreciated.

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Settings page blank & not referencing wp-config constants’ is closed to new replies.