2016-05-15 18:37:34 +00:00
|
|
|
<?php
|
2016-11-21 17:12:36 +00:00
|
|
|
/**
|
|
|
|
* Inspired by Simon Bradburys cleanup.php fromb4st theme https://github.com/SimonPadbury/b4st
|
|
|
|
*
|
|
|
|
* @package understrap
|
|
|
|
*/
|
|
|
|
|
2017-09-15 06:09:12 +00:00
|
|
|
if ( ! function_exists( 'no_generator' ) ) {
|
|
|
|
/**
|
|
|
|
* Removes the generator tag with WP version numbers. Hackers will use this to find weak and old WP installs
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
function no_generator() {
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
} // endif function_exists( 'no_generator' ).
|
2016-05-15 18:37:34 +00:00
|
|
|
add_filter( 'the_generator', 'no_generator' );
|
|
|
|
|
|
|
|
/*
|
|
|
|
Clean up wp_head() from unused or unsecure stuff
|
|
|
|
*/
|
2016-11-21 17:12:36 +00:00
|
|
|
remove_action( 'wp_head', 'wp_generator' );
|
|
|
|
remove_action( 'wp_head', 'rsd_link' );
|
|
|
|
remove_action( 'wp_head', 'wlwmanifest_link' );
|
|
|
|
remove_action( 'wp_head', 'index_rel_link' );
|
|
|
|
remove_action( 'wp_head', 'feed_links', 2 );
|
|
|
|
remove_action( 'wp_head', 'feed_links_extra', 3 );
|
2017-08-04 21:40:36 +00:00
|
|
|
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10);
|
|
|
|
remove_action( 'wp_head', 'wp_shortlink_wp_head', 10);
|
2016-11-21 17:12:36 +00:00
|
|
|
|
2017-09-15 06:09:12 +00:00
|
|
|
if ( ! function_exists( 'show_less_login_info' ) ) {
|
|
|
|
/**
|
|
|
|
* Show less info to users on failed login for security.
|
|
|
|
* (Will not let a valid username be known.)
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
function show_less_login_info() {
|
|
|
|
return '<strong>ERROR</strong>: Stop guessing!';
|
|
|
|
}
|
|
|
|
} // endif function_exists( 'show_less_login_info' ).
|
2016-11-21 17:12:36 +00:00
|
|
|
|
2016-05-15 18:37:34 +00:00
|
|
|
add_filter( 'login_errors', 'show_less_login_info' );
|