90% woo-add-custom-states

Code Review | Woo Add Custom States

WordPress plugin Woo Add Custom States scored 90% from 54 tests.

About plugin

  • Plugin page: woo-add-custom-st...
  • Plugin version: 1.8.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.9.2
  • WordPress version: 6.3.1
  • First release: Dec 13, 2016
  • Latest release: Mar 27, 2022
  • Number of updates: 43
  • Update frequency: every 44.7 days
  • Top authors: trusted (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

800+ active / 9,316 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.47ms] Passed 4 tests

An overview of server-side resources used by Woo Add Custom States
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.08 ▼0.97
Dashboard /wp-admin3.31 ▲0.0049.02 ▼3.08
Posts /wp-admin/edit.php3.36 ▲0.0044.16 ▼2.65
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.77 ▼7.17
Media Library /wp-admin/upload.php3.23 ▲0.0036.73 ▲3.73

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Woo Add Custom States
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.81 ▲0.441.71 ▼0.1244.48 ▼8.49
Dashboard /wp-admin2,203 ▲155.84 ▲0.9797.82 ▼8.7338.94 ▼8.86
Posts /wp-admin/edit.php2,089 ▼02.01 ▲0.0234.45 ▼3.2735.55 ▲2.03
Add New Post /wp-admin/post-new.php1,534 ▲623.26 ▲0.69645.11 ▼4.1663.12 ▲4.39
Media Library /wp-admin/upload.php1,382 ▲34.16 ▼0.0796.37 ▼7.2142.30 ▼2.53

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
10 plugin tags: states, shipping zones, zones, shipping zone, regions...

woo-add-custom-states/woo-add-custom-states.php 92% from 13 tests

"Woo Add Custom States" version 1.8.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("4.5" instead of "4.0")

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
Everything looks great! No dangerous files found in this plugin388 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP86031373
JavaScript11015

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity6.80
▷ Minimum class complexity1.00
▷ Maximum class complexity24.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin