=== DiceX Connect ===
Contributors: arianashargh
Tags: sms, otp, two factor authentication, whatsapp, woocommerce
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.28
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Notify by SMS, WhatsApp, Telegram and more when an order changes, a form is submitted or a login fails, through your own DiceX account.

== Description ==

Your store or site already knows when something important happens. Your phone doesn't. DiceX Connect closes that gap: it listens for events in the plugins you already run and sends an SMS — to you, to your customer, or to both.

Nothing to wire up per event. Open the Integrations tab, switch a card on, choose who gets the message, and edit the wording. Every card ships with a sensible default message.

= What you get =

* **WooCommerce order notifications** — a message when an order changes status, with the statuses you choose. Reads orders through WooCommerce's own API, so it works on stores using High-Performance Order Storage.
* **Form notifications** — WPForms, Contact Form 7 and Gravity Forms. A successful submission notifies you, and can notify the person who filled the form in.
* **Security alerts** — repeated failed logins from one address, an administrator signing in, a new user registering, a password reset. Built on WordPress's own hooks, so these work with no security plugin installed and keep working when you update the one you have.
* **Two-step login** — a one-time code on the WordPress login screen, either after the password or instead of it, with no other plugin needed. One line in `wp-config.php` stands it down, so a lost phone is never a locked door.
* **The right recipients** — a shared list of admin numbers, WordPress administrators who added a mobile number to their profile, or the customer the event is about.
* **Message templates you control** — each card has its own text with tags such as `{order_id}`, `{order_status}`, `{form_title}` and `{site_name}`.
* **More than SMS** — the same messages can go over WhatsApp, voice call, Telegram, Bale or Safir, depending on what your DiceX account has.

= It stays out of the way =

A card that is switched off registers nothing at all, and one whose plugin is not installed is shown greyed out. If the gateway is unreachable the failure goes to the plugin's log — the order still completes and the form still submits.

= It speaks your language =

The screens follow the language WordPress is already in, so there is nothing to configure. Translations come from translate.wordpress.org and reach sites that already have the plugin installed, on their own.

The admin screens are built for right-to-left reading, so Persian, Arabic and Hebrew sites are laid out correctly. Every mobile number is written the same way — a plus and the country code, like +989121234567 — and Persian and Arabic-Indic digits are understood.

== External services ==

This plugin relies on **DiceX**, a third-party messaging and payment service, to do anything at all. It is the only external service the plugin contacts, and it contacts nothing until you create a DiceX account and paste your own API key into the settings. Installing and activating the plugin sends nothing anywhere.

Every request goes to `https://gateway.dicex.me/` over HTTPS, and carries your API key in a header so DiceX knows whose account it is.

What is sent, and when:

* **When you save an API key, open the Credit tab, or load the Sender lines tab:** your API key. DiceX answers with the account balance, the plan, and the sender lines the account owns.
* **When a notification fires, or you press "Send test":** the recipient's mobile number, the text of the message, and the sender line it goes out from.
* **When you start an online top-up:** the amount, the bank you picked, and the address on your own site to return to after payment. DiceX answers with the payment link.

Nothing else leaves your site. The plugin adds no analytics, no tracking and no telemetry, contacts no other host, and loads no script, style or font from a CDN — everything it renders is served from the plugin folder.

DiceX links:

* Service homepage: https://dicex.me/
* Terms of service: https://dicex.me/terms
* Privacy policy: https://dicex.me/privacy
* Create an account: https://kyc.dicex.me/
* Account panel: https://app.dicex.me/
* API keys: https://dev.dicex.me/developers/api-keys
* Top up, and where a coupon is applied: https://home.dicex.me/financial-operations/user-charge
* Refund policy for international payments: https://ntft.tech/en/refund
* Privacy policy for international payments: https://ntft.tech/en/privacy
* What this plugin does: https://wp.dicex.me/

A top-up made through an international gateway is sold by New Taste For Technology and Investment LLC of Muscat, Oman, and the Credit tab shows its refund and privacy terms before you pay. By connecting an account you are using DiceX under its terms, so please read them and the privacy policy first. The rest are ordinary links you click in the admin screens; the plugin sends nothing to them.

