10% product-variation-for-woocommerce

Code Review | Advanced Product Variation Swatches for WooCommerce - Display product attributes as color swatch, button, advanced dropdown or image etc

WordPress plugin Advanced Product Variation Swatches for WooCommerce - Display product attributes as color swatch, button, advanced dropdown or image etc scored 10% from 54 tests.

About plugin

  • Plugin page: product-variation...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.8.1
  • WordPress version: 6.3.1
  • First release: Dec 15, 2020
  • Latest release: Sep 23, 2021
  • Number of updates: 8
  • Update frequency: every 35.2 days
  • Top authors: mithublue (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 475 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/product-variation-for-woocommerce/inc/class-term.php+168
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.00ms] Passed 4 tests

A check of server-side resources used by Advanced Product Variation Swatches for WooCommerce - Display product attributes as color swatch, button, advanced dropdown or image etc
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0335.03 ▼1.71
Dashboard /wp-admin3.34 ▲0.0453.98 ▲6.44
Posts /wp-admin/edit.php3.43 ▲0.0749.17 ▲0.97
Add New Post /wp-admin/post-new.php5.90 ▲0.0284.72 ▼14.93
Media Library /wp-admin/upload.php3.24 ▲0.0235.59 ▲3.66

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Advanced Product Variation Swatches for WooCommerce - Display product attributes as color swatch, button, advanced dropdown or image etc
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,959 ▲22415.09 ▲0.922.14 ▼0.0840.89 ▼1.54
Dashboard /wp-admin2,363 ▲1786.61 ▲0.79120.73 ▲18.2941.52 ▼4.92
Posts /wp-admin/edit.php2,263 ▲1713.52 ▲1.4850.23 ▲11.3832.82 ▼3.82
Add New Post /wp-admin/post-new.php1,526 ▲1223.42 ▲5.91611.95 ▼54.6933.99 ▼28.03
Media Library /wp-admin/upload.php1,399 ▲84.32 ▲0.1183.88 ▼15.6343.39 ▼3.78

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

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 50% 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
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/product-variation-for-woocommerce/inc/class-variation.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/product-variation-for-woocommerce/inc/class-attribute.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/product-variation-for-woocommerce/pvwc.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/product-variation-for-woocommerce/inc/class-term.php:40

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 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
8 plugin tags: color swatch, product, variable, attribute, woocommerce...

product-variation-for-woocommerce/pvwc.php 77% from 13 tests

The main file in "Advanced Product Variation Swatches for WooCommerce - Display product attributes as color swatch, button, advanced dropdown or image etc" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Domain Path: The domain path points to a folder that does not exist ("/languages/")
  • Main file name: Name the main plugin file the same as the plugin slug ("product-variation-for-woocommerce.php" instead of "pvwc.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin12,931 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
JSON30012,144
PHP5114209568
CSS106103
LESS186100
Markdown17014
JavaScript11102

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity15.60
▷ Minimum class complexity3.00
▷ Maximum class complexity37.00
Average method complexity3.28
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods32
▷ Static methods515.62%
▷ Public methods32100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/placeholder.png0.38KB0.43KB0.00%