New Feature: Earn 12 Badges

Bild

Collect up to 12 exclusive badges by sharing your plugin collections and engaging with the community.

See all Badges
Magic Login Mail
Magic Login Mail

by Katsushi Kawamori

Description

Enter your email address, and send you an email with a magic link to login without a password.

Login

  • Login with email address only.
  • Only registered users can login.
  • Password-less login from the magic link notified in the email.
  • shortcode : [magic_login]
  • action hook : do_action( 'magic_email_send', $emails | array, true | bool ) : To send the magic link simultaneously from the management account.

Thanks

  • This plugin is a modified version of Passwordless Login.
  • The main changes are the addition of various filter hooks and the addition of the following action hooks.

Action hook

  • This is for sending bulk e-mails with a magic link for login to multiple accounts from the management screen.
  • When using this action hook, the URL of the page where the shortcode [magic_login] is placed should be specified in the filter hook ‘magic_login_mail_url’.
/** ==================================================
 * To send the magic link simultaneously from the management account.
 *
 * @param array  $emails  Multiple email addresses.
 * @param bool   true  Output notifications to the management screen immediately after sending.
 */
do_action( 'magic_email_send', $emails, true );

Filter hooks

/** ==================================================
 * Filter for magic link url with mail.
 *
 */
add_filter( 'magic_login_mail_url', function(){ return 'url'; }, 10, 1 );
/** ==================================================
 * Currently logged in user link for Magic Login Mail
 *
 * @param string $url  URL.
 * @param int    $user_id  User ID.
 * @return $url
 */
add_filter( 'magic_login_mail_user_redirect', 'redirect_url_login_users', 10, 2 );

/** ==================================================
 * Login user after redirect for Magic Login Mail
 *
 * @param string $url  URL.
 * @param int    $user_id  User ID.
 * @return $url
 */
add_filter( 'magic_login_mail_after_login_redirect', 'redirect_url_login_users', 10, 2 );

function redirect_url_login_users( $url, $user_id ){
    /* your code */
    return $url;
}
/** ==================================================
 * Filter for message with shortcode form.
 *
 */
add_filter( 'magic_login_mail_success_link_msg', function(){ return 'Message for success.'; }, 10, 1 );
add_filter( 'magic_login_mail_success_login_msg', function(){ return 'Message for success with login.'; }, 10, 1 );
add_filter( 'magic_login_mail_valid_errors', function(){ return 'Message for mail validation error.'; }, 10, 1 );
add_filter( 'magic_login_mail_email_errors', function(){ return 'Message for sent mail error.'; }, 10, 1 );
add_filter( 'magic_login_mail_invalid_token_error', function(){ return 'Message for token error.'; }, 10, 1 );
add_filter( 'magic_login_mail_form_label', function(){ return 'Message for form label.'; }, 10, 1 );
/** ==================================================
 * Filter for color with shortcode form.
 *
 */
add_filter( 'magic_login_mail_success_link_msg_back_color', function(){ return '#e7f7d3'; }, 10, 1 );
add_filter( 'magic_login_mail_success_login_msg_back_color', function(){ return '#e7f7d3'; }, 10, 1 );
add_filter( 'magic_login_mail_valid_errors_back_color', function(){ return '#ffebe8'; }, 10, 1 );
add_filter( 'magic_login_mail_email_errors_back_color', function(){ return '#ffebe8'; }, 10, 1 );
add_filter( 'magic_login_mail_invalid_token_error_back_color', function(){ return '#ffebe8'; }, 10, 1 );
/** ==================================================
 * Filter for input text size.
 *
 */
add_filter( 'magic_login_mail_input_size', function(){ return 17; }, 10, 1 );
/** ==================================================
 * Filter for class name.
 *
 */
add_filter( 'magic_login_mail_form_class_name', function(){ return 'myform'; }, 10, 1 );
add_filter( 'magic_login_mail_label_class_name', function(){ return 'mylabel'; }, 10, 1 );
add_filter( 'magic_login_mail_input_class_name', function(){ return 'myinput'; }, 10, 1 );
add_filter( 'magic_login_mail_submit_class_name', function(){ return 'mysubmit'; }, 10, 1 );
/** ==================================================
 * Filter for message with mail subject.
 *
 */
