Skip to content
Hamid Alinia edited this page Sep 15, 2025 · 1 revision

OTP Login with Phone Number WordPress Plugin Wiki

Home Page (Introduction)

Welcome to the official documentation for the Login with Phone Number WordPress Plugin! This plugin allows users to log in and register using their phone numbers instead of traditional usernames or emails. It's a simple, secure, and easy-to-use solution for WordPress websites looking to streamline their user authentication.

Features:

  • Login with Phone Number: Users can register and log in using their phone numbers.
  • SMS Authentication: Secure login via SMS with OTP (One-Time Password).
  • Compatibility: Works with all WordPress websites, including WooCommerce.
  • Customizable: Option to configure SMS templates and more.

For more details, check out the plugin’s official page: [Login with Phone Number Plugin](https://wordpress.org/plugins/login-with-phone-number/).


Installation

How to Install the Plugin

Automatic Installation:

  1. Go to the WordPress Dashboard.
  2. Navigate to Plugins > Add New.
  3. In the search bar, type OTP Login with Phone Number.
  4. Click Install Now and then Activate the plugin.

Manual Installation:

  1. Download the plugin ZIP file from the [WordPress plugin page](https://wordpress.org/plugins/login-with-phone-number/).
  2. Upload the plugin ZIP file to your site via Plugins > Add New > Upload Plugin.
  3. Click Install Now and then Activate the plugin.

Configuration

Setting Up the Plugin

Once the plugin is activated, you can configure the settings:

  1. Go to Settings > Login setting in the WordPress dashboard.

  2. SMS Gateway Setup: Select your preferred SMS gateway and enter your API credentials.

  3. Phone Number Settings:

    • Choose the country code for phone number format.
    • Option to enable OTP for phone number verification.
  4. Message Templates:

    • Customize the SMS templates used for login and registration.

Make sure you test the settings by sending a test SMS to verify that everything works properly.


Usage

How to Use the Plugin

Logging in with Phone Number:

  1. For WooCommerce Users: The phone number login will be automatically enabled on the WooCommerce My Account page. If you're not using WooCommerce, simply create a new page and insert the shortcode [idehweb_lwp] to display the phone number login form.
  2. Users will enter their phone number, and an OTP (One-Time Password) will be sent via SMS.
  3. After entering the OTP, users will be successfully logged in.

Registration:

  1. On the registration page, users can sign up by entering their phone number.
  2. Users will enter their phone number, and an OTP (One-Time Password) will be sent via SMS for verification.
  3. After entering the OTP, users will be successfully logged in.

Shortcode for Login Form:

You can add the login form anywhere on your site using the following shortcode: [idehweb_lwp]

This shortcode will display the login form where users can enter their phone numbers.


Troubleshooting

Common Issues & Solutions

SMS Not Sending:

  • Cause: Incorrect SMS gateway configuration.
  • Solution: Double-check your SMS gateway credentials and ensure your API key is correct. You can also try sending a test message from the plugin settings page.

Phone Number Format Issues:

  • Cause: Invalid phone number format.
  • Solution: Ensure that the correct country code is selected, and phone numbers are entered without dashes or spaces.

OTP Expiry Issues:

  • Cause: OTP expiration time might be too short.
  • Solution: Increase the expiration time in the plugin settings if necessary.

Customization

How to Customize the Plugin

  • Customizing the Login Form: You can change the appearance of the login form via CSS.
  • Adding Extra Fields: Add custom fields to the login and registration forms using WordPress hooks and filters.
  • Integration with Other Plugins: This plugin works seamlessly with WooCommerce, BuddyPress, and other popular WordPress plugins.

Developer Guide

Extending the Plugin

If you're a developer, you can extend the functionality of this plugin by using the available hooks and filters. Here are some key actions and filters to get you started:

  • Action Hook for Login: Use the phone_number_login_successful action to trigger custom actions after a successful login.

FAQ

Frequently Asked Questions

Can I use this plugin with WooCommerce?

Yes, this plugin is fully compatible with WooCommerce. It will work for customer login and registration.

What SMS gateways are supported?

What SMS Gateways Are Supported?

The plugin supports a variety of SMS gateways, including:

  • Firebase (Free): A free option provided by Google for SMS services.
  • Custom (Free): You can configure your own SMS gateway for free.
  • Twilio (PRO): A premium service offering robust SMS functionality.
  • Alibabacloud (PRO): A professional SMS service with global reach.
  • 2factor (PRO): A popular choice for two-factor authentication SMS services.
  • Farazsms (PRO): A reliable SMS gateway service.
  • Kavenegar (PRO): A leading SMS provider, particularly popular in Iran.
  • Mellipayamak (PRO): A well-known provider for SMS services.
  • SMS.ir (PRO): A widely-used SMS gateway with various features.
  • MessageBird (PRO): A powerful SMS service offering global coverage.
  • Msg91 (PRO): A cost-effective and reliable SMS provider.
  • Mshastra (PRO): A professional SMS solution with a variety of services.
  • Netgsm (PRO): A popular Turkish SMS service provider.
  • Taqnyat (PRO): A trusted SMS gateway with good coverage.
  • Textlocal (PRO): A robust SMS service known for its ease of use.
  • Trustsignal (PRO): A premium provider offering high-quality SMS services.
  • Vonage (PRO): A well-established provider offering global SMS services.

For more details on configuring each SMS gateway, refer to their respective documentation within the plugin settings.

Can I change the SMS message template?

Yes, you can customize the SMS message template for both login and registration in the plugin settings.


Changelog

Plugin Last Changelogs

  • Version 1.8.55:

    • Added: Firebase library URL import.
    • Added: Support for additional SMS gateways.
  • Version 1.8.54:

    • Added: Firebase Auth JS file.
    • Fixed: Banner src in sidebar (corrected address).
    • Fixed: Gateway input settings style (LTR layout).
  • Version 1.8.53:

    • Added: Translatable subject and message for activation code emails.
    • Fixed: Corrected image URLs to ensure proper display in the plugin.
  • Version 1.8.52:

    • Fixed: Security vulnerabilities with nonce verification on all form submissions.
    • Added: Input validation for all $_GET and $_POST superglobal variables.
    • Implemented: Proper sanitization for user input before database operations.
    • Fixed: AJAX authentication issues by handling cookies with credentials.
    • Added: Error handling for missing required fields.
    • Improved: Form security with nonce fields on all admin settings pages.
    • Fixed: PHP warnings and ensured WordPress coding standards compliance.
    • Added: External services disclosure section to README.
  • Version 1.8.50:

    • Added: GPLv2 license declaration in the main plugin file and readme.txt to comply with WordPress.org requirements.
    • Added: Translator comments for all strings containing placeholders.
    • Fixed: Hidden files (like .DS_Store) removed from the plugin directory.
    • Refactored: Split large plugin file into smaller modular files for better maintainability.
    • Fixed: Fatal error on sites without WooCommerce by guarding is_account_page() calls.
    • Added: Versioning to all enqueued CSS and JS files for proper cache-busting.
    • Fixed: intlTelInput integration and ensured proper footer handling.
    • Enhanced: Compatibility with PHP 8+ to avoid deprecated warnings.
    • Optimized: SMS sending for faster processing and lower server load.
    • Added: Filter hooks for SMS sending logic customization.
    • Improved: Error messages for failed phone number validation.
    • Added: Option to enable/disable automatic phone number verification during registration.
    • Fixed: Multi-site installation issue with plugin settings not saving correctly.
    • Improved: UI for the admin settings page to make it more user-friendly.
  • Version 1.8.48:

    • Strengthened: Firebase OTP verification logic for better validation of API responses.
    • Prevented: Unauthorized logins caused by improper handling of Firebase verification errors.
    • Added: Validation to ensure Firebase API key is configured before attempting verification.
  • Version 1.8.46:

    • Added: Option to customize the text displayed after login (instead of the form).
    • Added: logout className support.
    • Added: UserName and IsLoggedIn to the wp_localize_script object.

Contributing

How to Contribute

We welcome contributions to improve the plugin! Here's how you can contribute:

  1. Fork the Repository: Create your own fork of the plugin repository.
  2. Make Your Changes: Implement your changes or bug fixes.
  3. Submit a Pull Request: Once your changes are complete, submit a pull request for review.

License

Plugin License

This plugin is licensed under the GPL v3 license.


Getting Support

If you encounter any issues or have questions, feel free to ask for support. You can find help via the following: