68% enweby-variation-swatches-for-woocommerce

Code Review | Variation Swatches for WooCommerce Stores

WordPress plugin Variation Swatches for WooCommerce Stores scored 68% from 54 tests.

About plugin

  • Plugin page: enweby-variation-...
  • Plugin version: 1.0.5
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3
  • WordPress version: 6.3.1
  • First release: Jan 18, 2023
  • Latest release: Sep 12, 2023
  • Number of updates: 28
  • Update frequency: every 8.7 days
  • Top authors: enweby (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 1,268 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.54MB] [CPU: ▼3.05ms] Passed 4 tests

A check of server-side resources used by Variation Swatches for WooCommerce Stores
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.06 ▲0.6040.61 ▼3.92
Dashboard /wp-admin3.90 ▲0.6049.43 ▲1.75
Posts /wp-admin/edit.php3.95 ▲0.5947.90 ▼2.43
Add New Post /wp-admin/post-new.php6.42 ▲0.5393.86 ▼7.61
Media Library /wp-admin/upload.php3.66 ▲0.4338.35 ▲6.59
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius4.0137.70

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 227 new files
Database: no new tables, 9 new options
New WordPress options
fs_active_plugins
db_upgraded
widget_recent-posts
widget_recent-comments
fs_debug_mode
widget_theysaidso_widget
fs_accounts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Variation Swatches for WooCommerce Stores
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲6314.46 ▲0.161.77 ▼0.2829.14 ▼15.66
Dashboard /wp-admin2,237 ▲495.83 ▼0.1899.23 ▼6.9741.01 ▲1.61
Posts /wp-admin/edit.php2,123 ▲312.04 ▲0.0835.72 ▼0.9035.81 ▲1.42
Add New Post /wp-admin/post-new.php1,532 ▲523.27 ▼0.00748.88 ▲83.7355.45 ▼0.45
Media Library /wp-admin/upload.php1,422 ▲374.25 ▼0.02104.96 ▲10.4349.61 ▲9.10
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius1,0841.8430.3529.53

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/enweby-variation-swatches-for-woocommerce/freemius/includes/class-freemius.php+8515
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 9 options in the database
    • db_upgraded
    • fs_active_plugins
    • can_compress_scripts
    • widget_recent-posts
    • fs_accounts
    • widget_recent-comments
    • widget_theysaidso_widget
    • fs_debug_mode
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/enweby-variation-swatches-for-woocommerce/admin/partials/enwbvs-admin-display.php
    • > /wp-content/plugins/enweby-variation-swatches-for-woocommerce/public/partials/enwbvs-public-display.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/enweby-variation-swatches-for-woocommerce/admin/admin-framework/admin-settings.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: There are too many tags (13 tag instead of maximum 10)
The official readme.txt might help

enweby-variation-swatches-for-woocommerce/enweby-variation-swatches-for-woocommerce.php Passed 13 tests

The main file in "Variation Swatches for WooCommerce Stores" v. 1.0.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
120 characters long description:
A lightweight plugin by Enweby used to display product variation swatches to enhance customer experience and engagement.

Code Analysis 97% from 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 plugin42,565 lines of code in 174 files:
LanguageFilesBlank linesComment linesLines of code
PHP1358,65319,11937,398
JavaScript105954792,799
CSS203511622,266
SVG80486
XML13016

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please tend to the following items
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,088)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity84.62
▷ Minimum class complexity1.00
▷ Maximum class complexity3,088.00
Average method complexity4.56
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes60
▷ Abstract classes23.33%
▷ Concrete classes5896.67%
▷ Final classes00.00%
Methods1,436
▷ Static methods21014.62%
▷ Public methods1,03271.87%
▷ Protected methods171.18%
▷ Private methods38726.95%
Functions108
▷ Named functions108100.00%
▷ Anonymous functions00.00%
Constants149
▷ Global constants10268.46%
▷ Class constants4731.54%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/special-offer-preview.png15.96KB6.02KB▼ 62.28%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
admin/images/ew-logo.png1.54KB1.32KB▼ 14.02%
admin/images/plugin-icon.png19.56KB8.31KB▼ 57.49%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%