84% forms-3rdparty-phone-numbers

Code Review | Forms: 3rdparty Phone Numbers

WordPress plugin Forms: 3rdparty Phone Numbers scored84%from 54 tests.

About plugin

  • Plugin page: forms-3rdparty-ph...
  • Plugin version: 0.4.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.5.3
  • WordPress version: 6.3.1
  • First release: Dec 30, 2015
  • Latest release: Sep 29, 2016
  • Number of updates: 9
  • Update frequency: every 30.4 days
  • Top authors: zaus (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /996 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.28ms] Passed 4 tests

Server-side resources used by Forms: 3rdparty Phone Numbers
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.13 ▲0.6747.86 ▲3.71
Dashboard /wp-admin3.33 ▲0.0347.80 ▼0.14
Posts /wp-admin/edit.php3.38 ▲0.0248.23 ▼7.65
Add New Post /wp-admin/post-new.php5.91 ▲0.0288.92 ▼10.37
Media Library /wp-admin/upload.php3.25 ▲0.0234.34 ▲1.04

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Forms: 3rdparty Phone Numbers
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.70 ▼0.851.70 ▼0.1646.31 ▼2.16
Dashboard /wp-admin2,209 ▲185.90 ▲0.0195.18 ▼2.4736.57 ▼8.38
Posts /wp-admin/edit.php2,089 ▼32.06 ▲0.0839.31 ▼2.6534.14 ▼1.97
Add New Post /wp-admin/post-new.php1,533 ▼023.36 ▲0.70661.67 ▲74.5859.50 ▲7.89
Media Library /wp-admin/upload.php1,388 ▼34.15 ▼0.0893.29 ▼4.8940.64 ▼2.03

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 44× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Locale' not found in wp-content/plugins/forms-3rdparty-phone-numbers/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/geocoding/Locale.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/forms-3rdparty-phone-numbers/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/ShortNumberInfoTest.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/forms-3rdparty-phone-numbers/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/carrier/PhoneNumberToCarrierMapperTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/forms-3rdparty-phone-numbers/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/UKNumbersTest.php:10
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/forms-3rdparty-phone-numbers/vendor/giggsey/libphonenumber-for-php/build/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/forms-3rdparty-phone-numbers/vendor/giggsey/libphonenumber-for-php/build/build.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/forms-3rdparty-phone-numbers/f3i-phonenumber.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/forms-3rdparty-phone-numbers/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue23Test.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/forms-3rdparty-phone-numbers/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/buildtools/BuildMetadataFromXmlTest.php:15
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/forms-3rdparty-phone-numbers/vendor/giggsey/libphonenumber-for-php/Tests/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/forms-3rdparty-phone-numbers/vendor/giggsey/libphonenumber-for-php/Tests/bootstrap.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Console\\Command\\Command' not found in wp-content/plugins/forms-3rdparty-phone-numbers/vendor/giggsey/libphonenumber-for-php/build/libphonenumber/buildtools/Commands/GeneratePhonePrefixDataCommand.php:11

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: phone number, international number, parsing, api, contact form...

forms-3rdparty-phone-numbers/f3i-phonenumber.php 92% from 13 tests

This is the main PHP file of "Forms: 3rdparty Phone Numbers" version 0.4.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("forms-3rdparty-phone-numbers.php" instead of "f3i-phonenumber.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin559,489 lines of code in 2,448 files:
LanguageFilesBlank linesComment linesLines of code
PHP2,4294,92613,766558,432
Markdown72560506
Ant2480240
JSON400210
YAML316057
XML27139
diff1085

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity12.14
▷ Minimum class complexity1.00
▷ Maximum class complexity335.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces14
Interfaces3
Traits0
Classes75
▷ Abstract classes00.00%
▷ Concrete classes75100.00%
▷ Final classes00.00%
Methods778
▷ Static methods648.23%
▷ Public methods68287.66%
▷ Protected methods617.84%
▷ Private methods354.50%
Functions5
▷ Named functions120.00%
▷ Anonymous functions480.00%
Constants180
▷ Global constants00.00%
▷ Class constants180100.00%
▷ Public constants180100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin