84% variation-swatches-adjacent-products-for-woocommerce

Code Review | Variation Swatches Smart Products Gallery for WooCommerce

WordPress plugin Variation Swatches Smart Products Gallery for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: variation-swatche...
  • Plugin version: 1.0.8
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Apr 1, 2021
  • Latest release: Sep 8, 2023
  • Number of updates: 55
  • Update frequency: every 16.2 days
  • Top authors: m.tuhin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,262 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.00MB] [CPU: ▼6.44ms] Passed 4 tests

Analyzing server-side resources used by Variation Swatches Smart Products Gallery for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.69 ▼1.59
Dashboard /wp-admin3.31 ▲0.0047.59 ▼3.78
Posts /wp-admin/edit.php3.36 ▲0.0050.43 ▲0.42
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.95 ▼18.24
Media Library /wp-admin/upload.php3.23 ▲0.0035.65 ▼2.16
Welcome /wp-admin/admin.php?page=cs-wvsap-welcome3.0022.09

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 56 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Variation Swatches Smart Products Gallery for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.18 ▼0.181.80 ▼0.0643.13 ▲1.07
Dashboard /wp-admin2,192 ▲125.63 ▲0.0189.97 ▼10.3637.67 ▼14.60
Posts /wp-admin/edit.php2,100 ▼01.98 ▲0.0235.22 ▼3.3134.82 ▲0.10
Add New Post /wp-admin/post-new.php1,526 ▼023.10 ▼0.06662.90 ▼21.9367.93 ▲5.38
Media Library /wp-admin/upload.php1,394 ▼64.15 ▼0.0899.97 ▼13.6144.57 ▼3.39
Welcome /wp-admin/admin.php?page=cs-wvsap-welcome280.420.094.12

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
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • 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
Even though everything seems fine, this is not an exhaustive test

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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=cs-wvsap-welcome
    • > Network (severe)
    wp-admin/admin.php?page=cs-wvsap-welcome - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: smart showcase, variations, swatches, woocommerce product gallery, swatch gallery...

variation-swatches-adjacent-products-for-woocommerce/woo-variation-swatches-adjacent-products.php 92% from 13 tests

"Variation Swatches Smart Products Gallery for WooCommerce" version 1.0.8's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("variation-swatches-adjacent-products-for-woocommerce.php" instead of "woo-variation-swatches-adjacent-products.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin15,792 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
JSON40013,883
PHP275331,0381,720
CSS3141106
JavaScript52070
SVG11013

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity14.53
▷ Minimum class complexity1.00
▷ Maximum class complexity93.00
Average method complexity2.98
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces11
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes00.00%
Methods131
▷ Static methods4937.40%
▷ Public methods9572.52%
▷ Protected methods00.00%
▷ Private methods3627.48%
Functions7
▷ Named functions457.14%
▷ Anonymous functions342.86%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
templates/admin/assets/img/icon.png0.35KB0.34KB▼ 4.70%