94% wc-tiered-shipping

Code Review | WC Tiered Shipping

WordPress plugin WC Tiered Shipping scored 94% from 54 tests.

About plugin

  • Plugin page: wc-tiered-shipping
  • Plugin version: 3.1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.9
  • WordPress version: 5.8.1
  • First release: Apr 20, 2014
  • Latest release: Jan 27, 2022
  • Number of updates: 23
  • Update frequency: every 123.4 days
  • Top authors: thatdevgirl (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active / 3,190 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

This is a short check of server-side resources used by WC Tiered Shipping
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0028.61 ▲5.21
Dashboard /wp-admin3.06 ▼0.0035.23 ▼6.78
Posts /wp-admin/edit.php3.11 ▲0.0033.23 ▼0.34
Add New Post /wp-admin/post-new.php5.42 ▼0.0273.46 ▼592.77
Media Library /wp-admin/upload.php3.00 ▲0.0028.56 ▲1.04

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

WC Tiered Shipping: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,667 ▲6615.65 ▲0.014.83 ▼0.8576.23 ▼1.02
Dashboard /wp-admin2,926 ▲276.02 ▼0.14115.94 ▼14.68167.04 ▼6.01
Posts /wp-admin/edit.php2,737 ▼33.23 ▼0.0164.38 ▼1.92136.26 ▼9.41
Add New Post /wp-admin/post-new.php3,807 ▲7718.72 ▲3.40435.50 ▲8.19156.14 ▼9.36
Media Library /wp-admin/upload.php1,752 ▲35.45 ▼0.01143.99 ▲0.51176.33 ▼11.64

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

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 take a closer look at the following
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wc-tiered-shipping/inc/add.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ThreePM\\WCTieredShipping\\add_action() in wp-content/plugins/wc-tiered-shipping/inc/set-assets.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ThreePM\\WCTieredShipping\\is_admin() in wp-content/plugins/wc-tiered-shipping/inc/plugins-page.php:47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ThreePM\\WCTieredShipping\\add_action() in wp-content/plugins/wc-tiered-shipping/inc/activate.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-tiered-shipping/inc/init.php:226

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
3 plugin tags: flat rate, woocommerce, shipping

wc-tiered-shipping/wc-tiered-shipping.php Passed 13 tests

Analyzing the main PHP file in "WC Tiered Shipping" version 3.1.1
89 characters long description:
This WordPress plugin adds a tiered flat rate shipping option for the WooCommerce plugin.

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 detected260 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP679114213
JavaScript2142047

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity5.25
▷ Minimum class complexity2.00
▷ Maximum class complexity15.00
Average method complexity2.42
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.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

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected