90% product-variation-swatches-for-woocommerce

Code Review | Variation Swatches for WooCommerce

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

About plugin

  • Plugin page: product-variation...
  • Plugin version: 2.3.5
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Dec 28, 2018
  • Latest release: Nov 14, 2023
  • Number of updates: 84
  • Update frequency: every 21.2 days
  • Top authors: ThemeHigh (100%)

Code review

54 tests

User reviews

69 reviews

Install metrics

10,000+ active /141,369 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: ▼8.53ms] Passed 4 tests

Analyzing 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.0135.73 ▼6.92
Dashboard /wp-admin3.31 ▼0.0446.12 ▼15.79
Posts /wp-admin/edit.php3.37 ▲0.0049.53 ▲0.85
Add New Post /wp-admin/post-new.php5.90 ▲0.0086.52 ▼10.09
Media Library /wp-admin/upload.php3.24 ▲0.0034.18 ▼1.31

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 89 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Variation Swatches for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲3914.67 ▲0.331.72 ▼0.0340.17 ▼4.44
Dashboard /wp-admin2,198 ▲245.60 ▼0.0193.70 ▼7.2339.53 ▼4.17
Posts /wp-admin/edit.php2,100 ▼01.94 ▼0.0240.42 ▲1.9035.75 ▼0.78
Add New Post /wp-admin/post-new.php1,526 ▼023.35 ▲0.13676.96 ▲42.7259.19 ▲10.76
Media Library /wp-admin/upload.php1,397 ▼34.20 ▼0.04101.41 ▼2.9746.08 ▼0.22

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests Passed 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)
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: variations, variation swatches for woocommerce, woocommerce variation, woocommerce variation swatches, woocommerce attributes...

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

This is the main PHP file of "Variation Swatches for WooCommerce" version 2.3.5, 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: The required version number did not match the one declared in readme.txt ("5.3" instead of "4.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected10,305 lines of code in 75 files:
LanguageFilesBlank linesComment linesLines of code
PHP151,4179834,792
JavaScript10672942,464
CSS43131532,143
SVG46323906

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity64.77
▷ Minimum class complexity2.00
▷ Maximum class complexity260.00
Average method complexity5.00
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes17.69%
▷ Concrete classes1292.31%
▷ Final classes00.00%
Methods207
▷ Static methods2411.59%
▷ Public methods14670.53%
▷ Protected methods167.73%
▷ Private methods4521.74%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants872.73%
▷ Class constants327.27%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
9 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/style-1.png1.12KB0.88KB▼ 20.84%
admin/assets/images/empty-image.png24.75KB10.16KB▼ 58.94%
admin/assets/images/speaker-image.png11.87KB4.54KB▼ 61.76%
admin/assets/images/radio-style-2.png19.87KB4.15KB▼ 79.11%
admin/assets/images/help.png0.30KB0.32KB0.00%