89% portugal-states-distritos-for-woocommerce

Code Review | Portugal States (Distritos) for WooCommerce

WordPress plugin Portugal States (Distritos) for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: portugal-states-d...
  • Plugin version: 3.4.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Sep 20, 2014
  • Latest release: Jul 8, 2023
  • Number of updates: 81
  • Update frequency: every 39.7 days
  • Top authors: webdados (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

5,000+ active /40,857 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.02MB] [CPU: ▼8.32ms] Passed 4 tests

An overview of server-side resources used by Portugal States (Distritos) for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.0340.46 ▼5.15
Dashboard /wp-admin3.60 ▼0.0349.89 ▼17.24
Posts /wp-admin/edit.php3.71 ▲0.0355.81 ▼0.82
Add New Post /wp-admin/post-new.php6.18 ▲0.0395.08 ▼10.05
Media Library /wp-admin/upload.php3.52 ▲0.0341.50 ▲4.35

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Portugal States (Distritos) for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,913 ▲16714.37 ▼0.011.59 ▼0.0240.14 ▼2.38
Dashboard /wp-admin2,319 ▲1455.72 ▲0.1190.80 ▲2.9478.60 ▲38.11
Posts /wp-admin/edit.php2,231 ▲1312.17 ▲0.1640.18 ▲0.9738.54 ▼0.18
Add New Post /wp-admin/post-new.php1,643 ▲9423.36 ▲4.88748.78 ▲117.9753.06 ▲1.90
Media Library /wp-admin/upload.php1,521 ▲1274.22 ▲0.04101.13 ▼5.9173.01 ▲25.04

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: There are too many tags (12 tag instead of maximum 10)
The official readme.txt is a good inspiration

portugal-states-distritos-for-woocommerce/woocommerce-portugal-states.php 92% from 13 tests

The primary PHP file in "Portugal States (Distritos) for WooCommerce" version 3.4.1 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("portugal-states-distritos-for-woocommerce.php" instead of "woocommerce-portugal-states.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected141 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP22438140
SVG1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.33
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods6
▷ Static methods116.67%
▷ Public methods583.33%
▷ Protected methods00.00%
▷ Private methods116.67%
Functions6
▷ Named functions466.67%
▷ Anonymous functions233.33%
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
There are no PNG files in this plugin