| | 642 | |
|---|
| | 643 | /* Warn the admin if SECRET SALT information is missing from wp-config.php */ |
|---|
| | 644 | function secret_salt_warning() { |
|---|
| | 645 | if( !is_site_admin() ) |
|---|
| | 646 | return; |
|---|
| | 647 | if( !defined( 'SECRET_KEY' ) || !defined( 'SECRET_SALT' ) ) { |
|---|
| | 648 | $salt1 = wp_generate_password() . wp_generate_password(); |
|---|
| | 649 | $salt2 = wp_generate_password() . wp_generate_password(); |
|---|
| | 650 | $msg = sprintf( __( 'Warning! You must define SECRET_KEY and SECRET_SALT in <strong>%swp-config.php</strong><br />Please add the following code before the line, <code>/* That\'s all, stop editing! Happy blogging. */</code>' ), ABSPATH ); |
|---|
| | 651 | $msg .= "<blockquote>define('SECRET_KEY', '$salt1');<br />define('SECRET_SALT', '$salt2');</blockquote>"; |
|---|
| | 652 | |
|---|
| | 653 | echo "<div id='update-nag'>$msg</div>"; |
|---|
| | 654 | } |
|---|
| | 655 | } |
|---|
| | 656 | add_action( 'admin_notices', 'secret_salt_warning' ); |
|---|
| | 657 | |
|---|