Validates the phone number field on WooCommerce checkout to ensure it is exactly 11 digits.
This plugin adds a validation layer to the WooCommerce checkout billing phone field. It ensures that customers enter a valid 11-digit mobile number, which is common for specific regions (e.g., Bangladesh).
- Client-side Validation: Instant feedback using JavaScript checks. Accepts widely used formats (e.g.
01711 123456) but strips non-digits to ensure strictly 11 numbers. - Server-side Validation: Robust PHP check to preventing invalid submissions even if JS is bypassed.
- Localization: Error messages are translatable.
- WordPress 6.0 or higher
- PHP 7.4 or higher
- WooCommerce installed and active
- Upload the plugin files to the
/wp-content/plugins/woo-phone-validatordirectory, or install the plugin through the WordPress plugins screen directly. - Activate the plugin through the 'Plugins' screen in WordPress.
- Done! The validation is automatically applied to the checkout page.
- Added server-side validation for better security.
- Improved JavaScript validation to handle spaces and dashes user-friendly.
- Added localization support for error messages.
- Security hardening (ABSPATH check).
- Tested up to WordPress 6.9.1.
- Initial release.