| 31 | $default_key = 'put your unique phrase here'; |
| 32 | $missing_key = false; |
| 33 | $duplicated_keys = array(); |
| 34 | |
| 35 | foreach ( array( 'AUTH_KEY', 'SECURE_AUTH_KEY', 'LOGGED_IN_KEY', 'NONCE_KEY', 'AUTH_SALT', 'SECURE_AUTH_SALT', 'LOGGED_IN_SALT', 'NONCE_SALT' ) as $key ) { |
| 36 | if ( defined( $key ) ) { |
| 37 | $duplicated_keys[ constant( $key ) ] = isset( $duplicated_keys[ constant( $key ) ] ); |
| 38 | } else { |
| 39 | $missing_key = true; |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | if ( isset( $duplicated_keys[ $default_key ] ) ) { |
| 44 | $duplicated_keys[ $default_key ] = true; |
| 45 | } |
| 46 | $duplicated_keys = array_filter( $duplicated_keys ); |
| 47 | |
| 48 | if ( $duplicated_keys || $missing_key ) { |
| 49 | echo '<p>' . sprintf( __( 'While you are in your <code>wp-config.php</code> file, you should also make sure you have the 8 unique phrases in place. You can generate these using the <a href="%s">WordPress.org secret key service</a>.' ), 'https://api.wordpress.org/secret-key/1.1/salt/' ) . '</p>'; |
| 50 | } |
| 51 | |