84% woo-locations

Code Review | WooCommerce Locations Pack

WordPress plugin WooCommerce Locations Pack scored84%from 54 tests.

About plugin

  • Plugin page: woo-locations
  • Plugin version: 1.9.4
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Jan 19, 2016
  • Latest release: Nov 20, 2023
  • Number of updates: 75
  • Update frequency: every 38.2 days
  • Top authors: dangoodman (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

1,000+ active /24,216 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.19ms] Passed 4 tests

Server-side resources used by WooCommerce Locations Pack
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0347.89 ▲9.37
Dashboard /wp-admin3.33 ▲0.0342.33 ▼1.70
Posts /wp-admin/edit.php3.38 ▲0.0247.01 ▼0.36
Add New Post /wp-admin/post-new.php5.91 ▲0.0280.56 ▼2.19
Media Library /wp-admin/upload.php3.25 ▲0.0231.37 ▼4.49

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

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

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Locations Pack
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.67 ▼0.051.65 ▲0.1043.05 ▲5.08
Dashboard /wp-admin2,195 ▲235.64 ▲0.0689.22 ▼28.5439.77 ▼1.64
Posts /wp-admin/edit.php2,103 ▲31.95 ▼0.0237.08 ▼4.5837.30 ▲1.23
Add New Post /wp-admin/post-new.php1,526 ▼323.12 ▼0.10648.47 ▼21.9953.00 ▲0.02
Media Library /wp-admin/upload.php1,400 ▼04.19 ▲0.0296.90 ▼4.7142.77 ▼3.36

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

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
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 20× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/woo-locations/assets/tpl.php:50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/woo-locations/locations/uk2.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/woo-locations/locations/za.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WcLocations\\add_action() in wp-content/plugins/woo-locations/src/Loader.php:75
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/woo-locations/assets/tpl.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/woo-locations/locations/eg.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/woo-locations/locations/fr.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/woo-locations/locations/ng.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/woo-locations/locations/in.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/woo-locations/locations/be.php:2

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)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
9 plugin tags: woocommerce egypt cities, woocommerce add states, woocommerce portugal districts, woocommerce, woocommerce uk counties...

woo-locations/woo-locations.php Passed 13 tests

The main PHP file in "WooCommerce Locations Pack" ver. 1.9.4 adds more information about the plugin and also serves as the entry point for this plugin
90 characters long description:
Extends WooCommerce with additional locations, such as UK counties, France provinces, etc.

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
Everything looks great! No dangerous files found in this plugin1,042 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP2189401,010
CSS11016
PO File16616

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity8.67
▷ Minimum class complexity3.00
▷ Maximum class complexity16.00
Average method complexity2.24
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods22
▷ Static methods313.64%
▷ Public methods1359.09%
▷ Protected methods00.00%
▷ Private methods940.91%
Functions6
▷ Named functions116.67%
▷ Anonymous functions583.33%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin