83% gforms-addon-for-country-and-state-selection

Code Review | Country and State Selection Addon for Gravity Forms

WordPress plugin Country and State Selection Addon for Gravity Forms scored83%from 54 tests.

About plugin

  • Plugin page: gforms-addon-for-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.10-6.2
  • WordPress version: 6.3.1
  • First release: Nov 24, 2021
  • Latest release: Mar 18, 2023
  • Number of updates: 7
  • Update frequency: every 68.6 days
  • Top authors: coder426 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /3,580 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.00MB] [CPU: ▼9.26ms] Passed 4 tests

This is a short check of server-side resources used by Country and State Selection Addon for Gravity Forms
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.84 ▼2.30
Dashboard /wp-admin3.31 ▼0.0349.57 ▼16.57
Posts /wp-admin/edit.php3.36 ▲0.0159.35 ▲4.58
Add New Post /wp-admin/post-new.php5.89 ▲0.0188.06 ▼22.60
Media Library /wp-admin/upload.php3.23 ▲0.0142.38 ▲4.45

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Country and State Selection Addon for Gravity Forms
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.30 ▼1.071.97 ▲0.1440.20 ▼2.86
Dashboard /wp-admin2,206 ▲215.90 ▲1.03100.71 ▼3.2039.23 ▼0.73
Posts /wp-admin/edit.php2,092 ▲32.05 ▲0.0044.11 ▲2.5543.84 ▲7.08
Add New Post /wp-admin/post-new.php1,533 ▼1123.19 ▲4.63694.63 ▲64.6959.32 ▲7.87
Media Library /wp-admin/upload.php1,385 ▼04.21 ▼0.0497.52 ▼4.5247.35 ▲2.43

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however 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 items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'GFForms' not found in wp-content/plugins/gforms-addon-for-country-and-state-selection/class-gf-cws-fields.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gforms-addon-for-country-and-state-selection/includes/functions.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Requires php: Invalid version format
The official readme.txt is a good inspiration

gforms-addon-for-country-and-state-selection/index.php 77% from 13 tests

The main PHP file in "Country and State Selection Addon for Gravity Forms" ver. 1.0 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: It is recommended to name the main PHP file as the plugin slug ("gforms-addon-for-country-and-state-selection.php" instead of "index.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 395 characters long)
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected711 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP4112131661
JavaScript10327
CSS14023

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity20.00
▷ Minimum class complexity2.00
▷ Maximum class complexity60.00
Average method complexity3.24
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods34
▷ Static methods25.88%
▷ Public methods34100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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
There were not PNG files found in your plugin