73% variation-swatches-and-gallery

Code Review | Variation Swatches and Gallery for WooCommerce

WordPress plugin Variation Swatches and Gallery for WooCommerce scored73%from 54 tests.

About plugin

  • Plugin page: variation-swatche...
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.3.1
  • WordPress version: 6.3.1
  • First release: Jan 6, 2023
  • Latest release: Sep 14, 2023
  • Number of updates: 11
  • Update frequency: every 23.7 days
  • Top authors: akdevs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /568 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲5.17MB] [CPU: ▲31.54ms] 75% from 4 tests

Server-side resources used by Variation Swatches and Gallery for WooCommerce
Please have a look at the following items
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 5.17MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.93 ▲5.4773.51 ▲35.54
Dashboard /wp-admin8.95 ▲5.6584.65 ▲35.39
Posts /wp-admin/edit.php8.95 ▲5.6078.99 ▲28.07
Add New Post /wp-admin/post-new.php9.85 ▲3.97123.82 ▲27.17
Media Library /wp-admin/upload.php8.95 ▲5.7374.03 ▲41.97
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius8.9564.23

Server storage [IO: ▲3.64MB] [DB: ▲0.03MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 248 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
can_compress_scripts
fs_accounts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
fs_debug_mode
fs_active_plugins

Browser metrics Passed 4 tests

Checking browser requirements for Variation Swatches and Gallery for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,256 ▲52115.31 ▲0.937.52 ▲5.8232.15 ▼19.87
Dashboard /wp-admin2,531 ▲3406.67 ▲1.77125.87 ▲17.17103.39 ▲58.81
Posts /wp-admin/edit.php2,339 ▲2503.56 ▲1.5157.22 ▲21.2487.48 ▲52.39
Add New Post /wp-admin/post-new.php1,747 ▲37622.41 ▲5.65636.35 ▲69.7535.41 ▼24.28
Media Library /wp-admin/upload.php1,478 ▲904.35 ▲0.1385.09 ▼12.7184.24 ▲39.44
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius1,3083.3647.6789.43

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/variation-swatches-and-gallery/freemius/includes/class-freemius.php+8515
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 9 options in the database
    • fs_accounts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • fs_active_plugins
    • widget_recent-comments
    • can_compress_scripts
    • fs_debug_mode

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
Almost there! Just fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/variation-swatches-and-gallery/admin/partials/variation-swatches-and-gallery-admin-display.php
    • > /wp-content/plugins/variation-swatches-and-gallery/public/partials/variation-swatches-and-gallery-public-display.php

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 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots need descriptions #7, #8, #9 in variation-swatches-and-gallery/assets to your readme.txt
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

variation-swatches-and-gallery/variation-swatches-and-gallery.php Passed 13 tests

The main PHP script in "Variation Swatches and Gallery for WooCommerce" version 1.0.2 is automatically included on every request by WordPress
46 characters long description:
Variation Swatches and Gallery for WooCommerce

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin38,505 lines of code in 181 files:
LanguageFilesBlank linesComment linesLines of code
PHP1468,54419,22535,792
JavaScript11502381,980
CSS18138337
Markdown1680214
JSON300154
XML13016
SVG10012

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,088)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity74.82
▷ Minimum class complexity1.00
▷ Maximum class complexity3,088.00
Average method complexity4.40
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes65
▷ Abstract classes23.08%
▷ Concrete classes6396.92%
▷ Final classes00.00%
Methods1,441
▷ Static methods23416.24%
▷ Public methods1,02771.27%
▷ Protected methods171.18%
▷ Private methods39727.55%
Functions106
▷ Named functions10397.17%
▷ Anonymous functions32.83%
Constants147
▷ Global constants10068.03%
▷ Class constants4731.97%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.12MB with 0.05MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
vendor/zqelab/wp-term-meta/src/imgs/placeholder.png100.24KB73.05KB▼ 27.12%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%