89% product-variations-swatches-for-woocommerce

Code Review | Product Variations Swatches for WooCommerce

WordPress plugin Product Variations Swatches for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: product-variation...
  • Plugin version: 1.1.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.4.0
  • WordPress version: 6.3.1
  • First release: Apr 1, 2020
  • Latest release: Nov 30, 2023
  • Number of updates: 37
  • Update frequency: every 36.2 days
  • Top authors: kimvt1991 (40.54%)mytrinh (32.43%)dragonlord47 (18.92%)villatheme (16.22%)

Code review

54 tests

User reviews

69 reviews

Install metrics

10,000+ active /274,472 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.27MB] [CPU: ▼4.74ms] Passed 4 tests

A check of server-side resources used by Product Variations Swatches for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2736.40 ▼5.85
Dashboard /wp-admin3.57 ▲0.2743.87 ▼4.84
Posts /wp-admin/edit.php3.69 ▲0.3347.41 ▼1.06
Add New Post /wp-admin/post-new.php6.15 ▲0.2790.58 ▼7.19
Media Library /wp-admin/upload.php3.50 ▲0.2636.12 ▲3.18

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Product Variations Swatches for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲3714.72 ▲0.451.74 ▼0.0343.15 ▼0.22
Dashboard /wp-admin2,201 ▲235.70 ▲0.0083.85 ▼31.1239.51 ▼6.66
Posts /wp-admin/edit.php2,110 ▲102.03 ▲0.0736.87 ▼3.5237.29 ▲2.48
Add New Post /wp-admin/post-new.php1,544 ▲1025.20 ▲2.37635.91 ▲6.5573.79 ▲20.66
Media Library /wp-admin/upload.php1,412 ▲94.16 ▼0.0595.20 ▼4.8143.49 ▲2.26

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Congratulations! This plugin passed the SRP test

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)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed: You can take inspiration from this readme.txt

product-variations-swatches-for-woocommerce/product-variations-swatches-for-woocommerce.php 92% from 13 tests

"Product Variations Swatches for WooCommerce" version 1.1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 421 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin13,722 lines of code in 67 files:
LanguageFilesBlank linesComment linesLines of code
PHP142781526,161
SVG30122,880
JavaScript161301252,418
CSS333081831,774
PO File1189427489

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity52.00
▷ Minimum class complexity2.00
▷ Maximum class complexity223.00
Average method complexity7.21
▷ Minimum method complexity1.00
▷ Maximum method complexity78.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods91
▷ Static methods99.89%
▷ Public methods8391.21%
▷ Protected methods22.20%
▷ Private methods66.59%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.00%
Constants12
▷ Global constants12100.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
1 PNG file occupies 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/minicolors.png67.02KB34.31KB▼ 48.80%