https://github.com/builtmighty/builtmighty-password-reset
https://github.com/builtmighty/builtmighty-password-reset
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/builtmighty/builtmighty-password-reset
- Owner: builtmighty
- Created: 2024-03-25T21:53:27.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-26T01:14:54.000Z (over 1 year ago)
- Last Synced: 2025-03-26T02:24:33.853Z (over 1 year ago)
- Language: PHP
- Size: 158 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
🔑 Built Mighty Password Reset
## About
Our password reset plugin gives site administrators better tools around requiring users to reset their passwords. It includes both a timed password reset and a bulk password reset. The timed reset requires users to update their password every x amount of days. The bulk reset, however, requires users of a certain user level to reset their password, via a link sent to their email, on login and does not allow them to login until they've done so.
## Installation
To install, add the plugin like any other WordPress plugin. Then go to Settings > Password Reset to configure.
## Developers
The plugin comes with several actions and filters for you to modify specific pieces of the plugin.
### Actions
These are the following actions that are available. All of these actions include the user ID.
`builtpass_before_notice`
An action that runs before the password reset notice page content. Shown to bulk reset users.
`builtpass_reset_notice`
An action that runs within the content of the password reset notice page. Shown to bulk reset users.
`builtpass_after_notice`
An action that runs after the password reset notice page content. Shown to bulk reset users.
`builtpass_before_external`
An action that runs before the external password reset form. Shown to bulk reset users.
`builtpass_after_external`
An action that runs before the external password reset form. Shown to bulk reset users.
`builtpass_before_internal`
An action that runs before the internal password reset form. Shown to timed reset users.
`builtpass_after_internal`
An action that runs after the internal password reset form. Shown to timed reset users.
`builtpass_before_expired`
An action that runs before the expired password request form. Shown to bulk reset users.
`builtpass_after_expired`
An action that runs after the expired password request form. Shown to bulk reset users.
Example:
```
add_action( 'builtpass_before_notice', 'custom_builtpass_before_notice', 10, 1 );
function custom_builtpass_before_notice( $user_id ) {
// Do something with the $user_id or output additional content.
}
```
### Filters
These are the following filters that are available.
#### Reset Times
This is an admin setting where you can remove or add reset times. Times are a multi-dimensional array with the key being numeric and the value being the label.
```
add_filter( 'builtpass_reset_times', 'custom_builtpass_reset_times', 10, 1 );
function custom_builtpass_reset_times( $times ) {
// Remove 60 day reset.
unset( $times['60'] );
// Add time.
$times['730'] = 'Every 2 Years';
// Return.
return $times;
}
```
### Bulk Reset + Timed Fields
This is an admin setting field where you can filter the available fields.
```
add_filter( 'builtpass_bulk_fields', 'custom_builtpass_bulk_fields', 10, 1 );
function custom_builtpass_bulk_fields( $fields ) {
// Filter the multi-dimensional array of $fields.
}
```
### Mail Filters
There's one email sent out to users, which generates a one-time use link for resetting their password. There are filters available for each piece of the email.
`builtpass_password_reset_email`
```
add_filter( 'builtpass_password_reset_email', 'custom_builtpass_password_reset_email', 10, 2 );
function custom_builtpass_password_reset_email( $email_address, $user_id ) {
// Filter the email address, with access to the user ID.
}
```
`builtpass_password_reset_subject`
```
add_filter( 'builtpass_password_reset_subject', 'custom_builtpass_password_reset_subject', 10, 2 );
function custom_builtpass_password_reset_subject( $subject, $user_id ) {
// Filter the subject, with access to the user ID.
}
```
`builtpass_password_reset_heading`
```
add_filter( 'builtpass_password_reset_heading', 'custom_builtpass_password_reset_heading', 10, 2 );
function custom_builtpass_password_reset_heading( $heading, $user_id ) {
// Filter the heading, with access to the user ID.
}
```
`builtpass_password_reset_body`
```
add_filter( 'builtpass_password_reset_body', 'custom_builtpass_password_reset_body', 10, 2 );
function custom_builtpass_password_reset_body( $body, $user_id ) {
// Filter the body, with access to the user ID.
}
```
## 1.3.0
* Added Block UI for password reset form on submit.
* Fixed Bug where Password would save wrong on password reset.
## 1.3.0
* Update Key creation and validation to use WP Form Reset Keys.
* Update Forms to use WC Password Reset Form if template found.
* Fixed bug where Sanitized characters would remain in output for notices.
## 1.2.1
* Validate condition check for password reset page in enqueue method
## 1.2.0
* Update the password reset exception to apply the same rule to passwords created by admins in the admin users panel
```
## 1.1.0
* Add Exclusion Interval.
* If a user has reset their password within this interval, they will not be required to reset their password again. This is useful to avoid prompting users to reset their password too frequently.
```
## 1.0.0
* Initial plugin creation.