83% gf-auto-populate-country-state-city-ward-dropdown-addon

Code Review | Auto Populate Country/State/City/Ward DropDown Addon for Gravity Forms

WordPress plugin Auto Populate Country/State/City/Ward DropDown Addon for Gravity Forms scored 83% from 54 tests.

About plugin

  • Plugin page: gf-auto-populate-...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.7
  • WordPress version: 6.3.1
  • First release: Apr 3, 2021
  • Latest release: Jun 10, 2021
  • Number of updates: 18
  • Update frequency: every 3.8 days
  • Top authors: efetech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active / 755 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.16ms] Passed 4 tests

This is a short check of server-side resources used by Auto Populate Country/State/City/Ward DropDown Addon for Gravity Forms
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0145.65 ▲5.90
Dashboard /wp-admin3.31 ▲0.0145.93 ▼4.81
Posts /wp-admin/edit.php3.36 ▲0.0044.85 ▼0.79
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.81 ▼9.83
Media Library /wp-admin/upload.php3.23 ▲0.0037.47 ▲2.79

Server storage [IO: ▲33.55MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
These are issues you should consider
  • Try to limit filesystem usage to 25MB (currently using 33.55MB)
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Auto Populate Country/State/City/Ward DropDown Addon for Gravity Forms: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.27 ▼1.104.96 ▲3.2543.67 ▲3.52
Dashboard /wp-admin2,203 ▲155.77 ▲0.9196.54 ▼10.6338.52 ▼8.96
Posts /wp-admin/edit.php2,086 ▼32.05 ▲0.0334.12 ▼2.4834.39 ▲1.92
Add New Post /wp-admin/post-new.php1,533 ▲523.33 ▲5.01643.59 ▼2.0956.79 ▲8.57
Media Library /wp-admin/upload.php1,388 ▼04.21 ▲0.0293.92 ▼9.8141.65 ▼7.18

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'GFForms' not found in wp-content/plugins/gf-auto-populate-country-state-city-ward-dropdown-addon/class-gf-field-countrycity.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gf-auto-populate-country-state-city-ward-dropdown-addon/gfautocompleteaddressfieldaddon.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gf-auto-populate-country-state-city-ward-dropdown-addon/includes/ajax.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Users are easy to choose city national information.), #2 (PRO Version), #3 (PRO Version)
  • Plugin Name: Please specify the plugin name on the first line ( === gf-auto-populate-country-state-city-ward-dropdown-addon === )
The official readme.txt might help

gf-auto-populate-country-state-city-ward-dropdown-addon/gfautocompleteaddressfieldaddon.php 92% from 13 tests

This is the main PHP file of "Auto Populate Country/State/City/Ward DropDown Addon for Gravity Forms" version 1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("gf-auto-populate-country-state-city-ward-dropdown-addon.php" instead of "gfautocompleteaddressfieldaddon.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin916,447 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
JSON100915,366
PHP47036858
CSS23112115
JavaScript1121108

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity16.00
▷ Minimum class complexity2.00
▷ Maximum class complexity33.00
Average method complexity2.42
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods32
▷ Static methods26.25%
▷ Public methods32100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants1
▷ Global constants1100.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
4 PNG files occupy 0.12MB with 0.08MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png14.40KB4.23KB▼ 70.66%
screenshot-1.png15.00KB8.07KB▼ 46.16%
icon-256x256.png45.73KB18.02KB▼ 60.61%
screenshot-3.png49.27KB14.23KB▼ 71.12%