84% wc-class-based-shipping

Code Review | Class Based Shipping for WooCommerce — Define shipping methods per shipping class

WordPress plugin Class Based Shipping for WooCommerce — Define shipping methods per shipping class scored84%from 54 tests.

About plugin

  • Plugin page: wc-class-based-sh...
  • Plugin version: 1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.0
  • WordPress version: 6.3.1
  • First release: Jul 26, 2022
  • Latest release: Jul 27, 2022
  • Number of updates: 8
  • Update frequency: every 0.1 days
  • Top authors: unifiedservices (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /585 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
Install script ran successfully

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

An overview of server-side resources used by Class Based Shipping for WooCommerce — Define shipping methods per shipping class
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.06 ▲1.58
Dashboard /wp-admin3.31 ▲0.0045.16 ▼4.31
Posts /wp-admin/edit.php3.36 ▲0.0045.01 ▲2.89
Add New Post /wp-admin/post-new.php5.89 ▲0.0078.91 ▼17.88
Media Library /wp-admin/upload.php3.23 ▲0.0033.53 ▼0.77

Server storage [IO: ▲0.00MB] [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
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Class Based Shipping for WooCommerce — Define shipping methods per shipping class
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.21 ▼1.171.76 ▲0.0347.15 ▲3.48
Dashboard /wp-admin2,203 ▲124.85 ▼0.02107.19 ▼10.7742.23 ▼8.62
Posts /wp-admin/edit.php2,086 ▼32.04 ▲0.0432.84 ▼4.0034.30 ▲1.48
Add New Post /wp-admin/post-new.php1,533 ▼023.27 ▲0.03691.71 ▲69.8754.77 ▼3.39
Media Library /wp-admin/upload.php1,391 ▲34.22 ▲0.0495.96 ▼12.6842.58 ▼1.98

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 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 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-class-based-shipping/wc-class-based-shipping.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Contributors: The plugin contributors field is missing
You can take inspiration from this readme.txt

wc-class-based-shipping/wc-class-based-shipping.php Passed 13 tests

"Class Based Shipping for WooCommerce — Define shipping methods per shipping class" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
61 characters long description:
Define class-based shipping methods for WooCommerce products.

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
No dangerous file extensions were detected46 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1121646

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.88
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin