prefix . 'aieo_login_attempts'; } function aieo_login_security_create_table() { global $wpdb; $charset_collate = function_exists( 'aieo_get_charset_collate' ) ? aieo_get_charset_collate() : $wpdb->get_charset_collate(); $t = aieo_login_attempts_table(); $sql = "CREATE TABLE IF NOT EXISTS `{$t}` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `ip` varchar(45) NOT NULL DEFAULT '', `user_id` bigint unsigned NOT NULL DEFAULT 0, `outcome` varchar(20) NOT NULL DEFAULT 'failed', `locked_until` datetime DEFAULT NULL, `created_at` datetime NOT NULL, PRIMARY KEY (`id`), KEY `ip_created` (`ip`,`created_at`), KEY `user_created` (`user_id`,`created_at`), KEY `locked` (`locked_until`), KEY `created_at` (`created_at`) ) {$charset_collate};"; if ( function_exists( 'aieo_dbdelta' ) ) { aieo_dbdelta( $sql ); } else { require_once ABSPATH . 'wp-admin/includes/upgrade.php'; dbDelta( $sql ); } }