Linux 软件免费装
Banner图

SHIFT64 Phone Validation for WooCommerce

开发者 mateuszz
更新时间 2026年10月18日 03:01
PHP版本: 8.3 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

woocommerce validation checkout phone number phone validation

下载

2.0.6 2.0.7

详情介绍:

SHIFT64 Phone Validation for WooCommerce checks the phone numbers customers type at WooCommerce checkout. It rejects numbers that cannot exist in the customer's country and can rewrite valid numbers into one consistent format before they are saved on the order. All checks run on your own server with the rules of Google's open-source libphonenumber. It checks that a number is valid. It does not send SMS messages or one-time codes, and it does not confirm that the customer owns the number. Features Requires WordPress 7.1 or later and WooCommerce 7.2 or later. What it does not do Privacy The plugin makes no external HTTP requests and sends no data anywhere. Validation runs entirely on your server with rules bundled in the plugin. It sets no cookies and stores no personal data of its own, only its settings. While validation is on, non-breaking and other Unicode spaces in a typed number become plain spaces. With "Enable Formatting on Save" on, the phone numbers of the order being placed are saved in the selected format; on the block checkout WooCommerce also copies them to the customer's account. Nothing else is changed. For developers Filters: 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.

安装:

  1. Install and activate WooCommerce 7.2 or later.
  2. In your WordPress admin go to Plugins > Add New Plugin, search for "SHIFT64 Phone Validation for WooCommerce", then click Install Now and Activate. Or download the ZIP file from this page and upload it under Plugins > Add New Plugin > Upload Plugin.
  3. Go to WooCommerce > Settings > Phone Validation. Validation and Formatting on Save are on by default, the fallback Default Country is Poland and the Output Format is E.164; adjust them to your store.
  4. Try to place a test order with an invalid phone number to see the error.

屏幕截图:

  • Classic checkout rejecting an invalid phone number, with the phone field highlighted.
  • Block checkout rejecting an invalid phone number.
  • A phone number stored in E.164 format on the order edit screen.

升级注意事项:

2.0.0 Requires WordPress 7.1 or later. Block-checkout error messages are translated again, in the store's or the shopper's language. Your settings are kept. 1.5.0 The built-in GitHub updater has been removed. Updates now come from WordPress.org through the usual Dashboard > Updates screen. Your settings are kept.

常见问题:

Does it send SMS codes or verify that the customer owns the number?

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.

Does it work with block checkout?

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.

Where are the settings?

WooCommerce > Settings > Phone Validation.

Which country is used for numbers without a prefix?

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".

Is the shipping phone required?

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.

Are phone numbers on existing orders changed?

No. Only numbers submitted at checkout are checked and formatted. Deactivating or deleting the plugin does not touch saved orders.

Can I change the error messages?

Yes, with the shift64_phone_validation_error_message filter or by translating the shift64-phone-validation text domain.

The plugin says its vendor folder is missing

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.

更新日志:

2.0.7 2.0.6 2.0.5 2.0.4 2.0.3 2.0.2 2.0.1 2.0.0 1.5.1 1.5.0