two-fa
4 weeks ago
vulnerabilities
4 weeks ago
block-code-execution-uploads.php
4 weeks ago
disable-xmlrpc.php
4 weeks ago
display-name-is-login-name.php
4 weeks ago
file-editing.php
4 weeks ago
hide-wp-version.php
4 weeks ago
index.php
4 weeks ago
prevent-login-info-leakage.php
4 weeks ago
rename-admin-user.php
4 weeks ago
rest-api.php
4 weeks ago
user-enumeration.php
4 weeks ago
user-registration.php
4 weeks ago
prevent-login-info-leakage.php
48 lines
| 1 | <?php |
| 2 | defined('ABSPATH') or die(); |
| 3 | /** |
| 4 | * Override default login error message |
| 5 | * @return string|void |
| 6 | **/ |
| 7 | function rsssl_no_wp_login_errors() |
| 8 | { |
| 9 | return __("Invalid login details.", "really-simple-ssl"); |
| 10 | } |
| 11 | add_filter( 'login_errors', 'rsssl_no_wp_login_errors' ); |
| 12 | |
| 13 | /** |
| 14 | * Hide feedback entirely on password reset (no filter available). |
| 15 | * |
| 16 | * @return void |
| 17 | * |
| 18 | */ |
| 19 | function rsssl_hide_pw_reset_error() { |
| 20 | ?> |
| 21 | <style> |
| 22 | .login-action-lostpassword #login_error{ |
| 23 | display: none; |
| 24 | } |
| 25 | </style> |
| 26 | <?php |
| 27 | } |
| 28 | add_action( 'login_enqueue_scripts', 'rsssl_hide_pw_reset_error' ); |
| 29 | |
| 30 | /** |
| 31 | * |
| 32 | * Clear username when username is valid but password is incorrect |
| 33 | * |
| 34 | * @return void |
| 35 | */ |
| 36 | function rsssl_clear_username_on_correct_username() { |
| 37 | ?> |
| 38 | <script> |
| 39 | if ( document.getElementById('login_error') ) { |
| 40 | let userLogin = document.getElementById('user_login'); |
| 41 | userLogin.value = ''; |
| 42 | userLogin.setAttribute('value', ''); |
| 43 | } |
| 44 | </script> |
| 45 | <?php |
| 46 | } |
| 47 | add_action( 'login_footer', 'rsssl_clear_username_on_correct_username' ); |
| 48 |