94% woo-phone-number-validator

Code Review | Woo Phone Number Validator

WordPress plugin Woo Phone Number Validator scored 94% from 54 tests.

About plugin

  • Plugin page: woo-phone-number-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.1.1
  • WordPress version: 5.8.1
  • First release: Jul 9, 2019
  • Latest release: Jul 9, 2019
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: altoin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 990 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼147.01ms] Passed 4 tests

An overview of server-side resources used by Woo Phone Number Validator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.83 ▲0.1233.72 ▲13.97
Dashboard /wp-admin3.06 ▲0.0043.20 ▼1.03
Posts /wp-admin/edit.php3.11 ▲0.0045.08 ▼2.04
Add New Post /wp-admin/post-new.php5.42 ▼0.0190.57 ▼580.89
Media Library /wp-admin/upload.php3.00 ▲0.0032.23 ▼4.07

Server storage [IO: ▲0.62MB] [DB: ▲0.00MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Woo Phone Number Validator
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10716.04 ▲0.378.98 ▲0.1849.48 ▲1.91
Dashboard /wp-admin2,970 ▲365.97 ▼0.04137.34 ▼10.40106.03 ▼2.63
Posts /wp-admin/edit.php2,739 ▼02.83 ▲0.1166.06 ▼4.6896.79 ▲0.74
Add New Post /wp-admin/post-new.php1,498 ▼17418.80 ▼0.05349.43 ▼25.51112.68 ▼0.67
Media Library /wp-admin/upload.php1,810 ▼05.05 ▲0.02143.36 ▼22.06120.32 ▼4.40

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-phone-number-validator/libs/loadscript.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: woocommerce billing field, woocommerce, woocommerce checkout field, phone validators

woo-phone-number-validator/woo-phone-number-validator.php Passed 13 tests

The main file in "Woo Phone Number Validator" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
128 characters long description:
Validates the phone number field on checkout page of WooCommerce. Just install and activate the plugin, no settings is required.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected1,583 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript5203191,506
PHP213840
CSS210137

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.23MB with 0.15MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/flags@2x.png170.28KB68.04KB▼ 60.04%
img/flags.png69.20KB23.42KB▼ 66.16%