• Resolved metaphorcreations

    (@metaphorcreations)


    I just updated this plugin on a multisite install and it crashes my site along with this error:

    Fatal error: Call to undefined function is_user_logged_in() in /home/califpt1/public_html/wp-content/plugins/better-wp-security/modules/free/hide-backend/class-itsec-hide-backend.php on line 213

    Not sure why is_user_logged_in() is coming up as an undefined function…

    https://www.ads-software.com/plugins/better-wp-security/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Open the file class-itsec-hide-backend.php you will see a function “filter_login_url”

    if ( ! is_user_logged_in() && ( ( defined( 'FORCE_SSL_LOGIN' ) && FORCE_SSL_LOGIN === true ) || ( defined( 'FORCE_SSL_ADMIN' ) && FORCE_SSL_ADMIN === true ) ) && $_SERVER['REQUEST_SCHEME'] === 'http' ) {
    
    			return $url;
    
    		} else {
    
    			return str_replace( 'wp-login.php', $this->settings['slug'], $url );
    
    		}

    I’m not sur but maybe your server is not set for an ssl connection. I have the same problem, so i write this
    `public function filter_login_url( $url ) {

    return $url;

    }`

    And I don’t have the error message anymore and i can acces to my site.

    Hi,

    did you just replace the code : if ( ! is_user_logged_in() && …..
    …. return str_replace( ‘wp-login.php’, $this->settings[‘slug’], $url );

    }

    With the:

    public function filter_login_url( $url ) {
    
    return $url;
    
    }

    Or did you need to change anything else? I am not a programer, but I need to fix the website asap and i do not know what to do..

    Fixed in 4.2.13.

    Thread Starter metaphorcreations

    (@metaphorcreations)

    Thanks, Dalitou. That did the trick.

    Zmesnjavc, yes, just replace (or comment out) everything within the “filter_login_url” function:

    if ( ! is_user_logged_in() && ( ( defined( 'FORCE_SSL_LOGIN' ) && FORCE_SSL_LOGIN === true ) || ( defined( 'FORCE_SSL_ADMIN' ) && FORCE_SSL_ADMIN === true ) ) && $_SERVER['REQUEST_SCHEME'] === 'http' ) {
    
    	return $url;
    
    } else {
    
    	return str_replace( 'wp-login.php', $this->settings['slug'], $url );
    
    }

    and replace it with :

    return $url;

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Upgrade Error’ is closed to new replies.