78% variation-swatches-for-woocommerce

Code Review | Variation Swatches for WooCommerce

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

About plugin

  • Plugin page: variation-swatche...
  • Plugin version: 2.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.2.2
  • WordPress version: 6.3.1
  • First release: Jan 17, 2017
  • Latest release: Jul 3, 2023
  • Number of updates: 43
  • Update frequency: every 54.8 days
  • Top authors: themealien (97.67%)rextheme (4.65%)

Code review

54 tests

User reviews

56 reviews

Install metrics

60,000+ active /1,091,545 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.01MB] [CPU: ▼12.15ms] Passed 4 tests

A check of server-side resources used by Variation Swatches for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0035.80 ▼3.64
Dashboard /wp-admin3.31 ▼0.0444.62 ▼12.58
Posts /wp-admin/edit.php3.36 ▲0.0044.03 ▼12.80
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.14 ▼19.58
Media Library /wp-admin/upload.php3.23 ▲0.0033.98 ▼1.46

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 49 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Variation Swatches for WooCommerce: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.63 ▼0.671.63 ▼0.2445.65 ▲2.65
Dashboard /wp-admin2,209 ▲215.79 ▼0.04102.19 ▼6.4040.53 ▼5.66
Posts /wp-admin/edit.php2,095 ▲32.00 ▼0.0641.05 ▼1.9734.80 ▼2.59
Add New Post /wp-admin/post-new.php1,520 ▲617.43 ▼0.10652.65 ▼14.7455.38 ▼6.11
Media Library /wp-admin/upload.php1,397 ▲94.23 ▲0.01103.11 ▼3.9342.89 ▼2.49

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however 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 output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/variation-swatches-for-woocommerce/templates/admin/partials/panel-video-tutorials.php
    • > /wp-content/plugins/variation-swatches-for-woocommerce/templates/admin/welcome-popup.php
  • 20× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/variation-swatches-for-woocommerce/templates/admin/partials/panel-footer.php:5
    • > PHP Warning
      Use of undefined constant WCVS_PLUGIN_URL - assumed 'WCVS_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/variation-swatches-for-woocommerce/templates/admin/partials/panel-video-tutorials.php on line 31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/variation-swatches-for-woocommerce/templates/admin/partials/panel-sidebar.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'VSWC_Addons_Page' not found in wp-content/plugins/variation-swatches-for-woocommerce/templates/admin/partials/modules-grid.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/variation-swatches-for-woocommerce/templates/admin/partials/panel-header.php:12
    • > PHP Warning
      Use of undefined constant WCVS_PLUGIN_URL - assumed 'WCVS_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/variation-swatches-for-woocommerce/templates/admin/partials/panel-video-tutorials.php on line 26
    • > PHP Warning
      Use of undefined constant WCVS_PLUGIN_URL - assumed 'WCVS_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/variation-swatches-for-woocommerce/templates/admin/partials/support-card.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/variation-swatches-for-woocommerce/templates/admin/partials/dashboard-header.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/variation-swatches-for-woocommerce/templates/admin/pro-feature-popup.php:8
    • > PHP Warning
      Use of undefined constant WCVS_PLUGIN_URL - assumed 'WCVS_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/variation-swatches-for-woocommerce/templates/admin/partials/dashboard-header.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: variation swatches for woocommerce, woocommerce color swatches, variation swatches

variation-swatches-for-woocommerce/variation-swatches-for-woocommerce.php 85% from 13 tests

Analyzing the main PHP file in "Variation Swatches for WooCommerce" version 2.2.0
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 173 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected9,668 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP234486583,714
CSS4186193,230
Sass442902,208
JavaScript412258516

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity39.78
▷ Minimum class complexity4.00
▷ Maximum class complexity134.00
Average method complexity3.81
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes111.11%
Methods123
▷ Static methods1512.20%
▷ Public methods9173.98%
▷ Protected methods00.00%
▷ Private methods3226.02%
Functions9
▷ Named functions555.56%
▷ Anonymous functions444.44%
Constants6
▷ Global constants6100.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.04MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/wc-plugins.png18.43KB7.25KB▼ 60.64%
assets/images/wslogo.png10.95KB11.86KB0.00%
assets/images/wslogo-dash.png7.09KB3.30KB▼ 53.52%
assets/images/support.png8.08KB3.60KB▼ 55.48%