78% woo-product-variation-swatches

Code Review | Variation Swatches for WooCommerce

WordPress plugin Variation Swatches for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: woo-product-varia...
  • Plugin version: 2.3.12
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.3
  • WordPress version: 6.3.1
  • First release: Nov 20, 2018
  • Latest release: Nov 20, 2023
  • Number of updates: 98
  • Update frequency: every 18.9 days
  • Top authors: techlabpro1 (100%)

Code review

54 tests

User reviews

50 reviews

Install metrics

10,000+ active /277,270 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
Installer ran successfully

Server metrics [RAM: ▲0.56MB] [CPU: ▲4.02ms] Passed 4 tests

Server-side resources used by Variation Swatches for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1941.73 ▲1.03
Dashboard /wp-admin4.01 ▲0.7053.55 ▲3.47
Posts /wp-admin/edit.php4.06 ▲0.7050.65 ▲6.32
Add New Post /wp-admin/post-new.php6.53 ▲0.6498.26 ▲15.28
Media Library /wp-admin/upload.php3.92 ▲0.6938.85 ▲5.27

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 53 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
rtwpvs_pro_activate
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
rtwpvs_pro_version
db_upgraded

Browser metrics Passed 4 tests

Variation Swatches for WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,850 ▲8814.62 ▼0.101.99 ▲0.3343.72 ▼4.02
Dashboard /wp-admin2,240 ▲665.55 ▼0.0887.87 ▼11.1688.26 ▲41.78
Posts /wp-admin/edit.php2,164 ▲642.10 ▲0.0842.29 ▲0.4937.34 ▲2.87
Add New Post /wp-admin/post-new.php1,664 ▲13825.60 ▲2.65594.28 ▼107.2596.27 ▲38.43
Media Library /wp-admin/upload.php1,457 ▲604.21 ▲0.02102.81 ▼15.9380.58 ▲33.55

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • rtwpvs_pro_version
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/woo-product-variation-swatches/uninstall.php
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/woo-product-variation-swatches/woo-product-variation-swatches.php:28
    • > PHP Fatal error
      require_once(): Failed opening required 'RTWPVS_PLUGIN_PATHvendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/woo-product-variation-swatches/app/WooProductVariationSwatches.php on line 16
    • > PHP Warning
      Use of undefined constant RTWPVS_PLUGIN_PATH - assumed 'RTWPVS_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/woo-product-variation-swatches/app/WooProductVariationSwatches.php on line 16
    • > PHP Warning
      require_once(RTWPVS_PLUGIN_PATHvendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/woo-product-variation-swatches/app/WooProductVariationSwatches.php on line 16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
8 plugin tags: woocommerce, product attributes, woocommerce attributes, variable product attributes, woocommerce variation swatches...

woo-product-variation-swatches/woo-product-variation-swatches.php 85% from 13 tests

Analyzing the main PHP file in "Variation Swatches for WooCommerce" version 2.3.12
Please take the time to fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.0" instead of "4.8")
  • Text Domain: Please use dashes and lowercase characters for text domains

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin6,750 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
PHP298664424,306
JavaScript8552041,463
CSS6472951
SVG10025
JSON1005

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 105)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity34.67
▷ Minimum class complexity1.00
▷ Maximum class complexity190.00
Average method complexity4.56
▷ Minimum method complexity1.00
▷ Maximum method complexity105.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes14.76%
Methods208
▷ Static methods10751.44%
▷ Public methods18287.50%
▷ Protected methods10.48%
▷ Private methods2512.02%
Functions37
▷ Named functions12.70%
▷ Anonymous functions3697.30%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.08MB with 0.03MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/placeholder.png2.75KB2.92KB0.00%
assets/images/rtwpvs-pro.png39.92KB15.71KB▼ 60.66%
assets/images/icon-128x128.png10.51KB4.61KB▼ 56.09%
assets/images/rtwpvg-pro.png28.85KB12.85KB▼ 55.45%