| 开发者 | mateuszz |
|---|---|
| 更新时间 | 2026年10月18日 03:01 |
| PHP版本: | 8.3 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
600 123 456 with a Polish address is understood as +48 600 123 456.00 becomes +. Typographic dashes (–) are still rejected by WooCommerce's own phone check.+ or 00).+48600123456), international (+48 600 123 456) and national (600 123 456). Formatting on save can be switched off.shift64_phone_validation_should_validate (skip a field or an order), shift64_phone_validation_formatted_phone (change the stored value), shift64_phone_validation_error_message (reword messages) and shift64_phone_validation_enqueue_assets (turn off the highlighting scripts). The helper Shift64\SmartPhoneValidation\format_phone() formats a number for your own code and returns null when it is not valid. Signatures and examples: developer documentation.
Formatting on save is on by default. Before going live, check every system that reads the order phone (exports, courier labels, SMS gateways): with E.164, 600 100 200 is stored as +48600100200.
Third-party library
Phone number rules come from libphonenumber-for-php-lite by Joshua Gigg, a PHP port of Google's libphonenumber (Apache License 2.0), bundled with symfony/polyfill-mbstring (MIT). Neither connects to any external service. Apache 2.0 is compatible with GPLv3, so the plugin as a whole is distributed under the GPL through the "or later" clause.
Credits
Created and maintained by Mateusz Zadorożny at SHIFT64.
Sponsored by SHIFT64.
No. It only checks that the number is valid for the country and optionally reformats it. It sends no SMS or one-time codes and connects to no external service.
Yes. Both the block checkout (Store API) and the classic [woocommerce_checkout] shortcode checkout are supported: the order is not placed until the phone number is corrected.
WooCommerce > Settings > Phone Validation.
The country of the billing or shipping address; "Default Country" is only a fallback for addresses without one. Numbers typed with "+" or "00" are always validated internationally. A number without a prefix is checked against the address country only, so 600 100 200 is valid next to a Polish or a German address but not a British one. Stores selling abroad should consider "International only".
Not by this plugin. Whether the phone is required is a WooCommerce setting, and WooCommerce applies it to the shipping phone too. The plugin checks the shipping phone only when the customer fills it in, and on the classic checkout only when "Ship to a different address" is selected.
No. Only numbers submitted at checkout are checked and formatted. Deactivating or deleting the plugin does not touch saved orders.
Yes, with the shift64_phone_validation_error_message filter or by translating the shift64-phone-validation text domain.
It was installed from a copy of the source code (such as a ZIP of the GitHub repository), which lacks the bundled vendor folder. Install it from WordPress.org instead.