84% international-telephone-input-with-flags-and-dial-codes

Code Review | International Telephone Input With Flags And Dial Codes

WordPress plugin International Telephone Input With Flags And Dial Codes scored84%from 54 tests.

About plugin

  • Plugin page: international-tel...
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3
  • WordPress version: 6.3.1
  • First release: Jan 30, 2021
  • Latest release: Oct 9, 2023
  • Number of updates: 7
  • Update frequency: every 140.9 days
  • Top authors: sajjad67 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

500+ active /3,201 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.17MB] [CPU: ▼7.13ms] Passed 4 tests

Analyzing server-side resources used by International Telephone Input With Flags And Dial Codes
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1634.28 ▼3.76
Dashboard /wp-admin3.48 ▲0.1446.43 ▼11.49
Posts /wp-admin/edit.php3.60 ▲0.2443.45 ▼2.06
Add New Post /wp-admin/post-new.php6.08 ▲0.2084.43 ▼11.20
Media Library /wp-admin/upload.php3.41 ▲0.1833.53 ▲2.12
Intl Telephone Input /wp-admin/options-general.php?page=international-telephone-input-with-flags-and-dial-codes3.3830.89

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 99 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
wpitfdc_basic_settings
db_upgraded

Browser metrics Passed 4 tests

International Telephone Input With Flags And Dial Codes: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲6313.23 ▼1.121.79 ▲0.1837.72 ▼4.73
Dashboard /wp-admin2,208 ▲315.79 ▲0.2384.74 ▼7.0735.87 ▼3.50
Posts /wp-admin/edit.php2,110 ▲102.26 ▲0.2835.95 ▲2.1632.83 ▼3.43
Add New Post /wp-admin/post-new.php1,535 ▲723.93 ▲0.83672.02 ▼1.3755.42 ▼13.94
Media Library /wp-admin/upload.php1,413 ▲104.47 ▲0.2596.50 ▼5.4942.52 ▼2.71
Intl Telephone Input /wp-admin/options-general.php?page=international-telephone-input-with-flags-and-dial-codes4,1772.3850.2255.98

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • wpitfdc_basic_settings
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 36× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\AbstractModel' not found in wp-content/plugins/international-telephone-input-with-flags-and-dial-codes/includes/vendor/geoip2/geoip2/src/Model/ConnectionType.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\AbstractModel' not found in wp-content/plugins/international-telephone-input-with-flags-and-dial-codes/includes/vendor/geoip2/geoip2/src/Model/Country.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'MaxMind\\Exception\\InvalidRequestException' not found in wp-content/plugins/international-telephone-input-with-flags-and-dial-codes/includes/vendor/maxmind/web-service-common/src/Exception/IpAddressNotFoundException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Record\\AbstractRecord' not found in wp-content/plugins/international-telephone-input-with-flags-and-dial-codes/includes/vendor/geoip2/geoip2/src/Record/Traits.php:105
    • > PHP Warning
      require(wp-content/plugins/international-telephone-input-with-flags-and-dial-codes/includes/vendor/geoip2/geoip2/examples/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/international-telephone-input-with-flags-and-dial-codes/includes/vendor/geoip2/geoip2/examples/benchmark.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'MaxMind\\Exception\\WebServiceException' not found in wp-content/plugins/international-telephone-input-with-flags-and-dial-codes/includes/vendor/maxmind/web-service-common/src/Exception/InvalidInputException.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Record\\Country' not found in wp-content/plugins/international-telephone-input-with-flags-and-dial-codes/includes/vendor/geoip2/geoip2/src/Record/RepresentedCountry.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Exception\\GeoIp2Exception' not found in wp-content/plugins/international-telephone-input-with-flags-and-dial-codes/includes/vendor/geoip2/geoip2/src/Exception/AddressNotFoundException.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\Country' not found in wp-content/plugins/international-telephone-input-with-flags-and-dial-codes/includes/vendor/geoip2/geoip2/src/Model/City.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'MaxMind\\Exception\\InvalidRequestException' not found in wp-content/plugins/international-telephone-input-with-flags-and-dial-codes/includes/vendor/maxmind/web-service-common/src/Exception/AuthenticationException.php:8

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

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: form-input, form, input, country-flag, dial-codes

international-telephone-input-with-flags-and-dial-codes/index.php 85% from 13 tests

The main PHP file in "International Telephone Input With Flags And Dial Codes" ver. 1.0.4 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("international-telephone-input-with-flags-and-dial-codes.php" instead of "index.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 148 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin7,002 lines of code in 87 files:
LanguageFilesBlank linesComment linesLines of code
PHP637391,7283,048
JavaScript422911,097
CSS360924
Markdown73700875
C19718589
JSON600389
Bourne Shell120040
m418032
C/C++ Header14128

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity7.41
▷ Minimum class complexity1.00
▷ Maximum class complexity70.00
Average method complexity2.70
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces13
Interfaces2
Traits0
Classes52
▷ Abstract classes35.77%
▷ Concrete classes4994.23%
▷ Final classes00.00%
Methods186
▷ Static methods136.99%
▷ Public methods13974.73%
▷ Protected methods10.54%
▷ Private methods4624.73%
Functions7
▷ Named functions228.57%
▷ Anonymous functions571.43%
Constants21
▷ Global constants314.29%
▷ Class constants1885.71%
▷ Public constants18100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
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
assets/vendor/img/flags@2x.png170.28KB68.04KB▼ 60.04%
assets/vendor/img/flags.png69.20KB23.42KB▼ 66.16%