84% shipping-methods-by-classes

Code Review | Shipping Methods By Classes

WordPress plugin Shipping Methods By Classes scored84%from 54 tests.

About plugin

  • Plugin page: shipping-methods-...
  • Plugin version: 1.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.7-6.1
  • WordPress version: 6.3.1
  • First release: Dec 17, 2021
  • Latest release: Jan 27, 2023
  • Number of updates: 11
  • Update frequency: every 37.1 days
  • Top authors: bastho (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
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Shipping Methods By Classes
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.93 ▼3.15
Dashboard /wp-admin3.31 ▼0.0349.57 ▼18.50
Posts /wp-admin/edit.php3.36 ▲0.0147.25 ▼5.00
Add New Post /wp-admin/post-new.php5.89 ▲0.0189.09 ▼12.53
Media Library /wp-admin/upload.php3.23 ▲0.0137.00 ▲1.04

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Shipping Methods By Classes
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲9414.84 ▲0.471.97 ▲0.2146.27 ▲2.23
Dashboard /wp-admin2,221 ▲215.86 ▲0.9799.89 ▼17.2939.63 ▼6.86
Posts /wp-admin/edit.php2,100 ▼02.02 ▼0.0140.25 ▲2.2835.72 ▲0.77
Add New Post /wp-admin/post-new.php1,550 ▲1023.03 ▲4.55627.18 ▼9.2955.80 ▼4.18
Media Library /wp-admin/upload.php1,403 ▲94.19 ▼0.0497.60 ▼6.6342.93 ▼5.55

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

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

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/shipping-methods-by-classes/shipping-methods-by-classes.php:12

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: shipping method, woocommerce, conditional shipping, woocommerce shipping, shipping-zone...

shipping-methods-by-classes/shipping-methods-by-classes.php Passed 13 tests

The primary PHP file in "Shipping Methods By Classes" version 1.0 is used by WordPress to initiate all plugin functionality
59 characters long description:
Disable some shipping methods depending on shipping classes

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
No dangerous file extensions were detected475 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
SVG120379
PHP1133180
YAML11014
Markdown1102

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
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
Namespaces1
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%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
_assets/icon-128x128.png5.30KB2.27KB▼ 57.13%
_assets/icon-256x256.png11.61KB4.14KB▼ 64.37%