=== Vizor ===
Tags: woocommerce, caller id, phone, orders, android
Requires at least: 5.9
Tested up to: 7.1
Requires PHP: 7.4
WC requires at least: 6.0
WC tested up to: 11.3
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

When a customer calls the shop, the operator sees on an Android phone and in WP admin who is calling, their orders, invoice and AWB.

== Description ==

Vizor is a caller ID module for WooCommerce shops in Romania. When a customer phones the shop, the person who answers sees the customer's name, latest orders, invoice and shipping number (AWB). The information appears on their Android phone, over the incoming call screen, and in a corner window in WP admin.

The customer data comes from the shop's own database: WooCommerce orders and customers, plus what invoicing and courier plugins already store on the order (for example SmartBill, Oblio, Sameday, FAN Courier, Cargus, DPD, GLS). The phone app reads it directly from the shop's site, over HTTPS, with a token created when the phone is paired by QR code.

What you need:

* WooCommerce 6.0 or newer.
* The Vizor app for Android 10 or newer, from Google Play (the same app as for the free Vizor plugin). iPhone is not supported.
* A Vizor subscription. A 14-day trial starts when the first phone is paired. It works on any number of phones. After that the subscription is 399 lei per year for the first phone and 99 lei per year for each extra phone (you choose how many phones at checkout; the price shown at checkout is the one that applies). Without it, Vizor stops: you no longer see who is calling, on the phone or in WP admin. When you pay, it works again, without pairing the phones again. The plugin and its updates are distributed from vizorapel.ro.

The admin interface is in Romanian.

Licensing: the PHP code is GPLv2 or later. The files in assets/css and assets/js written for Vizor, the Vizor name and logo have their own license (all rights reserved). Third party files keep their licenses (assets/vendor/qrcode.js is MIT, the fonts in assets/fonts are OFL 1.1). Details are in LICENSE.txt.

A full list of every network request the plugin and the app make, with the file and function for each one, is in DATA-FLOWS.md in the plugin folder.

== External services ==

The plugin connects to the services below. Nothing else is contacted. Scripts, styles, fonts and the QR code library are loaded from the plugin folder.

= 1. Vizor subscription server (api.vizorapel.ro) =

What it is: the server run by the plugin's seller, BRIGHT WEB PAGES S.R.L., that checks the trial or subscription and serves plugin updates.

What it is used for: starting the trial, the daily subscription check, entering or removing a subscription code, and checking for and downloading updates.

When data is sent:

* when the first phone is paired (trial start), then retried until it succeeds; if phones were taken over from the free Vizor plugin, shortly after this plugin is activated;
* once a day, at an hour that differs from site to site;
* in WP admin, at most once an hour, for users who manage the shop, when the subscription ends within 14 days, is in its grace period or could not be verified;
* when the owner enters or removes a subscription code, or presses "Verifică acum";
* when WordPress checks for plugin updates (the answer is cached for 12 hours), and when an update is downloaded.

Nothing is sent to this service when the plugin is activated, deactivated or deleted. Local test sites (localhost, *.local, *.test and similar) send nothing.

What is sent: the site address (host name and home URL), the plugin, WordPress and WooCommerce versions, a random shop code created by the plugin, and the subscription code only when it is entered or removed. Each request carries the public key of this installation and a signature, so the server can tell that it comes from the plugin on that site. No customer data, phone numbers, orders or counts are sent.

What comes back: a subscription state signed with Ed25519, which the plugin and the app verify. Updates are installed only if the downloaded file matches a signed SHA-256 fingerprint.

This connection cannot be switched off while the plugin is active. Without it, once the last signed state expires (7 days), the phone no longer shows who is calling.

Terms: https://vizorapel.ro/termeni
Privacy policy: https://vizorapel.ro/confidentialitate

= 2. Wake-up for "Sună clientul" (api.vizorapel.ro, route push/wake) =

What it is: the same Vizor server, which asks Google Firebase Cloud Messaging to wake the paired phone so it can dial the customer.

When data is sent: only when a person with access presses "Sună clientul" in WP admin.

What is sent: the site address, the random shop code and the Firebase token of that person's phone. The customer's number and name are not sent: the phone takes them straight from the shop after it wakes up. The message Google delivers to the phone is empty ("wake up").

