The plugin does not fulfill its main task
-
Debug Report: Mail Me In – Magic Link Login for WooCommerce
Issue:
The “Mail Me In” plugin fails to authenticate users, displaying the error: “This login link is invalid or has expired.” The login link does not work even when clicked immediately after generation.Cause:
The issue originates in themail_me_in_handle_token_loginfunction, where the$token_dataquery returnsnull. This indicates no matching record is found in theml_mail_me_in_tokenstable for the providedemail_hash,token_hash,used = 0, andexpires_at > current_time('mysql'). The root cause is that the token insertion inmail_me_in_send_link_handlerfails, as evidenced by:- No records in the
ml_mail_me_in_tokenstable (confirmed via phpMyAdmin). - Absence of
Token Inserted: Success/Failedlogs, suggesting$wpdb->insertdoes not execute or fails silently.
Possible Reasons for Insertion Failure:
- Database Error: The
ml_mail_me_in_tokenstable exists but$wpdb->insertfails due to:
- Insufficient database permissions (WordPress user lacks INSERT privileges).
- Table structure issues (e.g., collation mismatch or constraints).
- Table Creation Failure: The
mail_me_in_create_tokens_tablefunction may not have executed correctly during plugin activation, or the table was not created. - Code Execution Issue: The
mail_me_in_send_link_handlerfunction may not be triggered properly due to AJAX issues or server-side restrictions.
Debug Log Analysis:
- Logs show:
- Email: [email protected]
- Email Hash: 8a1236e567f60301895c6407262a609df95ce54463869564b8b448d4bfb932f2
- Token Hash: 4811c3095e8cb3d5b3a23b9744d0e45083d8010bbc9a9cb0b23ea92a4467cebd
- Current Time: 2025-06-07 12:43:19
- SQL Query: Correct, but no matching record found.
- Token Data: Empty (null).
- Missing logs for
Token InsertedandMail Sent, indicating the insertion or AJAX process failed.
Recommendations:
- Verify Table Existence:
- Check
ml_mail_me_in_tokensin phpMyAdmin for structure and presence. - Manually run
mail_me_in_create_tokens_table()by adding it to the plugin file, refreshing the site, and removing it.
- Check Database Permissions:
- Ensure the WordPress database user has INSERT privileges via hosting panel or phpMyAdmin.
- Test Token Insertion:
- Trigger
mail_me_in_send_link_handlerand checkwp-content/debug.logforToken Inserted: ...andwpdb->last_error.
- Verify AJAX and Email:
- Confirm the AJAX request (
wp_ajax_mail_me_in_send_link) executes andwp_mailsends the email.
- Timezone Check:
- Ensure WordPress timezone (Settings > General) matches server time to avoid
expires_atissues.
Next Steps:
- Provide updated logs containing
Token InsertedandMail Sententries. - Share
ml_mail_me_in_tokenstable status (exists, structure, or screenshot). - Confirm WordPress timezone and database user permissions.
Date: June 07, 2025
- No records in the
The topic ‘The plugin does not fulfill its main task’ is closed to new replies.