WP Manifestindependent plugin directory
manifest / content / acf-phone-number

Advanced Custom Fields: Phone Number WP Registry grade C-. High-severity findings · 1 findingWP RegistryHigh-severity findings · 1 findingOpen the reportC- #8 in Content & Publishing

A real ACF phone number field powered by libphonenumber and intl-tel-input

★ 121stars
835release downloads
≈10active sites
85kcomposer installs
v1.3.1latest · 1 year ago

Install

Download acf-phone-number-v1.3.1.zip From the v1.3.1 release on GitHub, Nov 5, 2024

Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/log1x/acf-phone-number/releases/download/v1.3.1/acf-phone-number-v1.3.1.zip

On Packagist as log1x/acf-phone-number:

composer require log1x/acf-phone-number
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

A real ACF phone number field powered by libphonenumber and intl-tel-input

Screenshot

Requirements

Installation

Bedrock

Install via Composer:

$ composer require log1x/acf-phone-number

Manual

Download the release .zip and install into wp-content/plugins.

Usage

Pretty straight forward usage. You can optionally set a default country.

Calling the field will return an arrayable object containing everything you need about your number:

^ array:10 [
  "carrier" => ""
  "country" => "United States"
  "e164" => "+14058675309"
  "international" => "+1 405-867-5309"
  "location" => "Oklahoma"
  "national" => "(405) 867-5309"
  "rfc3966" => "tel:+1-405-867-5309"
  "timezone" => array:1 [
    0 => "America/Chicago"
  ]
  "uri" => "tel:+14058675309"
]

ACF Composer

If you are on Sage 10 and using my ACF Composer package:

$field
  ->addField('my_number_field', 'phone_number')
    ->setConfig('placeholder', '+1 555-555-5555')
    ->setConfig('default_country', 'us');

Bug Reports

If you discover a bug in ACF Phone Number, please open an issue.

Contributing

Contributing whether it be through PRs, reporting an issue, or suggesting an idea is encouraged and appreciated.

License

ACF Phone Number is provided under the MIT License.

Releases

Newest 25 of 28 recorded releases. Each count is every asset in that release; expand a row for the breakdown.

Tag
Published
Assets
Downloads
v1.3.1 latest
Nov 5, 2024 1 year ago
acf-phone-number-v1.3.1.zip
165
Oct 24, 2024 1 year ago
acf-phone-number-v1.3.0.zip
8
Aug 14, 2024 2 years ago
acf-phone-number-v1.2.6.zip
25
Aug 13, 2023 3 years ago
acf-phone-number-v1.2.5.zip
155
Aug 8, 2023 3 years ago
acf-phone-number-v1.2.4.zip
10
Jul 28, 2023 3 years ago
acf-phone-number-v1.2.3.zip
7
Nov 18, 2022 3 years ago
acf-phone-number-v1.2.2.zip
116
Nov 3, 2022 3 years ago
acf-phone-number-v1.2.1.zip
14
Oct 14, 2022 4 years ago
acf-phone-number-v1.2.0.zip
41
Sep 8, 2022 4 years ago
acf-phone-number-v1.1.9.zip
20
Aug 21, 2022 4 years ago
acf-phone-number-v1.1.8.zip
14
Aug 21, 2022 4 years ago
acf-phone-number-v1.1.7.zip
8
Aug 2, 2021 5 years ago
acf-phone-number-v1.1.6.zip
156
Aug 2, 2021 5 years ago
tag only
—
May 20, 2021 5 years ago
acf-phone-number-v1.1.4.zip
33
Feb 26, 2021 5 years ago
acf-phone-number-v1.1.3.zip
42
Feb 25, 2021 5 years ago
acf-phone-number-v1.1.2.zip
8
Jan 16, 2021 5 years ago
acf-phone-number-v1.1.1.zip
13
Nov 20, 2020 5 years ago
tag only
—
Sep 11, 2020 6 years ago
tag only
—
Aug 18, 2020 6 years ago
tag only
—
Aug 17, 2020 6 years ago
tag only
—
Aug 12, 2020 6 years ago
tag only
—
Aug 11, 2020 6 years ago
tag only
—
Aug 6, 2020 6 years ago
tag only
—
All releases on GitHub →

Active-site estimate ≈10 comes from the median of recent superseded releases. Method.

C- grade

Security

Advanced Custom Fields: Phone Number 1.3.1 · audited by WP Registry

High-severity findings.

1 high
Audited release
1.3.1
Findings
1
Worst severity
high
Content hash
04cd1541bcf1b9626b0ed57a…

Findings

  • high Authenticated (Contributor+) stored XSS via unsanitized phone country attribute

    xss_stored

    render_field() interpolates $field['value']['country'], $field['value']['number'], $field['placeholder'], and $field['default_country'] into HTML attributes with sprintf and no esc_attr. update_value() persists the submitted array unchanged. validate_value() rejects empty/invalid numbers by constructing PhoneNumber and calling isValid(), which wraps libphonenumber parse(). parse() / checkRegionForParsing() accept any country string when the number starts with '+', so a valid E.164 number (the JS widget itself rewrites the input to E.164 on change) plus a crafted country such as us" onfocus="alert(document.domain)" autofocus=" is stored. Empirically PhoneNumber::isValid() returns true for that pair. When an editor or administrator opens the post/user (or an acf_form loads the value), the hidden country input is emitted as value="us" onfocus="alert(document.domain)" autofocus=" and the handler runs in that origin. Contributor+ can hit this on any post they can edit that has the field; a Subscriber can if the field is on their profile. Number-only XSS payloads fail isViablePhoneNumber, so the country attribute is the practical breakout.

    src/PhoneNumberField.php:84-96

    Recommendation

    Escape every attribute with esc_attr() in render_field. In update_value/validate_value, allow country only from PhoneNumber::getCountries() (ISO 3166-1 alpha-2) and persist strtolower of that allow-list. Do not treat isValid() as HTML-safety.

WP Registry hashes the installable build and reports on that exact bytes-for-bytes copy. Embargoed findings are withheld until they are disclosed, so a clean verdict means nothing public is outstanding. WP Manifest does not audit code itself.