Title: [Plugin: Better WP Security] Undefined Property
Last modified: August 20, 2016

---

# [Plugin: Better WP Security] Undefined Property

 *  Resolved [cogmios](https://wordpress.org/support/users/cogmios/)
 * (@cogmios)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-better-wp-security-undefined-property/)
 *     ```
       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/](http://wordpress.org/extend/plugins/better-wp-security/)

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Thread Starter [cogmios](https://wordpress.org/support/users/cogmios/)
 * (@cogmios)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-better-wp-security-undefined-property/#post-2926083)
 * 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.
 *  Thread Starter [cogmios](https://wordpress.org/support/users/cogmios/)
 * (@cogmios)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-better-wp-security-undefined-property/#post-2926084)
 * 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
 *  Thread Starter [cogmios](https://wordpress.org/support/users/cogmios/)
 * (@cogmios)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-better-wp-security-undefined-property/#post-2926085)
 * 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.
 *  Thread Starter [cogmios](https://wordpress.org/support/users/cogmios/)
 * (@cogmios)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-better-wp-security-undefined-property/#post-2926086)
 * 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)
 *  [Bit51 (part of the iThemes family)](https://wordpress.org/support/users/bit51/)
 * (@bit51)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-better-wp-security-undefined-property/#post-2926115)
 * 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.
 *  [Bit51 (part of the iThemes family)](https://wordpress.org/support/users/bit51/)
 * (@bit51)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-better-wp-security-undefined-property/#post-2926127)
 * I’ve taken a look at this and I’m admittedly a little confused about not finding
   login. Are you getting an error?
 *  Thread Starter [cogmios](https://wordpress.org/support/users/cogmios/)
 * (@cogmios)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-better-wp-security-undefined-property/#post-2926128)
 * 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.
 *  [Bit51 (part of the iThemes family)](https://wordpress.org/support/users/bit51/)
 * (@bit51)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-better-wp-security-undefined-property/#post-2926135)
 * Thanks for the clarification. I’ll take a look at getting it fixed.
 *  [Bit51 (part of the iThemes family)](https://wordpress.org/support/users/bit51/)
 * (@bit51)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-better-wp-security-undefined-property/#post-2926136)
 * I’ve committed a fix to the development version at [http://downloads.wordpress.org/plugin/better-wp-security.zip](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?
 *  Thread Starter [cogmios](https://wordpress.org/support/users/cogmios/)
 * (@cogmios)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-better-wp-security-undefined-property/#post-2926137)
 * 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](https://wordpress.org/support/users/todo/) list.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘[Plugin: Better WP Security] Undefined Property’ is closed to new replies.

 * ![](https://ps.w.org/better-wp-security/assets/icon.svg?rev=2980272)
 * [Solid Security – Password, Two Factor Authentication, and Brute Force Protection](https://wordpress.org/plugins/better-wp-security/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/better-wp-security/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/better-wp-security/)
 * [Active Topics](https://wordpress.org/support/plugin/better-wp-security/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/better-wp-security/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/better-wp-security/reviews/)

## Tags

 * [notice](https://wordpress.org/support/topic-tag/notice/)

 * 10 replies
 * 2 participants
 * Last reply from: [cogmios](https://wordpress.org/support/users/cogmios/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-better-wp-security-undefined-property/#post-2926137)
 * Status: resolved