WordPress.org

Ready to get started?Download WordPress

Forums

iThemes Security (formerly Better WP Security)
[resolved] [Plugin: Better WP Security] Undefined Property (11 posts)

  1. cogmios
    Member
    Posted 2 years ago #

    Notice: Undefined property: log_content_6_table::$hook in /mnt/web/sites/populair.eu/wp-content/plugins/better-wp-security/inc/admin/tables.php on line 520
    N/A

    This one appears in the "Tables" - in this case the changed log files in the column 'memory used'

    I think this is because class log_content_6_table does not contains a var $hook

    http://wordpress.org/extend/plugins/better-wp-security/

  2. cogmios
    Member
    Posted 2 years ago #

    Another one, when I try to goto /login (my defined url is NOT /login but another /something) :

    Notice: Trying to get property of non-object in /.../wp-content/plugins/better-wp-security/inc/secure.php on line 791

    Whereafter a message that headers were already send and a blank screen

    THIS IS CAUSED because $post is NULL when not logged in, so you can not use it like $post->post_password.

    if i do an echo of the $url above it I get:

    http://mysite.com
    /dashboard
    /admin
    /login
    http://mysite.com/wp-login.php

    and then the error follows, so it goes through some tries and somehow matches wp-login after "/login"

    ADDENDUM
    --------
    If I remove php error checking /login redirects to /wp-login.php independently of what i set as alternate login page.

  3. cogmios
    Member
    Posted 2 years ago #

    continued:
    I'm using Nginx on a single site install and have not much other plugins installed.

    I changed the Nginx ofcourse with the config on the dashboard, i looked through it and /login is nowhere to be found

  4. cogmios
    Member
    Posted 2 years ago #

    Update , I think it is because of this part in "/wp-includes/canonical.php" :

    function wp_redirect_admin_locations() {
    	global $wp_rewrite;
    	if ( ! ( is_404() && $wp_rewrite->using_permalinks() ) )
    		return;
    
    	$admins = array(
    		home_url( 'wp-admin', 'relative' ),
    		home_url( 'dashboard', 'relative' ),
    		home_url( 'admin', 'relative' ),
    		site_url( 'dashboard', 'relative' ),
    		site_url( 'admin', 'relative' ),
    	);
    	if ( in_array( untrailingslashit( $_SERVER['REQUEST_URI'] ), $admins ) ) {
    		wp_redirect( admin_url() );
    		exit;
    	}
    
    	$logins = array(
    		home_url( 'wp-login.php', 'relative' ),
    		home_url( 'login', 'relative' ),
    		site_url( 'login', 'relative' ),
    	);
    	if ( in_array( untrailingslashit( $_SERVER['REQUEST_URI'] ), $logins ) ) {
    		wp_redirect( site_url( 'wp-login.php', 'login' ) );
    		exit;
    	}
    }

    I think the following action: add_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );

    Might be handy to remove IF a user chooses to set custom names for the login pages etc... otherwise that functionality is of no use.

  5. cogmios
    Member
    Posted 2 years ago #

    I added

    remove_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );

    right above it, which stops the canonical work, another place might be better (priorities must match)

  6. Thanks for the updates. I will work these in to the next update. I'm starting to think I'll need a second dev on this one to keep up so I am most grateful for the code.

  7. I've taken a look at this and I'm admittedly a little confused about not finding login. Are you getting an error?

  8. cogmios
    Member
    Posted 2 years ago #

    Hi Bit51,

    Sorry might be confusing, there are 2 notices and 1 undesired behaviour, they are unrelated and seperated issues:

    Notice 1 =

    Notice: Undefined property: log_content_6_table::$hook in /wp-content/plugins/better-wp-security/inc/admin/tables.php on line 520
    N/A

    Notice 2 =

    Trying to get property of non-object in /.../wp-content/plugins/better-wp-security/inc/secure.php on line 791

    And 3rd the undesired behaviour is:

    a) you set a custom login url e.g. "/whateverloginlanding"
    b) you active it and add the stuff to nginx.conf / nginx stop / nginx start
    c) you go to /login and it will display the login page, i believe this is because of the canonical implementation in WP.

  9. Thanks for the clarification. I'll take a look at getting it fixed.

  10. I've committed a fix to the development version at http://downloads.wordpress.org/plugin/better-wp-security.zip however I haven't been able to duplicate the login issue in any of the sites I have. Can you please test and let me know if that gets it?

  11. cogmios
    Member
    Posted 2 years ago #

    sure, yes, however im quite busy now on a project so this will probably only be the end of august before i give the feedback.

    i have put in my @todo list.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags