=== Vatigo – EU VAT Validator ===
Contributors:      deb_ugger
Tags:              vat, uid, eu, validation, b2b
Requires at least: 6.0
Tested up to:      6.9
Requires PHP:      8.0
Stable tag:        1.0.0
License:           GPLv2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html

Validate EU VAT IDs in your WordPress forms. Supports Contact Form 7, WPForms, and Fluent Forms out of the box.

== Description ==

**Vatigo – EU VAT Validator** adds EU VAT ID validation to your WordPress forms with zero configuration. Install, activate, done.

= Features =

* Pattern validation for all **27 EU member states**
* Works with **Contact Form 7**, **WPForms**, and **Fluent Forms**
* Real-time inline feedback while the user types (WPForms)
* Server-side validation on every submission
* Custom error messages via settings page
* Clean settings page showing active integrations and hooks used
* Extensible: register custom integrations for any other form plugin
* No external API calls – fully offline (free version)
* GDPR-friendly: no personal data stored or transmitted

= Supported Countries =

AT, BE, BG, CY, CZ, DE, DK, EE, EL, ES, FI, FR, HR, HU, IE, IT, LT, LU, LV, MT, NL, PL, PT, RO, SE, SI, SK

= Usage with Contact Form 7 =

Add `[uid_vat uid-field]` or `[uid_vat* uid-field]` (required) to your form template.

Example with placeholder:

`[uid_vat* eu-vat-id placeholder "e.g. ATU12345678"]`

= Usage with WPForms =

Drag the **EU VAT ID** field from the field panel into your form. The field supports required validation, custom labels, placeholder text, and real-time inline feedback while the user types.

= Usage with Fluent Forms =

Drag the **EU VAT ID** field from the General Fields section into your form.

= Styling the inline feedback =

WPForms shows real-time validation feedback next to the field. To hide it, add this to your theme's CSS:

`.vatigo-feedback { display: none; }`

= For Developers =

Register integrations for any other form plugin:

`add_action( 'vatigo_register_integrations', function( $manager ) {
    $manager->register( new My_Custom_Integration() );
} );`

Your class must extend `Vatigo_Integration_Base` and implement all abstract methods.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`
2. Activate via **Plugins → Installed Plugins**
3. Go to **Settings → EU VAT Validator**
4. Enable integrations for the forms you use
5. Add the EU VAT ID field to your forms

== Frequently Asked Questions ==

= Does this call an external API? =

No. The free version validates patterns only, entirely offline. No data leaves your server.

= Does it support VIES live validation? =

Not in the free version. Pro version coming soon.

= Can I add support for another form plugin? =

Yes. Extend `Vatigo_Integration_Base` and register your class via the `vatigo_register_integrations` action hook. See the Settings page for a code example.

= Is this GDPR compliant? =

Yes. No personal data is stored or transmitted. VAT IDs are validated in memory and discarded.

= Can I customise the error messages? =

Yes. Go to **Settings → EU VAT Validator** and enter a custom error message. Leave empty to use the default per-country messages.

= The inline feedback looks different from my theme – can I style it? =

Yes. The feedback element uses the class `.vatigo-feedback`. You can hide or restyle it via your theme's CSS.

== Screenshots ==

1. Settings page – active integrations with hook reference
2. EU VAT ID field in a WPForms contact form
3. Required field validation – all mandatory fields highlighted
4. Format validation – invalid EU country code error message

== Changelog ==

= 1.0.0 =
* Initial release
* Contact Form 7 integration with SWV required validation support (CF7 5.6+)
* WPForms integration with real-time inline feedback
* Fluent Forms integration
* Pattern validation for all 27 EU member states
* Admin settings page with integration toggle and hook reference
* Custom error message override
* Extensible integration API

== Upgrade Notice ==

= 1.0.0 =
Initial release.