options = get_option( self::opt, array() ); $this->table = $GLOBALS['wpdb']->prefix . '404_log'; if( !isset( $this->options['db_version'] ) || $this->options['db_version'] < self::db_version ) { // upgrade placeholder $this->install_table(); $defaults = array( 'max_entries' => 500, 'also_record' => array( 'ip', 'ua', 'ref' ) ); foreach( $defaults as $k => $v ) if( !isset( $this->options[$k] ) ) $this->options[$k] = $v; $this->options['db_version'] = self::db_version; update_option( self::opt, $this->options ); } add_action( 'template_redirect', array( $this, 'log_404s' ) ); if( is_admin() ) { add_action( 'admin_menu', array( $this, 'settings_menu' ) ); add_action( 'admin_head', array( $this, 'load_table' ) ); } } private function install_table() { // remember, two spaces after PRIMARY KEY otherwise WP borks $sql = "CREATE TABLE $this->table ( id SMALLINT NOT NULL AUTO_INCREMENT, date DATETIME NOT NULL, url VARCHAR(512) NOT NULL, ref VARCHAR(512) NOT NULL default '', ip VARCHAR(40) NOT NULL default '', ua VARCHAR(512) NOT NULL default '', PRIMARY KEY (id) );"; require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); dbDelta($sql); } function settings_menu() { add_submenu_page('tools.php', '404 Error Log', '404 Error Log', 'manage_options', '404_error_log', array( $this, 'settings_page') ); } function load_table(){ // need to load the list table early for WP to catch it if( get_current_screen()->id == 'tools_page_404_error_log' && empty( $_GET['view'] ) ) { require_once( dirname( __FILE__ ) . '/includes/class-log-404-list-table.php' ); $this->list_table = new Log_404_List_Table( $this->options['also_record'] ); } } function settings_page() { ?>
You do not currently have pretty permalinks enabled on your site. This means that WordPress does not handle requests for pages that are not found on your site (your web server handles them directly), and so this plugin cannot log them. You need to be using pretty permalinks in order for this plugin to work.
It seems that a caching/performance plugin is active on this site. Please note that with most caching plugins, WordPress does not handle requests for pages that are not found on your site (your web server handles them directly), and so this plugin cannot log them.
Options updated.