add_filter( 'magic_login_mail_subject', function(){ return 'subject'; }, 10, 1 );
/** ==================================================
 * Filter for message with mail.
 *
 * @param string $message  message.
 * @param string $url  url.
 * @param int    $uid  User ID.
 */
add_filter(
    'magic_login_mail_message',
    function( $message, $url, $uid ) {

        $user_meta = get_userdata( $uid );
        $user_roles = $user_meta->roles;
        $role = $user_roles[0];
        if ( 'subscriber' === $role ) {
            $message = 'Hello ! 

' . sprintf( 'Click on this link to login with the app: %1$s%2$s', 'myapp://?url=', esc_url( $url ) ); } $message .= '

' . 'You can log in via the link above within 10 minutes of receiving this email. You may only log in once using the link above.'; return $message; }, 10, 3 );
/** ==================================================
 * Filter for login expiration.
 *
 */
add_filter( 'magic_login_mail_expiration', function(){ return 10; }, 10, 1 );

All texts and images on this product page are protected by copyright and are the property of the author Katsushi Kawamori. You will be redirected to the retailer to download the plugin. We act solely as a search engine for plugins and are not affiliated with the retailer or Katsushi Kawamori.

Tags

Free Plugin

5.0
2 Reviews
Last Update
8 months ago
Installations
200
All trademarks, logos and brand names are the property of their respective owners. All company, product and service names used in this website are for identification purposes only. The WordPress® trademark is the intellectual property of the WordPress Foundation

Collections

SEO Plugins

  • 6 Plugins
  • 5 Views
Yoast SEO
All in One SEO – Powerful SEO Plugin to Boost SEO Rankings & Increase Traffic
Rank Math SEO – AI SEO Tools to Dominate SEO Rankings
WP Fastest Cache

Page Builder

  • 1 Plugin
  • 11 Views
Page Builder: Pagelayer – Drag and Drop website builder

payment methodes per

  • 1 Plugin
  • 5 Views
Payment Gateway Based Fees and Discounts for WooCommerce

SEO

  • 1 Plugin
  • 5 Views
Yoast SEO

Wordpress

  • 13 Plugins
  • 7 Views
Really Simple Security – Simple and Performant Security (formerly Really Simple SSL)
Forminator Forms – Contact Form, Payment Form & Custom Form Builder
Yoast SEO
Site Kit by Google – Analytics, Search Console, AdSense, Speed

slider

  • 1 Plugin
  • 5 Views
Photo Gallery, Sliders, Proofing and Themes – NextGEN Gallery

Yeer

  • 1 Plugin
  • 6 Views
Autoptimize

Optimisation Plugins

  • 1 Plugin
  • 12 Views
Smush Image Optimization – Optimize Images | Compress & Lazy Load Images | Convert WebP | Image CDN

Best Speed Plugins

  • 4 Plugins
  • 6 Views
LiteSpeed Cache
WP Fastest Cache
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance
10Web Booster – Website speed optimization, Cache & Page Speed optimizer

Must-Have Plugins

  • 9 Plugins
  • 115 Views
Elementor Website Builder – More than Just a Page Builder
Yoast SEO
All-in-One WP Migration and Backup
Wordfence Security – Firewall, Malware Scan, and Login Security

Best Security Plugins

  • 3 Plugins
  • 5 Views
Jetpack – WP Security, Backup, Speed, & Growth
Wordfence Security – Firewall, Malware Scan, and Login Security
Solid Security – Password, Two Factor Authentication, and Brute Force Protection

Best Member Plugins

  • 5 Plugins
  • 6 Views
Paid Memberships Pro – Content Restriction, User Registration, & Paid Subscriptions
Ultimate Membership Pro - WordPress Membership Plugin
Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin
Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress

Best Recruitment Website Plugins

  • 3 Plugins
  • 6 Views
WP Job Openings – Job Listing, Career Page and Recruitment Plugin
Smush Image Optimization – Optimize Images | Compress & Lazy Load Images | Convert WebP | Image CDN
WP Job Manager

Cookie Plugins

  • 3 Plugins
  • 14 Views
CookieYes – Cookie Banner for Cookie Consent (Easy to setup GDPR/CCPA Compliant Cookie Notice)
Autoptimize
Complianz – GDPR/CCPA Cookie Consent

Donation Plugins

  • 2 Plugins
  • 25 Views
Charitable – Donation Plugin for WordPress – Fundraising with Recurring Donations & More
GiveWP – Donation Plugin and Fundraising Platform