The automatic tags on the call card ("New customer", "Loyal customer") are worked out on the shop's server from the shop's own orders. Nothing about customers is sent to Vizor for them.

= 3. Courier APIs (optional, off by default) =

What it is: the official APIs of Sameday, FAN Courier, Cargus, DPD, GLS and Colete Online.

What it is used for: reading the delivery status of the shop's parcels, so the call card knows whether a parcel was delivered or refused.

This runs only after the owner turns on "Verifică singur starea coletelor" at Apeluri clienți > Telefoane > "Starea coletelor", and only for couriers whose WordPress plugin is installed and configured on the site. It runs in the background four times a day, for orders from the last 30 days. Nothing goes through the Vizor server.

What is sent: the shop's own account details for that courier, read from the courier's plugin settings and kept only in memory, plus the AWB or parcel numbers. Nothing about the customer is sent. Only the resulting status and its date are stored.

Hosts contacted: api.sameday.ro, api.fancourier.ro, urgentcargus.azure-api.net, api.dpd.ro, api.mygls.ro, auth.colete-online.ro and api.colete-online.ro (plus the test hosts of Sameday and GLS when the courier plugin is in test mode).

These requests fall under the shop's own contract with each courier. Terms and privacy policies are on each courier's website: https://www.sameday.ro, https://www.fancourier.ro, https://www.cargus.ro, https://www.dpd.ro, https://gls-group.com/RO, https://www.colete-online.ro.

= Other connections =

* Emails go through the site's own email setup (wp_mail), only to the shop's users: to the user who paired a new phone, and to the site admin if a phone is disconnected for looking up many unknown numbers.
* The status rows in WP admin send one request to the shop's own REST address (/wp-json/ucp/v1/ping) to check whether a firewall blocks the phone. The result is cached for 12 hours.
* Links to WhatsApp (wa.me), courier tracking pages, Google Play and vizorapel.ro open only when someone clicks them.

== Frequently Asked Questions ==

= What data leaves my store? =

To the Vizor subscription server: the site address, software versions, a random shop code and, when you enter or remove it, your subscription code. Never customer data.

For "Sună clientul": the shop code and the Firebase token of the phone that should dial, only when someone presses the button. Never the customer's number.

To couriers, only if you turn on parcel status: your courier account details and the AWB numbers.

Everything else, including orders, notes, tags and the call log, stays in your WordPress database. DATA-FLOWS.md lists each request with the code that makes it.

= Does the phone app send data to Vizor? =

No. The app talks only to the shop it was paired with. It checks the signed subscription state on the phone, without contacting the Vizor server. It has no analytics or crash reporting libraries.

= Does the app read my call log? =

No. It uses Android's call screening role to see the incoming number and does not ask for the call log permission. Contacts are read on the phone only, to recognise saved customers and to let you exclude numbers (family, colleagues). Excluded numbers are never sent anywhere.

= I already use the free Vizor plugin. Do I have to pair the phones again? =

No. When this plugin is activated, the phones paired with the free plugin are taken over and the free plugin pauses. If you deactivate this plugin, the free plugin works again with the same phones. The phones you disconnected here stay disconnected.

= What happens when I delete the plugin? =

The plugin's tables, options, transients, user settings and scheduled tasks (WP-Cron and Action Scheduler) are removed; the full lists are in includes/class-install.php (Install::OPTIONS, TRANSIENTS, HOOKS, USER_META). Orders are not touched. Nothing is sent anywhere. To keep the data, define UCP_KEEP_DATA as true in wp-config.php before deleting.

= What does the call log keep? =

For callers who are customers of the shop: the phone number, who from the shop called or answered, the time, the direction and, for incoming calls, whether the call was answered and how long it lasted. Outgoing calls only have the time, because the phone cannot tell when the customer picked up. Calls with other numbers are not written. The app reports calls made or received on a paired phone while Vizor is running; it does not read the phone's call log and nothing is recorded. The log stays in your database for 12 months, then it is deleted. It is included in the WordPress export and erase tools and removed when the plugin is deleted. When you delete a staff account, its name disappears from the log.

= Can customers ask for their data? =

Yes. The plugin adds exporters and erasers to Tools > Export / Erase Personal Data for the call log, call notes and tags. They work on the shop's database. The automatic tags ("New customer", "Loyal customer") are not stored; they are worked out from the orders when needed.

== Changelog ==

= 1.0.0 =
* First version.
