89% woo-weight-based-shipping-for-statesregionscities

Code Review | Woocommerce Weight Based shipping for States/Regions/Cities

WordPress plugin Woocommerce Weight Based shipping for States/Regions/Cities scored89%from 54 tests.

About plugin

  • Plugin page: woo-weight-based-...
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.8
  • WordPress version: 6.3.1
  • First release: Mar 25, 2019
  • Latest release: Mar 25, 2019
  • Number of updates: 2
  • Update frequency: every 58.5 days
  • Top authors: timbs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /540 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

A check of server-side resources used by Woocommerce Weight Based shipping for States/Regions/Cities
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0244.02 ▼0.47
Dashboard /wp-admin3.33 ▲0.0253.05 ▼3.46
Posts /wp-admin/edit.php3.38 ▲0.0255.62 ▲4.89
Add New Post /wp-admin/post-new.php5.91 ▲0.0288.90 ▼5.46
Media Library /wp-admin/upload.php3.25 ▲0.0238.77 ▼0.99

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Woocommerce Weight Based shipping for States/Regions/Cities
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.72 ▲0.471.63 ▼0.1039.20 ▼4.19
Dashboard /wp-admin2,198 ▲185.62 ▼0.0483.80 ▼6.8740.79 ▲3.45
Posts /wp-admin/edit.php2,100 ▼31.95 ▼0.0539.40 ▲2.9535.86 ▲3.74
Add New Post /wp-admin/post-new.php1,526 ▼023.28 ▼0.47657.39 ▼32.0059.52 ▼2.96
Media Library /wp-admin/upload.php1,400 ▼04.19 ▼0.01100.14 ▼10.9741.94 ▼5.02

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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 just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • License uri: Invalid URI ("[http://www.gnu.org/licenses/gpl-2.0.html](http://www.gnu.org/licenses/gpl-2.0.html)")
The official readme.txt is a good inspiration

woo-weight-based-shipping-for-statesregionscities/woocommerce-states-and-cities-weight-shipping.php 85% from 13 tests

The main file in "Woocommerce Weight Based shipping for States/Regions/Cities" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-weight-based-shipping-for-statesregionscities.php" instead of "woocommerce-states-and-cities-weight-shipping.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin102 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP12844102

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
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
PNG images were not found in this plugin