83% wc-variation-swatches

Code Review | Product Variation Swatches for WooCommerce

WordPress plugin Product Variation Swatches for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: wc-variation-swat...
  • Plugin version: 1.0.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.1
  • WordPress version: 6.3.1
  • First release: Sep 1, 2019
  • Latest release: Nov 20, 2022
  • Number of updates: 15
  • Update frequency: every 78.5 days
  • Top authors: manikmist09 (73.33%)pluginever (26.67%)manzurahammed (13.33%)

Code review

54 tests

User reviews

5 reviews

Install metrics

400+ active /9,145 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼9.90ms] Passed 4 tests

An overview of server-side resources used by Product Variation Swatches for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.81 ▼2.99
Dashboard /wp-admin3.32 ▼0.0346.76 ▼8.88
Posts /wp-admin/edit.php3.37 ▲0.0142.74 ▼5.88
Add New Post /wp-admin/post-new.php5.90 ▲0.0179.05 ▼21.84
Media Library /wp-admin/upload.php3.24 ▲0.0135.53 ▲2.05

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 18 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
wc_variation_swatches_admin_notifications
wc_variation_swatches_install_date
db_upgraded
widget_theysaidso_widget
wc_variation_swatches_version

Browser metrics Passed 4 tests

Product Variation Swatches for WooCommerce: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲5914.26 ▼0.091.67 ▼0.0236.14 ▼2.94
Dashboard /wp-admin2,204 ▲275.61 ▲0.0195.53 ▲10.0541.88 ▼3.10
Posts /wp-admin/edit.php2,107 ▲71.98 ▼0.0335.54 ▲0.5933.75 ▼3.85
Add New Post /wp-admin/post-new.php1,532 ▲622.91 ▼0.06593.56 ▼67.7750.92 ▼6.40
Media Library /wp-admin/upload.php1,406 ▲94.22 ▼0.0593.52 ▼5.3541.77 ▼5.91

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: 9 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • wc_variation_swatches_admin_notifications
    • wc_variation_swatches_install_date
    • wc_variation_swatches_version
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Variation_Swatches_Settings_API' not found in wp-content/plugins/wc-variation-swatches/includes/admin/class-settings.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-variation-swatches/includes/class-single-variation.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 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
Please fix the following attributes:
  • Screenshots: A description for screenshot #12 is missing in wc-variation-swatches/assets to your readme.txt
  • Screenshots: Screenshot #10 (Label Text Swatches) image missing
The official readme.txt is a good inspiration

wc-variation-swatches/wc-variation-swatches.php 92% from 13 tests

This is the main PHP file of "Product Variation Swatches for WooCommerce" version 1.0.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Requires at least: Required version does not match the one declared in readme.txt ("4.4" instead of "3.0.0")

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
Success! There were no dangerous files found in this plugin1,344 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP93936051,218
JavaScript45714124
CSS2002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity24.17
▷ Minimum class complexity1.00
▷ Maximum class complexity75.00
Average method complexity2.93
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes116.67%
Methods72
▷ Static methods34.17%
▷ Public methods6387.50%
▷ Protected methods79.72%
▷ Private methods22.78%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
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
No PNG images were found in this plugin