• edmondox

    (@edmondox)


    We have a number of sites showing the error message “iThemes Security Pro requires WordPress 5.4 or later” all of which are already on 5.4, and don’t have the Pro version installed. The iThemes Security plugin is listed as ‘active’ under Plugins but there is no main menu item or access to settings.

    We have the WP upgrade scheduled but in the interim need to fix the bug in iThemes Security. Any idea what’s wrong with it?

Viewing 7 replies - 1 through 7 (of 7 total)
  • nlpro

    (@nlpro)

    The fact that the error mentions iThemes Security Pro is a bug (in the main better-wp-security.php file) which I also noticed recently.

    Before the plugin is initialized there are 2 checks performed. One for using PHP >= 5.6, and the other for using WordPress >= 5.4 (in this order).

    If either check fails a callback with an error msg is hooked to the admin_notices action hook and plugin execution is stopped. At that point the plugin is activated but non functional (and showing the relevant error notice(s)).

    The WordPress version check looks like this:

    if ( version_compare( $GLOBALS['wp_version'], '5.4.0', '<' ) ) {

    So for debugging purposes you could add a quick $GLOBALS[‘wp_version’] check to the better-wp-security.php file like this:

    add_action( 'admin_head', 'show_wordpress_version' );
    
    function show_wordpress_version() {
    echo '<script type="text/javascript">console.log(\'WordPress version: ' . $GLOBALS['wp_version'] . '\')</script>';
    }
    

    These lines can best be added just before the WordPress version check.
    The output is written to the browser (Javascript) console like this:

    WordPress version: 5.x.x

    To prevent any confusion, I’m not iThemes.

    • This reply was modified 4 years ago by nlpro.

    @edmondox
    Were you able to resolve this issue ?

    Thread Starter edmondox

    (@edmondox)

    No, sadly I wasn’t. We concluded ITS has a bug that prevents it activating correctly on 5.4, and it’s quicker and easier to upgrade WP, which we should be doing anyway, than to debug the ITS plugin.

    Ok, I see.

    Well I can confirm the current iTSec plugin release (7.9.0) activates just fine in WordPress 5.4.0, 5.4.1, 5.4.2, 5.4.3 and 5.4.4, so there must be a specific reason why it fails in your 5.4.x WordPress envs.

    Note the WP version check remains even after upgrading WordPress, so in theory the issue could persist. It depends on the exact reason why it’s failing now.
    I think I offered a simple straightforward debug step that should only take 5 mins of your time. Pretty confident the outcome should give us an idea of the root cause.

    Just saying, I’m available to figure this out ??

    Thread Starter edmondox

    (@edmondox)

    What your debug step does is log the WordPress version to the console, but we already know it’s 5.4. We also see the issue does not persist after upgrading to 5.5. So it’s more correct to say ITS might activate on 5.4, but it might not. Had I the time to debug this issue with ITS I would, but sadly I don’t. Thanks for your help anyway.

    Ok, no problem.

    If it’s

    5.4

    instead of

    5.4.x

    then that will make the WP version check fail …(tested).

    PHP considers 5.4 to be 5.04 and 5.04 < 5.4.x …

    You’ll never hear from me again after this update ??

    Thread Starter edmondox

    (@edmondox)

    You rock!!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Faulty message – iThemes Security Pro requires WordPress 5.4 or later’ is closed to new replies.