78% aco-variation-swatches-for-woocommerce

Code Review | Variation Swatches for WooCommerce

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

About plugin

  • Plugin page: aco-variation-swa...
  • Plugin version: 1.2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2
  • WordPress version: 6.3.1
  • First release: May 5, 2021
  • Latest release: Apr 14, 2023
  • Number of updates: 23
  • Update frequency: every 30.9 days
  • Top authors: acowebscd (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /3,409 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.32MB] [CPU: ▼4.89ms] Passed 4 tests

Analyzing server-side resources used by Variation Swatches for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2839.89 ▼1.92
Dashboard /wp-admin3.63 ▲0.3347.00 ▼3.03
Posts /wp-admin/edit.php3.74 ▲0.3944.83 ▼0.96
Add New Post /wp-admin/post-new.php6.22 ▲0.3484.06 ▼13.66
Media Library /wp-admin/upload.php3.55 ▲0.3338.42 ▲2.65

Server storage [IO: ▲1.22MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Variation Swatches for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.25 ▼0.021.62 ▼0.2040.75 ▼0.19
Dashboard /wp-admin2,195 ▲145.63 ▼0.0882.24 ▼17.3139.86 ▲3.89
Posts /wp-admin/edit.php2,097 ▼32.16 ▲0.1933.59 ▼4.0434.23 ▼0.87
Add New Post /wp-admin/post-new.php1,526 ▼023.22 ▲0.27616.74 ▲17.0963.91 ▲6.46
Media Library /wp-admin/upload.php1,403 ▲64.38 ▲0.2195.96 ▼9.0543.68 ▲3.09

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/aco-variation-swatches-for-woocommerce/includes/views/admin-attributes.php
    • > /wp-content/plugins/aco-variation-swatches-for-woocommerce/includes/views/admin-settings.php
    • > /wp-content/plugins/aco-variation-swatches-for-woocommerce/includes/views/admin-product.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/aco-variation-swatches-for-woocommerce/start.php:22
    • > PHP Warning
      Use of undefined constant ACOVSW_TOKEN - assumed 'ACOVSW_TOKEN' (this will throw an Error in a future version of PHP) in wp-content/plugins/aco-variation-swatches-for-woocommerce/includes/views/admin-settings.php on line 1
    • > PHP Warning
      Use of undefined constant ACOVSW_TOKEN - assumed 'ACOVSW_TOKEN' (this will throw an Error in a future version of PHP) in wp-content/plugins/aco-variation-swatches-for-woocommerce/includes/views/admin-attributes.php on line 1
    • > PHP Warning
      Use of undefined constant ACOVSW_TOKEN - assumed 'ACOVSW_TOKEN' (this will throw an Error in a future version of PHP) in wp-content/plugins/aco-variation-swatches-for-woocommerce/includes/views/admin-product.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Donate link: Invalid URI found ("")
The official readme.txt might help

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

"Variation Swatches for WooCommerce" version 1.2.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("aco-variation-swatches-for-woocommerce.php" instead of "start.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin2,074 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP83222781,346
PO File2144144298
CSS2910268
JavaScript3207149
SVG10013

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 195)
Cyclomatic complexity
Average complexity per logical line of code0.72
Average class complexity124.75
▷ Minimum class complexity5.00
▷ Maximum class complexity237.00
Average method complexity11.10
▷ Minimum method complexity1.00
▷ Maximum method complexity195.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods50
▷ Static methods48.00%
▷ Public methods4998.00%
▷ Protected methods00.00%
▷ Private methods12.00%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 0.12MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/delete.png0.65KB0.74KB0.00%
assets/images/edit.png0.61KB0.61KB0.00%
assets/images/icon.png1.15KB0.47KB▼ 59.06%
assets/images/acovsw-icons.png17.06KB5.99KB▼ 64.87%
assets/images/ad_bg.png95.04KB103.00KB0.00%