78% country-phone-field-contact-form-7

Code Review | Country & Phone Field Contact Form 7

WordPress plugin Country & Phone Field Contact Form 7 scored78%from 54 tests.

About plugin

  • Plugin page: country-phone-fie...
  • Plugin version: 2.4.6
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Aug 2, 2018
  • Latest release: Nov 1, 2023
  • Number of updates: 55
  • Update frequency: every 34.9 days
  • Top authors: narinderbisht (100%)

Code review

54 tests

User reviews

36 reviews

Install metrics

30,000+ active /178,697 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

An overview of server-side resources used by Country & Phone Field Contact Form 7
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0139.76 ▲0.69
Dashboard /wp-admin3.32 ▼0.0346.27 ▼13.42
Posts /wp-admin/edit.php3.37 ▲0.0145.13 ▼0.33
Add New Post /wp-admin/post-new.php5.90 ▲0.0191.85 ▲0.62
Media Library /wp-admin/upload.php3.25 ▲0.0136.35 ▲0.29

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Country & Phone Field Contact Form 7
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲5514.17 ▼0.181.58 ▲0.0242.73 ▲0.77
Dashboard /wp-admin2,204 ▲235.56 ▼0.1780.82 ▼17.8839.85 ▲0.96
Posts /wp-admin/edit.php2,115 ▲151.96 ▲0.0239.15 ▲3.0936.15 ▲0.33
Add New Post /wp-admin/post-new.php1,547 ▲1918.05 ▼4.97665.68 ▲42.0764.31 ▲6.26
Media Library /wp-admin/upload.php1,412 ▲124.18 ▼0.01107.75 ▲9.5547.94 ▲6.77

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/country-phone-field-contact-form-7/country-phone-field-contact-form-7.php
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/country-phone-field-contact-form-7/includes/country-text.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/country-phone-field-contact-form-7/includes/settings.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/country-phone-field-contact-form-7/includes/phone-text.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/country-phone-field-contact-form-7/includes/include-js-css.php:281

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention: Please take inspiration from this readme.txt

country-phone-field-contact-form-7/country-phone-field-contact-form-7.php 92% from 13 tests

"Country & Phone Field Contact Form 7" version 2.4.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
There were no executable files found in this plugin5,713 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript6355662,452
CSS45152,182
PHP625686905
PO File14246123
SVG10051

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity27.00
▷ Minimum class complexity7.00
▷ Maximum class complexity47.00
Average method complexity4.06
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods1694.12%
▷ Protected methods00.00%
▷ Private methods15.88%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.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.14MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/flags@2x.png169.54KB64.26KB▼ 62.10%
assets/img/flags.png64.41KB23.38KB▼ 63.70%