83% drop-down-cities-for-woocommerce

Code Review | WooCommerce Drop-Down Cities

WordPress plugin WooCommerce Drop-Down Cities scored83%from 54 tests.

About plugin

  • Plugin page: drop-down-cities-...
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.14-5.4
  • WordPress version: 6.3.1
  • First release: Apr 20, 2020
  • Latest release: Apr 21, 2020
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: nuralammsb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /861 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼7.86ms] Passed 4 tests

A check of server-side resources used by WooCommerce Drop-Down Cities
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0943.07 ▲5.14
Dashboard /wp-admin3.40 ▲0.0548.88 ▼18.17
Posts /wp-admin/edit.php3.45 ▲0.0948.17 ▼1.14
Add New Post /wp-admin/post-new.php5.98 ▲0.0989.39 ▼11.14
Media Library /wp-admin/upload.php3.32 ▲0.0936.60 ▼0.99

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for WooCommerce Drop-Down Cities
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲3014.35 ▲0.131.67 ▲0.0445.50 ▲2.94
Dashboard /wp-admin2,189 ▲95.48 ▼0.1384.64 ▼11.6138.41 ▼2.27
Posts /wp-admin/edit.php2,100 ▼01.99 ▲0.0434.37 ▼4.2839.88 ▲2.22
Add New Post /wp-admin/post-new.php1,526 ▼023.01 ▲0.01668.04 ▼50.7362.52 ▲5.40
Media Library /wp-admin/upload.php1,403 ▲64.10 ▼0.1299.42 ▼2.1745.46 ▲1.20

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/drop-down-cities-for-woocommerce/woocommerce_drop_down_cities.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 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
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
  • Screenshots: Screenshot #1 (In this screenshot you can see the plugin in action.) image not found
You can take inspiration from this readme.txt

drop-down-cities-for-woocommerce/woocommerce_drop_down_cities.php 85% from 13 tests

The principal PHP file in "WooCommerce Drop-Down Cities" v. 1.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 186 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("drop-down-cities-for-woocommerce.php" instead of "woocommerce_drop_down_cities.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
Good job! No executable or dangerous file extensions detected728 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP21827682
CSS1101846

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin