
A simple plugin that adds a password reset facility to the WordPress REST API using a code. The process is a two step process:
It is also possible to check the validity of a code without resetting the password which enables the possibility of setting the password by other means, or having a two stage process for checking the code and resetting the password if desired.
Default settings are to use an 8 digit code consisting of numbers, upper and lower case letters and special characters, which has a life span of 15 minutes, afterwhich a new code would need to be requested. By default a user can attempt to use or validate a code up to 3 times before automatically invalidating it.
The plugin adds two new endpoints to the REST API:
Endpoint: /wp-json/bdpwr/v1/reset-password
— HTTP Verb: POST
— Parameters (all required):
— email
/wp-json/bdpwr/v1/set-password
— HTTP Verb: POST
— Parameters (all required):
— email
— password
— code
/wp-json/bdpwr/v1/validate-code
— HTTP Verb: POST
— Parameters (all required):
— email
— code
$.ajax({ url: '/wp-json/bdpwr/v1/reset-password', method: 'POST', data: { email: '[email protected]', }, success: function( response ) { console.log( response ); }, error: function( response ) { console.log( response ); }, }); $.ajax({ url: '/wp-json/bdpwr/v1/set-password', method: 'POST', data: { email: '[email protected]', code: '1234', password: 'Pa$$word1', }, success: function( response ) { console.log( response ); }, error: function( response ) { console.log( response ); }, }); $.ajax({ url: '/wp-json/bdpwr/v1/validate-code', method: 'POST', data: { email: '[email protected]', code: '1234', }, success: function( response ) { console.log( response ); }, error: function( response ) { console.log( response ); }, }); { "data": { "status": 200 }, "message": "A password reset email has been sent to your email address." } { "data": { "status": 200 }, "message": "Password reset successfully." } { "data": { "status": 200 }, "message": "The code supplied is valid." } { "code": "bad_email", "message": "No user found with this email address.", "data": { "status": 500 } } { "code": "bad_request", "message": "You must request a password reset code before you try to set a new password.", "data": { "status": 500 } } { "code": "bad_request", "message": "The reset code provided is not valid.", "data": { "status": 500 } } A number of WordPress filters have been added to help customise the process, please feel free to request additional filters or submit a pull request with any that you required.
add_filter( 'bdpwr_code_length' , function( $length ) { return 4; }, 10 , 1 ); add_filter( 'bdpwr_code_expiration_seconds' , function( $seconds ) { return 900; }, 10 , 1 ); add_filter( 'bdpwd_date_format' , function( $format ) { return 'H:i'; }, 10 , 1 ); add_filter( 'bdpwr_code_email_subject' , function( $subject ) { return 'Password Reset'; }, 10 , 1 ); add_filter( 'bdpwr_code_email_text' , function( $text , $email , $code , $expiry ) { return $text; }, 10 , 4 ); add_filter( 'bdpwr_max_attempts' , function( $attempts ) { return 3; }, 10 , 4 ); add_filter( 'bdpwr_include_letters' , function( $include ) { return false; }, 10 , 4 ); add_filter( 'bdpwr_selection_string' , function( $string ) { return '0123456789'; }, 10 , 4 ); add_filter( 'bdpwr_allowed_roles' , function( $roles ) { $key = array_search( 'administrator' , $roles ); if( $key !== false ) { unset( $roles[ $key ] ); } return $roles; }, 10 , 1 ); add_filter( 'bdpwr_route_namespace' , function( $route_namespace ) { return 'xyz/v1'; }, 10 , 1 ); Starting from $0 per month.
Rating
Reviewers
9 reviews
Tags
Developed By
dominic_ks
Quick & Easy
Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!
Testimonial plugins for Wordpress
Galleries plugins for Wordpress
SEO plugins for Wordpress
Contact Form plugins for Wordpress
Forms plugins for Wordpress
Social Feeds plugins for Wordpress
Social Sharing plugins for Wordpress
Events Calendar plugins for Wordpress
Sliders plugins for Wordpress
Analytics plugins for Wordpress
Reviews plugins for Wordpress
Comments plugins for Wordpress
Portfolio plugins for Wordpress
Maps plugins for Wordpress
Security plugins for Wordpress
Translation plugins for Wordpress
Ads plugins for Wordpress
Video Player plugins for Wordpress
Music Player plugins for Wordpress
Backup plugins for Wordpress
Privacy plugins for Wordpress
Optimize plugins for Wordpress
Chat plugins for Wordpress
Countdown plugins for Wordpress
Email Marketing plugins for Wordpress
Tabs plugins for Wordpress
Membership plugins for Wordpress
popup plugins for Wordpress
SiteMap plugins for Wordpress
Payment plugins for Wordpress
Coming Soon plugins for Wordpress
Ecommerce plugins for Wordpress
Customer Support plugins for Wordpress
Inventory plugins for Wordpress
Video Player plugins for Wordpress
Testimonials plugins for Wordpress
Tabs plugins for Wordpress
Social Sharing plugins for Wordpress
Social Feeds plugins for Wordpress
Slider plugins for Wordpress
Reviews plugins for Wordpress
Portfolio plugins for Wordpress
Membership plugins for Wordpress
Forms plugins for Wordpress
Events Calendar plugins for Wordpress
Contact plugins for Wordpress
Comments plugins for Wordpress
Analytics plugins for Wordpress
Common Ninja Apps
Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.
Create interactive polls with a poll widget that gathers real-time feedback, boosts engagement, and helps you understand visitor opinions quickly and clearly.
Create interactive March Madness brackets where users can make predictions, track tournament progress, and compete with others throughout every round.
Add a PDF viewer to your site to display documents, share product information, and give visitors easy access to helpful content in one place.
Display a cookies consent bar that explains usage and supports GDPR compliance, enhancing user trust and legal clarity.
Add an interactive before and after slider to your site to show visual transformations, capture attention, and help visitors understand real results.
Create interactive quizzes with a quiz maker that lets you build custom questions, collect responses, and increase engagement with easy site integration.
Show AliExpress reviews to build trust, improve credibility, and help visitors make confident purchase decisions that support higher sales.
Show Yelp reviews to build trust, strengthen credibility, and help visitors make confident decisions that support higher sales.
Add an event agenda to your site to display schedules clearly, helping users understand timing and plan their attendance.
Use tabs to organize content into clear sections, improve navigation, and help visitors switch between topics quickly for a smoother user experience.
Showcase visuals with an image grid slider that blends a grid layout and carousel motion to create a dynamic, customizable, mobile-friendly display.
Add an AI chatbot that answers user questions by crawling your site, using uploaded content, and collecting chat interactions.
More plugins
The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!
