Description
Mersal OTP replaces passwords with one-time codes. Visitors sign in or create an account with a code sent to their email or phone, and WooCommerce shops can confirm a buyer’s number before or after an order.
Works on its own, with no account:
- Email code login and sign-up — codes go out through WordPress’s own mail (
wp_mail()). - Email magic link and email + password, if you want to offer them.
- Sign in with Google — with your own Google Client ID, or the one from Site Kit by Google.
- A modern login form (
[mersal_otp]shortcode) with three themes, light and dark modes, Arabic and English, and an optional blank login page. - Rate limiting, honeypot and optional reCAPTCHA, Cloudflare Turnstile or hCaptcha.
- Active devices and sessions, forced verification for chosen roles, and per-role redirects.
- An international phone field with country codes and number auto-correction.
With a Mersal account (mersal.it), the same form can also send codes by:
- WhatsApp — including “customer sends the message” sign-in, which never makes your number message a stranger.
- Telegram — through your bot or linked account, or by confirming the number inside Telegram.
- SMS and voice call.
- The Mersal Authenticator app (app code or one-tap approval).
WooCommerce checkout verification confirms the buyer’s phone number in the cart, on the checkout page, when Place order is pressed, or after the order, with rules for who is asked (everyone, guests, first-time buyers) and for which payment methods (for example cash on delivery only).
Messages sent through Mersal use the WhatsApp numbers, Telegram accounts and SMS senders on your Mersal account and are billed by Mersal according to your plan. Mersal is a paid messaging service; see the plans on mersal.it.
External services
The plugin connects to the services below. Nothing is sent to a service you have not set up or switched on.
Mersal (mersal.it)
Mersal OTP is the WordPress connector of the Mersal messaging service, operated by Mersal. It talks to mersal.it only after you link your Mersal account from the plugin’s dashboard (“Sign in with Mersal”):
- Linking your account —
/wordpress/ssoopens in your browser so you can sign in;/api/wordpress/user/mechecks the sign-in token and returns your account, plan and API key. - Reading your senders —
/api/wordpress/gatewaysreturns the WhatsApp numbers, Telegram accounts and bots, SMS senders and email gateways on your account (when you open the dashboard and hourly). - Sending a code —
/api/whatsapp/send,/api/whatsapp/send-list,/api/telegram/send,/api/sms/send,/api/voice/otpand/api/email/sendreceive the visitor’s phone number or email address and the message carrying the code, when a visitor asks for a code by that method./api/whatsapp/status,/api/whatsapp/message-statusand/api/whatsapp/list-statusreport whether it was delivered or read. - Customer-sends-the-message and Telegram sign-in —
/api/wordpress/reverse-otp/arm,/api/wordpress/reverse-otp/status,/api/wordpress/telegram-signin/armand/api/wordpress/telegram-signin/statusregister a one-time sign-in request (phone number and a random token) and report when the visitor confirmed it. - Firebase phone verification —
/api/wordpress/firebase/verifychecks the token Google returned, when the SMS method runs through a Firebase gateway on your account. - Mersal Authenticator —
/api/app/provision,/api/app/pair/mint,/api/auth/authenticator/verify,/api/auth/app-approval/startand/api/auth/app-approval/status, when a user pairs the app or signs in with it (phone number and app code). The app itself reaches mersal.it through your site at/api/app/pair/exchange,/api/app/approvals/list,/api/app/approvals/decideand/api/app/device/token; the site passes those requests on unchanged. - Account notifications —
/api/wordpress/notificationsreturns messages from Mersal about your account, shown in the dashboard bell.
Each request carries the token or API key of your linked account, your site address and the plugin version. Nothing is sent to mersal.it before an account is linked, and disconnecting stops all requests.
- Terms of service: https://mersal.it/pages/terms-of-service/135
- Privacy policy: https://mersal.it/pages/privacy-policy/134
Google sign-in
When you switch on Google sign-in, the login form loads Google Identity Services from accounts.google.com, and the site exchanges and checks the visitor’s sign-in token with oauth2.googleapis.com and www.googleapis.com to read their name and email address.
- Terms: https://policies.google.com/terms
- Privacy: https://policies.google.com/privacy
Firebase (Google)
Only when your Mersal account has a Firebase gateway and SMS sign-in uses it. The Firebase JavaScript SDK is bundled with the plugin (assets/js/resources/firebase) and loads only when the visitor asks for an SMS code. It then sends the visitor’s phone number to Google’s Firebase Authentication service (identitytoolkit.googleapis.com), which runs an invisible reCAPTCHA check (www.google.com/recaptcha) and texts the code to that number.
- Terms: https://firebase.google.com/terms
- Privacy: https://firebase.google.com/support/privacy
reCAPTCHA, Cloudflare Turnstile, hCaptcha
Only the provider you choose on the Security screen, and only when the captcha is switched on: its script loads on the login form (www.google.com/recaptcha, challenges.cloudflare.com or js.hcaptcha.com), and the site sends the visitor’s captcha answer and IP address to its verification endpoint.
- reCAPTCHA: https://policies.google.com/terms and https://policies.google.com/privacy
- Cloudflare Turnstile: https://www.cloudflare.com/website-terms/ and https://www.cloudflare.com/privacypolicy/
- hCaptcha: https://www.hcaptcha.com/terms and https://www.hcaptcha.com/privacy
ipapi.co (off by default)
To show where a signed-in device is, or to preselect a visitor’s country in the phone field, the plugin can look the visitor’s IP address up at ipapi.co. This is off unless you turn it on with add_filter( 'motp_ip_geolocation', '__return_true' ); — mention it in your privacy policy if you do. Without it, the plugin uses your server’s or Cloudflare’s country header, or WooCommerce’s own geolocation.
- Terms: https://ipapi.co/terms/
- Privacy: https://ipapi.co/privacy/
Installation
- Install and activate Mersal OTP from Plugins Add New.
- The setup wizard opens: pick your sign-in methods and the login page.
- Put the
[mersal_otp]shortcode on any page (alias[motp_login]), or let the wizard create the login page. - To send codes by WhatsApp, Telegram, SMS or voice, open Mersal Plugins Mersal OTP Mersal account and sign in with your Mersal account.
FAQ
-
Do I need a Mersal account?
-
No, for email codes, magic links, email + password and Google sign-in. Yes, for WhatsApp, Telegram, SMS, voice-call codes and the Mersal Authenticator app: those messages are sent through the senders on your Mersal account.
-
Which shortcodes are there?
-
[mersal_otp] (login and sign-up form; attributes
theme="green|cyan|light"andlang="ar|en"),[mersal_signup],[mersal_otp_devices](active devices),[mersal_phone_bar](confirm-your-number bar) and[mersal_authenticator](pair the app). -
Is the bundled JavaScript readable?
-
The plugin’s own scripts are in
assets/jsunminified.assets/js/resources/intlTelInput.min.jsandutils.jsare International Telephone Input v26.9.2 (MIT) and Google’s libphonenumber build it ships with (Apache-2.0); their source is at https://github.com/jackocnr/intl-tel-input.assets/js/resources/firebaseholds the Firebase JavaScript SDK v10.12.2 compat builds (Apache-2.0, licence in that folder); their source is at https://github.com/firebase/firebase-js-sdk.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“Mersal OTP” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Mersal OTP” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.36.0
- First release on WordPress.org.
- Checkout verification: verify when Place order is pressed, choose who is asked (everyone, guests, first-time buyers) and on which payment methods.
- Email codes, magic links, email + password and Google sign-in work without a Mersal account.
- Updates come from WordPress.org.
- Looking up a visitor’s location from their IP address is off by default (
motp_ip_geolocationfilter).
