=== eDrive Site ===
Contributors: edrivemd
Tags: driving school, edrive, leads, offers, enrollment
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Shows your driving school's offers, theory groups and enrollment form from eDrive on your WordPress site.

== Description ==

The official eDrive plugin for driving schools that already have a WordPress site. The content you manage in the eDrive dashboard (offers and prices, theory groups, contact details) is displayed on your site automatically, and the enrollment requests sent by visitors land directly in the Leads section of eDrive.

eDrive (https://edrive.md) is a management platform for driving schools in the Republic of Moldova; the plugin's front-end texts are in Romanian and Russian, matching the schools' audience.

**What you get:**

* `[edrive_offers]` — offer cards: title, price (with the discounted price highlighted), list of benefits and an "Enroll" button.
* `[edrive_groups]` — "Next group starts on 15 October · 8 seats left", with the schedule and the branch.
* `[edrive_form]` — enrollment form (name, phone, email, offer, group, message) with spam protection and a mandatory data-processing consent checkbox; the API key never reaches the browser.
* `[edrive_school field="phone"]` — school details (name, phone, city, address, email, eDrive site address).
* `[edrive_site]` — the school's eDrive site embedded in a page.
* Equivalent Gutenberg blocks in the "eDrive" category (Offers, Groups, Enrollment form, Embedded site).
* Content in Romanian or Russian (when the school has filled in the translations in eDrive).

The plugin uses the public eDrive partner API (https://edrive.md/developer). You need an API key generated from Dashboard → Integrations → Developer API.

**Third-party service:** every request is sent from your server to `https://partners.edrive.md` with your API key; the enrollment form forwards the visitor's name, phone, email, message and chosen offer or group to eDrive, where the school sees them. Terms: https://edrive.md/termeni. Privacy policy: https://edrive.md/confidentialitate.

== Installation ==

1. Upload the `edrive-site.zip` archive from Plugins → Add New → Upload Plugin (or copy the `edrive-site` folder into `wp-content/plugins/`).
2. Activate the plugin.
3. Go to Settings → eDrive, paste the API key (it starts with `edk_`), pick the language and click "Test connection" — your school's name should appear.
4. Add the eDrive shortcodes or blocks to the pages you want.
5. Set a privacy policy page under Settings → Privacy: the enrollment form links to it next to the consent checkbox.

== Frequently Asked Questions ==

= Where do I get the API key? =

From the eDrive dashboard: Integrations → Developer API → Generate key. The key is shown only once; if you lose it, revoke it and generate a new one.

= Is the API key visible to visitors? =

No. All requests to eDrive are made from the WordPress server. The form posts to an internal endpoint of your site, which forwards the data with the API key.

= I changed the offers in eDrive but the site still shows the old ones. =

API responses are cached for 10 minutes. Click "Clear cache" in Settings → eDrive to refresh immediately.

= How do I preselect an offer in the form? =

The "Enroll" button on each card preselects that offer or group in the first form on the page. You can also fix it manually: `[edrive_form offer="offer ID"]` (the ID appears in the API response or in the dashboard).

= Can I change the colors? =

Yes. The styles use CSS variables: `--edrive-accent`, `--edrive-bg`, `--edrive-border`, `--edrive-radius`, `--edrive-text`, `--edrive-muted`. Override them from Appearance → Customize → Additional CSS, for example `.edrive { --edrive-accent: #c2410c; }`.

= The form says "Session expired". =

The page was served from a cache older than 12 hours. Reload the page; if you use a caching plugin, exclude the pages with the form or shorten the cache lifetime.

= Why is only part of the text in Russian? =

Offers and groups come in Russian only when the school has filled in the translations in eDrive; fields without a translation are shown in Romanian. The plugin's own labels follow your WordPress site language and come from the WordPress.org translation packs (translate.wordpress.org), so a Russian site shows Russian labels once the Russian translation is complete there; the form's own messages are always available in both languages.
