=== Nvoip BNTC - Best Number To Call ===
Contributors: nvoip
Donate link: https://www.nvoip.com.br/
Tags: phone, contact, geolocation, call, telephony
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Shows the best Nvoip contact phone number based on the visitor's approximate location.

== Description ==

Nvoip BNTC, or Best Number To Call, helps WordPress sites display a more suitable Nvoip contact phone number for each visitor.

The plugin checks the visitor's approximate region, requests the virtual numbers available in the configured Nvoip account, and displays a phone number with a matching or nearby Brazilian area code when one is available. If no matching number is found, the plugin displays the default number configured in the WordPress admin area.

Main features:

* `[nvoip_bntc]` shortcode to display the recommended phone number in pages, posts, widgets, or compatible templates.
* Setting field for the Nvoip API key.
* Setting field for the fallback phone number.
* Display options for country code and 4003 area code formatting.
* Lookup of virtual numbers available in the configured Nvoip account.

This plugin requires a Nvoip account and a Nvoip API key to retrieve the virtual numbers available for the account.

== External services ==

This plugin connects to external services when the `[nvoip_bntc]` shortcode is rendered.

= Nvoip API =

Service: Nvoip API, provided by Nvoip Plataforma de Comunicacao Ltda.

Purpose: retrieves the virtual phone numbers available in the Nvoip account configured by the site administrator.

Data sent: the Nvoip API key saved in the plugin settings is sent to `https://api.nvoip.com.br/v2/list/dids` over HTTPS.

When data is sent: each time the shortcode is rendered and a Nvoip API key is configured.

Terms of service: https://www.nvoip.com.br/en/terms-of-service/

Privacy policy: https://www.nvoip.com.br/en/privacy-policy/

= IPWHOIS =

Service: IPWHOIS, provided by IPWhois.io.

Purpose: obtains the visitor's approximate region from the visitor's IP address so the plugin can select a more suitable phone number.

Data sent: the visitor's IP address is sent to `https://ipwho.is/` over HTTPS.

When data is sent: each time the shortcode is rendered.

Terms of service: https://ipwhois.io/terms

Privacy policy: https://ipwhois.io/privacy

== Installation ==

1. Upload the `nvoip-bntc-best-number-to-call` folder to `/wp-content/plugins/`, or install the `.zip` file from Plugins > Add New > Upload Plugin.
2. Activate the plugin in the WordPress admin area.
3. Go to Settings > BNTC.
4. Enter your Nvoip API key.
5. Enter a default fallback phone number.
6. Use the `[nvoip_bntc]` shortcode where the recommended number should appear.

== Frequently Asked Questions ==

= Do I need a Nvoip account? =

Yes. The plugin needs a Nvoip API key to retrieve the virtual numbers available in your Nvoip account.

= What happens if the visitor's location cannot be detected? =

The plugin displays the default phone number configured in the WordPress admin area.

= Does the shortcode work on any page? =

Yes. Use `[nvoip_bntc]` in pages, posts, widgets, or any WordPress area that supports shortcodes.

= Does the plugin make external requests? =

Yes. The plugin connects to the Nvoip API to retrieve virtual numbers and to IPWHOIS to detect the visitor's approximate region. See the External services section for details.

== Screenshots ==

1. BNTC settings page in the WordPress admin area.
2. Example page using the `[nvoip_bntc]` shortcode.

== Changelog ==

= 1.1.2 =
* Added bundled Portuguese (Brazil) and Spanish (Spain) translations for the plugin admin interface.
* Added a Domain Path header and explicit text domain loading for local translation files.

= 1.1.1 =
* Rewrote the plugin description and readme content in English.
* Added a detailed External services section with data, purpose, timing, terms, and privacy policy links.
* Updated the text domain to match the WordPress.org plugin slug.
* Moved the plugin settings page under Settings.
* Updated admin strings to use English as the base language.

= 1.1.0 =
* Added WordPress Plugin Directory metadata.
* Improved error handling for external requests.
* Changed the geolocation request to use an HTTPS service.
* Added safe encoding for the API key in the request URL.
* Added settings sanitization and admin output escaping.

= 1.0 =
* Initial version.

== Upgrade Notice ==

= 1.1.2 =
Adds bundled Portuguese and Spanish translations for the plugin admin interface.

= 1.1.1 =
Recommended update before resubmitting the plugin to the WordPress Plugin Directory.
