78% weight-based-shipping-for-woocommerce

Code Review | WooCommerce Weight Based Shipping

WordPress plugin WooCommerce Weight Based Shipping scored78%from 54 tests.

About plugin

  • Plugin page: weight-based-ship...
  • Plugin version: 5.6.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Jul 25, 2013
  • Latest release: Nov 19, 2023
  • Number of updates: 222
  • Update frequency: every 17.0 days
  • Top authors: dangoodman (100%)

Code review

54 tests

User reviews

78 reviews

Install metrics

60,000+ active /1,572,686 total downloads


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: ▼6.54ms] Passed 4 tests

A check of server-side resources used by WooCommerce Weight Based Shipping
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0348.83 ▲5.23
Dashboard /wp-admin3.34 ▼0.0145.35 ▼12.70
Posts /wp-admin/edit.php3.39 ▲0.0339.38 ▼7.34
Add New Post /wp-admin/post-new.php5.92 ▲0.0380.86 ▼11.35
Media Library /wp-admin/upload.php3.26 ▲0.0340.34 ▲5.42

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 172 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Weight Based Shipping
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲5914.27 ▼0.032.14 ▲0.4044.84 ▲0.66
Dashboard /wp-admin2,201 ▲305.60 ▲0.0290.20 ▼8.2439.35 ▼4.02
Posts /wp-admin/edit.php2,107 ▲71.99 ▲0.0334.77 ▼4.1235.12 ▼1.58
Add New Post /wp-admin/post-new.php1,532 ▲623.40 ▼0.16692.02 ▲58.5570.46 ▲21.23
Media Library /wp-admin/upload.php1,403 ▲34.18 ▼0.01102.38 ▲2.0146.62 ▲3.29

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
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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 items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/weight-based-shipping-for-woocommerce/server/tpl/main.php
  • 104× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WbsVendors\\Dgm\\SimpleProperties\\SimpleProperties' not found in wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/range/src/Range.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WbsVendors\\Dgm\\ClassNameAware\\ClassNameAware' not found in wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/shengine/src/Conditions/Common/AbstractCondition.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WbsVendors\\Dgm\\ClassNameAware\\ClassNameAware' not found in wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/shengine/src/Aggregators/AverageAggregator.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'WbsVendors\\Dgm\\Shengine\\Migrations\\Interfaces\\Migrations\\IRuleMigration' not found in wp-content/plugins/weight-based-shipping-for-woocommerce/server/migrations/5.2.6.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WbsVendors\\Dgm\\Shengine\\Attributes\\MapAttribute' not found in wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/shengine/src/Attributes/ProductVariationAttribute.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WbsVendors\\Dgm\\Shengine\\Conditions\\Common\\AbstractCondition' not found in wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/shengine/src/Conditions/Package/AbstractPackageCondition.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'WbsVendors\\Dgm\\Shengine\\Interfaces\\IPackage' not found in wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/shengine/src/Model/Package.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WbsVendors\\Dgm\\Shengine\\Conditions\\Common\\GroupCondition' not found in wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/shengine/src/Conditions/Common/Logic/OrCondition.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'WbsVendors\\Dgm\\Shengine\\Interfaces\\IItemAggregatables' not found in wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/shengine/src/Interfaces/IPackage.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'WbsVendors\\Dgm\\Shengine\\Interfaces\\IMatcher' not found in wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/shengine/src/RuleMatcher.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found


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 your attention:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

weight-based-shipping-for-woocommerce/plugin.php 92% from 13 tests

The main file in "WooCommerce Weight Based Shipping" v. 5.6.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("weight-based-shipping-for-woocommerce.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin5,626 lines of code in 170 files:
LanguageFilesBlank linesComment linesLines of code

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.34
Average class complexity4.27
▷ Minimum class complexity1.00
▷ Maximum class complexity49.00
Average method complexity2.02
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
▷ Abstract classes139.63%
▷ Concrete classes12290.37%
▷ Final classes00.00%
▷ Static methods7816.25%
▷ Public methods38880.83%
▷ Protected methods245.00%
▷ Private methods6814.17%
▷ Named functions26.06%
▷ Anonymous functions3193.94%
▷ Global constants00.00%
▷ Class constants29100.00%
▷ Public constants2896.55%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin