83% woo-cost-of-shipping

Code Review | WooCommerce Cost of Shipping

WordPress plugin WooCommerce Cost of Shipping scored83%from 54 tests.

About plugin

  • Plugin page: woo-cost-of-shipping
  • Plugin version: 1.4.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2
  • WordPress version: 6.3.1
  • First release: Jun 25, 2018
  • Latest release: May 11, 2023
  • Number of updates: 16
  • Update frequency: every 111.4 days
  • Top authors: theritesites (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,620 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

An overview of server-side resources used by WooCommerce Cost of Shipping
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.11 ▼1.76
Dashboard /wp-admin3.31 ▲0.0046.67 ▲1.20
Posts /wp-admin/edit.php3.36 ▲0.0047.98 ▼1.05
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.90 ▼14.22
Media Library /wp-admin/upload.php3.23 ▲0.0039.03 ▲5.01

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Cost of Shipping
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.27 ▲0.041.65 ▲0.0838.09 ▼5.03
Dashboard /wp-admin2,192 ▲155.54 ▼0.1283.54 ▼2.2036.57 ▼5.17
Posts /wp-admin/edit.php2,100 ▲32.00 ▲0.0539.01 ▲5.5435.02 ▼4.04
Add New Post /wp-admin/post-new.php1,526 ▼023.22 ▲0.16647.58 ▼29.7158.14 ▲3.26
Media Library /wp-admin/upload.php1,403 ▲94.18 ▼0.1198.28 ▲1.3142.42 ▼1.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
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-cost-of-shipping/woocommerce-cost-of-shipping.php:344

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: woocommerce, cost of shipping, shipping cost, net profit, shipstation

woo-cost-of-shipping/woocommerce-cost-of-shipping.php 77% from 13 tests

This is the main PHP file of "WooCommerce Cost of Shipping" version 1.4.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woo-cost-of-shipping.php" instead of "woocommerce-cost-of-shipping.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("4.8.1" instead of "3.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin934 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP13256657872
CSS171044
Markdown33015
JavaScript2002
JSON1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity19.25
▷ Minimum class complexity1.00
▷ Maximum class complexity62.00
Average method complexity3.32
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes112.50%
Methods64
▷ Static methods710.94%
▷ Public methods5992.19%
▷ Protected methods34.69%
▷ Private methods23.12%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected