=== Baravard – Car Pricing API ===
Contributors: baravard
Tags: car pricing, vehicle pricing, api, elementor, iran
Requires at least: 6.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.7.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect WordPress to the Baravard API and display base vehicle pricing and zero-kilometer car price lists.

== Description ==

Baravard connects a WordPress website to the Baravard vehicle-pricing API. After creating an API account and saving a token, site administrators can display a base vehicle-pricing form, a zero-kilometer vehicle price list, and the current API wallet balance through shortcodes or dedicated Elementor widgets.

Main features:

* API-token connection to the Baravard service.
* Base vehicle-pricing form.
* Zero-kilometer vehicle price list.
* Three dedicated Elementor widgets.
* Optional lead form with email and webhook delivery.
* Per-minute and per-day request limits.
* Temporary lock after abnormal request bursts.
* Caching for vehicle data, zero-price lists, and wallet information.
* Active-service tariff display and tariff-change notifications.
* Sanitized internal error log.
* Custom colors, labels, widths, and responsive layouts.
* Separate messages for missing tokens, invalid tokens, network failures, and service failures.

The plugin itself is free. API usage may require wallet credit according to the current Baravard tariff. Account management, token creation, tariffs, and usage details are available in the Baravard API panel.

== Shortcodes ==

Base vehicle-pricing form:

`[baravard_price_form]`

Zero-kilometer vehicle price list:

`[baravard_zero_list]`

API wallet balance:

`[baravard_wallet_balance]`

== Elementor ==

When Elementor is active, the plugin registers a Baravard category with these widgets:

* Baravard Pricing Form
* Baravard Zero Price List
* Baravard Wallet Balance

== Installation ==

1. Upload, install, and activate the plugin.
2. Open the Baravard settings page in WordPress administration.
3. Create an account in the Baravard API panel and obtain an API token.
4. Save the token in the plugin settings.
5. Add a shortcode or Elementor widget to a page.

Activating the plugin does not send an external request. API communication begins only after a token is saved and a plugin feature needs remote data.

== External Services ==

This plugin depends on the following Baravard services to provide its core functionality:

1. **Baravard vehicle-pricing API** — `https://api2.baravard.com/api/`
   * Used after an API token is saved.
   * Used for wallet information, vehicle lists, colors, base pricing, and zero-kilometer vehicle prices.
   * Data sent may include the API token, vehicle ID, model year, mileage, color ID, and `plugin=true`.
   * Lead-form personal information is not sent to this API.

2. **Vehicle images** — `https://baravard.com/bd/images/cars200x300/`
   * Used when a vehicle image is available for a pricing result or list item.
   * Images may be loaded directly in a visitor's browser. The image server may therefore receive ordinary web-request data such as IP address, user agent, and request time.

3. **Baravard account panel and documentation** — `https://baravard.com/api/` and `https://baravard.com/api/documentation`
   * Opened only after an administrator clicks a related link.
   * Used for registration, token management, tariffs, account credit, and API documentation.

Use of the service is subject to the Baravard terms at `https://baravard.com/Terms`.

== Privacy ==

* The plugin does not call the pricing API during activation or while no API token is configured.
* Vehicle-pricing parameters are sent from the WordPress server to the Baravard API when a pricing feature is used.
* Vehicle images may be loaded from the Baravard image domain in the visitor's browser.
* When the optional lead form is enabled, the visitor's name, mobile number, vehicle data, page URL, and pricing result may be sent to the administrator email address or webhook configured by the site administrator.
* Lead data is not stored in a dedicated plugin database table.
* The plugin keeps up to 100 recent technical log events. Sensitive fields are masked before logging.
* Suggested privacy-policy text is added to WordPress under Settings > Privacy.

== Attribution ==

The front-end “Powered by Baravard” attribution is optional and disabled by default on new installations. An administrator may enable it separately for the pricing form and zero-price list. A clear opt-in shortcut is available on the plugin settings page.

== Frequently Asked Questions ==

= Is an API token required? =

Yes. Pricing and account-data features require a valid Baravard API token.

= Is the plugin free? =

The plugin is free. Some API requests may consume account credit according to the current service tariff.

= Does it support Elementor? =

Yes. The plugin provides three dedicated Elementor widgets in addition to its shortcodes.

= Does it expose raw API responses or technical errors to visitors? =

No. Only required front-end fields are returned. Sanitized technical details are stored in the internal plugin log.

= Must I remove the previous version before updating? =

No. Install the new version over the current one. Existing settings are preserved.

= Which services are currently available in the plugin? =

Base vehicle pricing and the zero-kilometer vehicle price list.

== Screenshots ==

1. API connection, quick setup, account status, and wallet information in WordPress administration.
2. Base vehicle-pricing form on desktop.
3. Desktop pricing result and optional consultation form.
4. Zero-kilometer vehicle price list on desktop.
5. Base vehicle-pricing form on mobile.
6. Vehicle-pricing result on mobile.
7. Zero-kilometer vehicle price list on mobile.
8. Appearance, CTA, lead-form, and Elementor settings.

== Changelog ==

= 1.7.0 =
* Consolidated the WordPress.org review-compliance and stability fixes from versions 1.6.5 through 1.6.9.
* Preserved the tested public layouts and behavior of the base pricing form and zero-kilometer price list.
* Includes the zero-list column persistence fix, cache hardening, administrator diagnostics, low-credit alerts, and visitor-safe public error messages.

= 1.6.9 =
* Added administrator-only diagnostics for real zero-list API requests versus plugin cache hits.
* Fixed migration behavior so an explicit zero-list cache TTL of 0 remains disabled.

= 1.6.8 =
* Hardened the optional zero-price-list cache and applied cache-duration changes immediately.

= 1.6.7 =
* Fixed a Settings API regression that could hide the zero-price-list factory-price and update columns after saving settings.

For older versions, see `changelog.txt`.

== Upgrade Notice ==

= 1.7.0 =
Recommended WordPress.org review release. It consolidates compliance and stability fixes while preserving the tested front-end layouts and behavior.

== Support ==

For registration, API tokens, tariffs, and documentation, visit `https://baravard.com/api/`.
