84% woo-order-weight

Code Review | Order Weight for WooCommerce

WordPress plugin Order Weight for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: woo-order-weight
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 23, 2015
  • Latest release: Nov 9, 2023
  • Number of updates: 82
  • Update frequency: every 35.5 days
  • Top authors: andreaskarman (81.71%)weupnorth (19.51%)

Code review

54 tests

User reviews

6 reviews

Install metrics

500+ active /5,961 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼8.20ms] Passed 4 tests

Analyzing server-side resources used by Order Weight for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0044.57 ▲9.34
Dashboard /wp-admin3.31 ▼0.0443.36 ▼18.80
Posts /wp-admin/edit.php3.36 ▲0.0047.05 ▲1.73
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.33 ▼13.79
Media Library /wp-admin/upload.php3.23 ▲0.0033.89 ▼1.92

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Order Weight for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.67 ▲0.362.05 ▲0.3448.01 ▲3.23
Dashboard /wp-admin2,198 ▲215.62 ▼0.0182.78 ▼15.6838.38 ▼9.10
Posts /wp-admin/edit.php2,103 ▲31.95 ▲0.0141.93 ▲4.6038.91 ▲1.88
Add New Post /wp-admin/post-new.php1,526 ▼022.82 ▼0.20649.87 ▲21.4453.42 ▲2.31
Media Library /wp-admin/upload.php1,391 ▼94.18 ▲0.03101.05 ▲2.5340.28 ▼2.04

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 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 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/woo-order-weight/admin/class-woo-order-weight-wp-cli.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
9 plugin tags: shop, woocommerce plugin, ecommerce, order, woocommerce order weight...

woo-order-weight/woo-order-weight.php 92% from 13 tests

The main file in "Order Weight for WooCommerce" v. 1.2.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 200 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin994 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP14305702731
JavaScript24284204
CSS16036
PO File12223

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity6.90
▷ Minimum class complexity1.00
▷ Maximum class complexity40.00
Average method complexity1.87
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods68
▷ Static methods34.41%
▷ Public methods6189.71%
▷ Protected methods00.00%
▷ Private methods710.29%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected