89% ship-per-product

Code Review | Ship Per Product

WordPress plugin Ship Per Product scored89%from 54 tests.

About plugin

  • Plugin page: ship-per-product
  • Plugin version: 2.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-6.0.0
  • WordPress version: 6.3.1
  • First release: May 27, 2016
  • Latest release: Jul 23, 2022
  • Number of updates: 30
  • Update frequency: every 74.9 days
  • Top authors: cedcommerce (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /15,700 total downloads

Benchmarks

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.01MB] [CPU: ▼8.53ms] Passed 4 tests

Server-side resources used by Ship Per Product
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0037.84 ▼0.39
Dashboard /wp-admin3.31 ▼0.0442.45 ▼19.57
Posts /wp-admin/edit.php3.36 ▲0.0041.36 ▼3.46
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.44 ▼7.95
Media Library /wp-admin/upload.php3.23 ▲0.0032.56 ▼3.12

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ship Per Product
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.17 ▼0.561.75 ▲0.2146.05 ▲5.43
Dashboard /wp-admin2,192 ▲155.53 ▼0.0580.97 ▼21.3338.31 ▼6.31
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.0434.78 ▼4.0535.23 ▼3.11
Add New Post /wp-admin/post-new.php1,526 ▼223.41 ▲0.36648.14 ▼23.8153.72 ▲3.42
Media Library /wp-admin/upload.php1,394 ▼94.19 ▲0.0096.11 ▼9.7044.06 ▼2.57

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

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
Please fix the following attributes: The official readme.txt might help

ship-per-product/ship-per-product.php Passed 13 tests

"Ship Per Product" version 2.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
93 characters long description:
Per product shipping allows to add shipping costs for individual, based on customer location.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected3,602 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP52484682,097
CSS3311711
JavaScript33241614
PO File17488180

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Method cyclomatic complexity should be reduced to less than 100 (currently 106)
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity126.67
▷ Minimum class complexity39.00
▷ Maximum class complexity222.00
Average method complexity9.57
▷ Minimum method complexity1.00
▷ Maximum method complexity106.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods44
▷ Static methods1329.55%
▷ Public methods44100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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
8 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/sort_asc_disabled.png0.14KB0.25KB0.00%
assets/images/sort_both.png0.20KB0.29KB0.00%
assets/images/sort_asc.png0.16KB0.25KB0.00%
assets/images/sort_desc.png0.15KB0.25KB0.00%
assets/images/icon.png9.15KB0.80KB▼ 91.21%