== Bundled assets ==

The plugin ships one font: **Vazirmatn**, by the Vazirmatn Project Authors, under the SIL Open Font License 1.1, with the licence text in `assets/fonts/OFL.txt`. WordPress ships no Persian face, so the plugin serves its own from its own folder — no font CDN is contacted.

== Installation ==

1. In your dashboard go to Plugins > Add New, search for "DiceX Connect", then click Install Now and Activate.
2. Open the new **DiceX** menu. It lands on Getting started, which links straight to creating an account and to fetching an API key. Paste the key under the Connection tab.
3. Under the Lines tab, pick the sender line each channel should use, and send a test message to confirm it works.
4. Under the Integrations tab, switch on the plugins you want notifications from.

To install manually instead: go to Plugins > Add New > Upload Plugin, upload the ZIP, click Install Now, then Activate, and follow steps 2 to 4.

== Frequently Asked Questions ==

= Do I need a DiceX account? =

Yes. DiceX is a separate service, it is not free, and the plugin cannot send anything without an account and an API key of your own. Create one at https://kyc.dicex.me/ and read the terms at https://dicex.me/terms first.

= Which channels can it send over? =

SMS, WhatsApp, voice call, Telegram Bot, Bale Bot and Safir, depending on what your DiceX account and your region actually cover. Each card is given an ordered list of channels and tries the next one when the first does not get through.

= Which plugins can trigger a notification? =

WooCommerce, WPForms, Contact Form 7 and Gravity Forms, plus WordPress's own login and user events, which need no other plugin. More are added over time.

= How does it know the customer's phone number on a form? =

It reads the submitted values and picks the one that is a usable mobile number for your region. A field labelled like a phone field wins over any other. There is nothing to map, on any form.

= Will a messaging failure break my checkout or my forms? =

No. A send that fails is recorded in the plugin's log and nothing else happens — the order is still placed and the form is still submitted.

= Does it work with WooCommerce High-Performance Order Storage? =

Yes. Orders are only ever read through WooCommerce's own API, and the plugin declares HPOS compatibility.

= Can my customers get messages too, not just the admins? =

Yes. Each card chooses its recipients separately: a list of admin numbers, WordPress administrators with a mobile number on their profile, the customer or form submitter, or any combination.

= What is the Region setting for? =

DiceX does not sell the same services everywhere. The region you pick decides which channels and which payment gateways the plugin offers you. Nothing about it is sent to DiceX.

= What languages does it come in? =

The screens are English and follow your WordPress language. Translations are contributed at translate.wordpress.org and WordPress fetches them for you, so adding a language needs no new release of the plugin.

== Screenshots ==

1. Getting started — what DiceX is, which channels it can use, and the two ways in: create an account, or fetch an API key for one you already have.
2. The Connection tab — paste your API key, choose the region, and set the login code length, the voice call language and the name used in messages.
3. The Integrations tab — one card for each plugin DiceX can listen to. A card whose plugin is not installed is greyed out, so you can see what is available without hunting for it.
4. A card's settings — drag the channels into the order they should be tried, choose which order statuses send, pick who is notified, and edit the message.
5. The Sender lines tab — choose a line per channel, or leave SMS, voice and Safir on the DiceX shared line, and send a test message.
6. The Credit tab — top up online through Saman, Sepehr or Digipay.

== Changelog ==

= 1.0.28 =

Stops you switching on a card that would do nothing.

**Enhancements**

* A card can no longer be switched on while your own profile has no mobile number, or has one the plugin cannot use. The reason sits at the top of the Integrations tab and links straight to the field, instead of leaving you to find out later that nothing was sent.

**Other**

* Every warning that mentions your profile is now a link to it, so you are not sent hunting through the dashboard.

The releases before this one are in changelog.txt, next to this file.

== Upgrade Notice ==

= 1.0.28 =
A card cannot be switched on until your own profile has a usable mobile number. The warning now links straight to the field.
