Title: Magic Login Mail or QR Code
Author: Katsushi Kawamori
Published: <strong>2021 年 12 月 28 日</strong>
Last modified: 2026 年 6 月 27 日

---

搜索插件

![](https://ps.w.org/magic-login-mail/assets/icon-256x256.png?rev=2649698)

# Magic Login Mail or QR Code

 作者：[Katsushi Kawamori](https://profiles.wordpress.org/katsushi-kawamori/)

[下载](https://downloads.wordpress.org/plugin/magic-login-mail.2.07.zip)

 * [详情](https://cn.wordpress.org/plugins/magic-login-mail/#description)
 * [评价](https://cn.wordpress.org/plugins/magic-login-mail/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/magic-login-mail/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/magic-login-mail/#developers)

 [支持](https://wordpress.org/support/plugin/magic-login-mail/)

## 描述

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

#### Login

 * Login with email address only.
 * Only registered users can login.
 * Password-less login from the magic link or QR code 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.
 * QR code login on the user’s administration screen.

#### Thanks

 * This plugin is a modified version of [Passwordless Login](https://wordpress.org/plugins/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_notice_class_name', function(){ return 'mynotice'; }, 10, 1 );
    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 string $exp_date_time  expiration date and time.
     */
    add_filter(
        'magic_login_mail_message',
        function( $message, $url, $exp_date_time ) {

            $message .= '<br><br>' . '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 );
    ```

## 屏幕截图

[⌊Login form by shortcode⌉⌊Login form by shortcode⌉[

Login form by shortcode

[⌊Login form⌉⌊Login form⌉[

Login form

[⌊Login success⌉⌊Login success⌉[

Login success

[⌊Email with magic link⌉⌊Email with magic link⌉[

Email with magic link

[⌊Login error with no user⌉⌊Login error with no user⌉[

Login error with no user

[⌊Login error with expired token⌉⌊Login error with expired token⌉[

Login error with expired token

[⌊Log in with QR Code⌉⌊Log in with QR Code⌉[

Log in with QR Code

## 安装

 1. Upload `magic-login-mail` directory to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress

## 常见问题

none

## 评价

![](https://secure.gravatar.com/avatar/faffdf97495ffb60e45595e7c4f06ec959ad43a5afbe6fe9200e51d8c325823b?
s=60&d=retro&r=g)

### 󠀁[nos meus testes funcionou bem](https://wordpress.org/support/topic/nos-meus-testes-funcionou-bem-2/)󠁿

 [rudsonalex](https://profiles.wordpress.org/rudsonalex/) 2025 年 6 月 4 日

simples e funcional!

![](https://secure.gravatar.com/avatar/b6226d2a712e3e37a3e2fee50d1a57e933952a2fe007033bc8bae95c27df3cd1?
s=60&d=retro&r=g)

### 󠀁[Great and easy!](https://wordpress.org/support/topic/great-and-easy-137/)󠁿

 [mitbewunderer](https://profiles.wordpress.org/mitbewunderer/) 2023 年 1 月 26 
日

Easy to install and work perfect!

![](https://secure.gravatar.com/avatar/02d8e00be0f4f6fc14a7d212ebb36f3455e5d8c75c7d68a2de00714d5814783f?
s=60&d=retro&r=g)

### 󠀁[5.9.1 compatible passwordless login](https://wordpress.org/support/topic/5-9-1-compatible-passwordless-login/)󠁿

 [skillsharejp](https://profiles.wordpress.org/skillsharejp/) 2022 年 3 月 5 日

This is a fork of Passwordless Login which stopped its development which is compatible
with latest WP versions including 5.9.1. Thank you so much for maintaining!!

 [ 阅读所有3条评价 ](https://wordpress.org/support/plugin/magic-login-mail/reviews/)

## 贡献者及开发者

「Magic Login Mail or QR Code」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Katsushi Kawamori ](https://profiles.wordpress.org/katsushi-kawamori/)

「Magic Login Mail or QR Code」插件已被翻译至 4 种本地化语言。 感谢[所有译者](https://translate.wordpress.org/projects/wp-plugins/magic-login-mail/contributors)
为本插件所做的贡献。

[帮助将「Magic Login Mail or QR Code」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/magic-login-mail)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/magic-login-mail/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/magic-login-mail/)，或通过[RSS](https://plugins.trac.wordpress.org/log/magic-login-mail/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/magic-login-mail/)。

## 更新日志

#### [2.07] 2026/06/27

 * Added – Added a URL to the return value of the `(‘magic_login_get_qr_code’)` 
   filter.

#### [2.06] 2026/02/13

 * Fix – Vulnerability in Unauthorized Privilege Escalation Due to Unsafe QR Code
   File Storage.

#### [2.05] 2025/04/26

 * Fix – CSS.

#### [2.04] 2025/04/25

 * Added – Add own CSS for shortcode output.

#### [2.03] 2025/04/14

 * Fix – Loading the management screen.

#### [2.02] 2024/11/05

 * Changed – Plugin name changed from “Magic Login Mail” to “Magic Login Mail or
   QR Code”.

#### [2.01] 2024/11/05

 * Added – QR code for login is now output on the user’s administration screen.

#### [2.00] 2024/10/08

 * Added – QR codes containing magic links are now sent.

#### [1.07] 2024/09/20

 * Added – parameter addition of filter(‘magic_login_mail_message’).

#### [1.06] 2024/03/04

 * Fix – Elimination of short code attribute values.

#### 1.05

Supported WordPress 6.4.
 PHP 8.0 is now required.

#### 1.04

Added class name filter(‘magic_login_mail_form_class_name’) for login form.
 Added“
placeholder” and “required” attributes to the email input form.

#### 1.03

Added an option to save sent emails.

#### 1.02

Changed input size.

#### 1.01

Supported GlotPress.

#### 1.00

Initial release.

## 额外信息

 *  版本 **2.07**
 *  最后更新：**1 周前**
 *  活跃安装数量 **100+**
 *  WordPress 版本 ** 4.7 或更高版本 **
 *  已测试的最高版本为 **7.0**
 *  PHP 版本 ** 8.0 或更高版本 **
 *  语言
 * [Chinese (Taiwan)](https://tw.wordpress.org/plugins/magic-login-mail/) 、 [Dutch](https://nl.wordpress.org/plugins/magic-login-mail/)、
   [Dutch (Belgium)](https://nl-be.wordpress.org/plugins/magic-login-mail/) 、 [English (US)](https://wordpress.org/plugins/magic-login-mail/)
   和 [Japanese](https://ja.wordpress.org/plugins/magic-login-mail/).
 *  [翻译成简体中文](https://translate.wordpress.org/projects/wp-plugins/magic-login-mail)
 * 标签
 * [email](https://cn.wordpress.org/plugins/tags/email/)[login](https://cn.wordpress.org/plugins/tags/login/)
   [passwordless](https://cn.wordpress.org/plugins/tags/passwordless/)[users](https://cn.wordpress.org/plugins/tags/users/)
 *  [高级视图](https://cn.wordpress.org/plugins/magic-login-mail/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  3 条 5 星评价     ](https://wordpress.org/support/plugin/magic-login-mail/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/magic-login-mail/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/magic-login-mail/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/magic-login-mail/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/magic-login-mail/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/magic-login-mail/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/magic-login-mail/reviews/)

## 贡献者

 *   [ Katsushi Kawamori ](https://profiles.wordpress.org/katsushi-kawamori/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/magic-login-mail/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://shop.riverforest-wp.info/donate/)