83% wc-guatemala

Code Review | Guatemala States and Cities for WooCommerce

WordPress plugin Guatemala States and Cities for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: wc-guatemala
  • Plugin version: 3.0.4
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.0
  • WordPress version: 6.3.1
  • First release: Sep 9, 2020
  • Latest release: Oct 31, 2022
  • Number of updates: 23
  • Update frequency: every 34.0 days
  • Top authors: XicoOfficial (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

70+ active /1,021 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼0.91ms] Passed 4 tests

This is a short check of server-side resources used by Guatemala States and Cities for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0436.57 ▲0.49
Dashboard /wp-admin3.34 ▲0.0445.34 ▼4.98
Posts /wp-admin/edit.php3.39 ▲0.0446.80 ▲0.71
Add New Post /wp-admin/post-new.php5.92 ▲0.0499.55 ▲5.47
Media Library /wp-admin/upload.php3.26 ▲0.0336.21 ▲0.12

Server storage [IO: ▲0.92MB] [DB: ▲0.06MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 24 new files
Database: 3 new tables, 6 new options
New tables
wp_dl_wc_gt_ciudad
wp_dl_wc_gt_municipio
wp_dl_wc_gt_departamento
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Guatemala States and Cities for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.14 ▼0.441.69 ▲0.1738.15 ▼1.71
Dashboard /wp-admin2,189 ▲215.54 ▼0.0485.35 ▼3.1841.13 ▼2.64
Posts /wp-admin/edit.php2,100 ▼01.98 ▼0.0338.82 ▲3.5735.49 ▲3.78
Add New Post /wp-admin/post-new.php1,526 ▼023.52 ▲0.48637.64 ▼34.3958.10 ▲0.49
Media Library /wp-admin/upload.php1,400 ▲34.18 ▼0.0393.84 ▼7.1043.67 ▼0.64

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% 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 everything seems fine, this is not an exhaustive test

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
Please fix the following
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Trying to get property 'base_prefix' of non-object in wp-content/plugins/wc-guatemala/places/GT.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to a member function prepare() on null in wp-content/plugins/wc-guatemala/places/GT.php:20
    • > PHP Notice
      Trying to get property 'base_prefix' of non-object in wp-content/plugins/wc-guatemala/places/GT.php on line 18
    • > PHP Fatal error
      Uncaught Error: Call to a member function prepare() on null in wp-content/plugins/wc-guatemala/states/GT.php:14
    • > PHP Notice
      Trying to get property 'base_prefix' of non-object in wp-content/plugins/wc-guatemala/states/GT.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% 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 require attention:
  • Tags: Too many tags (16 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

wc-guatemala/wc-guatemala-departamentos-y-ciudades.php 85% from 13 tests

The principal PHP file in "Guatemala States and Cities for WooCommerce" v. 3.0.4 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wc-guatemala.php" instead of "wc-guatemala-departamentos-y-ciudades.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("5.8" instead of "5.9")

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
Good job! No executable or dangerous file extensions detected7,097 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
JSON1005,504
PHP71711911,188
JavaScript25816328
PO File1171877

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity35.00
▷ Minimum class complexity30.00
▷ Maximum class complexity40.00
Average method complexity3.27
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods30
▷ Static methods413.33%
▷ Public methods2686.67%
▷ Protected methods13.33%
▷ Private methods310.00%
Functions10
▷ Named functions990.00%
▷ Anonymous functions110.00%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
10 PNG files occupy 0.60MB with 0.32MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-772x250.png46.70KB18.44KB▼ 60.52%
assets/screenshot-2.PNG23.89KB12.72KB▼ 46.76%
assets/banner-1544x500.png129.17KB47.06KB▼ 63.57%
assets/screenshot-6.PNG67.26KB31.61KB▼ 53.00%
assets/screenshot-5.PNG116.30KB61.90KB▼ 46.77%