When registering in wp, "wp hash password" is now used, and I need to have md5, as in the old fashioned way.
How to implement it?
ps: version vp last
When registering in wp, "wp hash password" is now used, and I need to have md5, as in the old fashioned way.
How to implement it?
ps: version vp last
Better not to do this. md5 has long been recognized as unsafe and obsolete. But if you really want, then you can. The wp_hash_password() function is pluggable and can be replaced with its own.
Create a plugin file wp-content/plugins/test-pluggable/test-pluggable.php and add the following code to it:
<?php /** * Plugin Name: MD5 as Password Hash * Plugin URI: * Description: Test plugin to use MD5 as Password Hash * Author: KAGG Design * Version: 0.0.1 * Author URI: https://kagg.eu/en/ * Requires at least: 1.5.1 * Tested up to: 5.0 * * Text Domain: pwd-hash * Domain Path: /languages/ */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Create a hash (encrypt) of a plain text password. * * @param string $password Plain text user password to hash * * @return string The hash string of the password */ if ( ! function_exists( 'wp_hash_password' ) ) { function wp_hash_password( $password ) { return md5( trim( $password ) ); } } Activate the plugin.
Source: https://ru.stackoverflow.com/questions/923644/
All Articles