83% woo-commerce-min-weight

Code Review | Woo Commerce Minimum Weight

WordPress plugin Woo Commerce Minimum Weight scored83%from 54 tests.

About plugin

  • Plugin page: woo-commerce-min-...
  • Plugin version: 3.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7
  • WordPress version: 6.3.1
  • First release: Jul 30, 2014
  • Latest release: Dec 30, 2016
  • Number of updates: 14
  • Update frequency: every 63.2 days
  • Top authors: hemant29 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /16,767 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼16.61MB] [CPU: ▼3,450,293.65ms] Passed 4 tests

Analyzing server-side resources used by Woo Commerce Minimum Weight
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0342.93 ▼1.25
Dashboard /wp-admin3.42 ▼66.6049.68 ▼13,801,157.94
Posts /wp-admin/edit.php3.46 ▲0.0649.94 ▼2.86
Add New Post /wp-admin/post-new.php6.11 ▲0.1882.50 ▼12.55
Media Library /wp-admin/upload.php3.36 ▲0.0964.08 ▲25.04

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Woo Commerce Minimum Weight
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4314.24 ▲0.002.05 ▲0.4341.59 ▼0.30
Dashboard /wp-admin2,210 ▲335.55 ▼0.0587.36 ▼7.3081.44 ▲37.99
Posts /wp-admin/edit.php2,118 ▲182.01 ▲0.0234.83 ▼8.7734.53 ▼3.79
Add New Post /wp-admin/post-new.php1,553 ▲2723.02 ▼0.75777.41 ▲85.7958.16 ▲4.80
Media Library /wp-admin/upload.php1,415 ▲184.20 ▲0.03178.99 ▲75.79119.05 ▲74.69

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/woo-commerce-min-weight/min-weight.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/woo-commerce-min-weight/edit-weight.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (screenshot-1.png.), #2 (screenshot-2.png)
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === woo-commerce-min-weight === )
  • Donate link: Please fix this invalid url: ""
You can look at the official readme.txt

woo-commerce-min-weight/min-weight.php 92% from 13 tests

The main PHP file in "Woo Commerce Minimum Weight" ver. 3.0.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-commerce-min-weight.php" instead of "min-weight.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin57 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP233157

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.25
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
Namespaces0
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
4 PNG files occupy 0.12MB with 0.06MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png36.19KB11.09KB▼ 69.34%
image/members_icon.png0.63KB0.61KB▼ 3.27%
screenshot-1.png11.06KB4.20KB▼ 62.00%
screenshot.png77.52KB28.71KB▼ 62.96%