=== Softech Country Phone Validator ===
Contributors: shravanchoudhary, echuaksingh
Donate link: https://www.paypal.com/paypalme/shrvn7
Tags: phone number validator, checkout phone validator, phone field, country flags, woocommerce
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add country flags, dial codes, and phone validation to any form field or WooCommerce checkout (classic + blocks).

== Description ==

**Softech Country Phone Validator (SCPV)** is a powerful and flexible plugin that adds country flag dropdowns and format validation to any phone input field in WordPress.

**Turn any input field into a phone field. SCPV converts any standard input into an international telephone input, adds a country code selector, and validates the number according to the selected country.**

Some form builders and plugins in their free versions do not offer a dedicated phone field, or hide it entirely. SCPV fills that gap by converting an ordinary text input into a fully functional phone number field, so you can collect correctly formatted numbers without upgrading to a premium plan.

It works seamlessly with:

📨 Contact Form 7
📝 WPForms
📊 Forminator
📑 Gravity Forms
⚡ Ninja Forms
🔧 Any other WordPress form plugin
🛍️ WooCommerce Checkout(Classic & blocks)

**Core Features:**

– Converts any input field into an international phone field
– Country dropdown with flags and international dial codes
– Live phone format validation based on the selected country
– Set a default country globally
– Apply automatically to all `<input type="tel">` fields or target with custom selectors
– Admin panel with options to enable WooCommerce, set defaults, and more
– Fully extensible and works with any form that uses HTML inputs

== Installation ==

1. Upload the plugin to `/wp-content/plugins/` or install via the WordPress plugin dashboard.
2. Activate through the “Plugins” screen.
3. Go to **Settings > Phone Validator (SCPV)** to configure.
4. Add the `.scpv-phone-default` class to your phone fields, or define your custom selectors in settings.

== Frequently Asked Questions ==

= If something isn't addressed here, how can we connect with you? =
You're welcome to message us anytime using our <a href="https://sitslab.com/contact" rel="nofollow" target="_blank">Contact form.</a>

= Does this support all WordPress form plugins? =  
Yes! As long as your form has `<input>` fields, you can use SCPV by adding a class or using the "Apply to all" option.

= Is WooCommerce Checkout (Blocks) supported? =  
Yes. SCPV supports both the Classic and new WooCommerce Block-based checkout.

= Can I apply it to all phone fields automatically? =  
Yes. Enable the "Apply to all tel fields" option in the plugin settings.

= Can I turn a normal text field into a phone field? =
Yes. Add the `.scpv-phone-default` class or a custom selector to any input field, and SCPV will convert it into a phone field with a country selector and validation.

== Screenshots ==

1. Admin settings panel with WooCommerce options and custom selectors
2. Phone input field with country flag dropdown for WooCommerce  
3. Phone input field with country flag dropdown for Contact Form 7
4. Phone input field with country flag dropdown for Wp Forms  
5. Phone input field with country flag dropdown for Forminator

== External Libraries ==

This plugin uses the [intl-tel-input](https://github.com/jackocnr/intl-tel-input) library, licensed under the MIT License, to enhance phone number fields with international flags, dial codes, and formatting.

All required assets (CSS, JS, and utility scripts) are bundled locally within the plugin under the `assets/intl-tel-input/` directory. No external CDNs or remote file calls are used, ensuring full compliance with WordPress.org plugin guidelines.

The intl-tel-input library is included under the terms of the [MIT License](https://opensource.org/licenses/MIT).


== Changelog ==

= 1.0.5 =
* New: Convert any input field into a phone field with country code selection and country-based validation
* Updated the intl-tel-input library to the latest version
* Fixed a phone validation issue affecting a few form plugins
* Tested and confirmed compatibility with WordPress 7.1.3
* Updated "Tested up to" tag to reflect support for WordPress 7.1.3
* Fixed: WooCommerce checkout phone number no longer disappears when clicking outside the field
* Fixed: WooCommerce Place Order is now blocked when the phone number is invalid for the selected country
* Changed: "Phone (optional)" label is hidden only when WooCommerce integration is enabled in settings
* Fixed: WPForms country selector now sits inside the input and flags display correctly
* Fixed: Ninja Forms no longer submits when phone validation fails
* Fixed the phone input field width issue in forms and themes
* Minor stability improvements and code optimizations

= 1.0.4 =
* Tested and confirmed compatibility with WordPress 7.1
* Updated "Tested up to" tag to reflect support for WordPress 7.1
* Fixed minor UI/design inconsistencies in the country flag dropdown display
* Fixed spacing/alignment issue affecting the phone input field in some themes

= 1.0.3 =
* Tested and confirmed compatibility with WordPress 7.0
* Updated "Tested up to" tag to reflect support for WordPress 7.0
* Minor stability improvements and code optimizations

= 1.0.2 =
* Fixed incorrect library file paths causing 404 errors on subfolder WordPress installations
* Corrected utils.js URL resolution to always use the dynamic plugin URL
* Minor bug fixes and internal code improvements

= 1.0.1 =
* Updated admin settings panel for improved usability
* Upgraded intl-tel-input library to the latest version
* Tested and optimized for the latest WordPress version
* Improved compatibility with WooCommerce checkout
* Enhanced phone field detection and validation in supported form plugins

= 1.0 =
* Initial release
* Support for CF7, WPForms, Forminator
* Admin settings panel added
* WooCommerce checkout (Classic + Blocks) support
* Default country and selector options
* Apply to all `<input type="tel">` fields option

== Upgrade Notice ==

= 1.0.5 =
This update upgrades the intl-tel-input library, fixes a validation issue in a few form plugins, corrects the phone input field width, and confirms compatibility with WordPress 7.1.3. It also lets you turn any input field into a country-aware phone field.

= 1.0.4 =
This update confirms full compatibility with WordPress 7.1 and fixes minor design/UI bugs in the phone field dropdown.

= 1.0.3 =
This update confirms full compatibility with WordPress 7.0 and includes minor stability improvements.

= 1.0.2 =
This update fixes library path issues, resolves 404 errors on subfolder installations, and includes minor bug fixes for improved stability.

= 1.0.1 =
This update improves admin settings, updates the intl phone input library, and ensures better compatibility with the latest WordPress, WooCommerce, and form plugins.

== License ==

This plugin is licensed under the GPLv2 or later.  
See `license.txt` for full terms.
