10% variation-swatches-master-lite-for-woocommerce

Code Review | Variation Swatches Master Lite for WooCommerce

WordPress plugin Variation Swatches Master Lite for WooCommerce scored 10% from 54 tests.

About plugin

  • Plugin page: variation-swatche...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 1.0.0-5.8.0
  • WordPress version: 6.3.1
  • First release: Aug 21, 2021
  • Latest release: Aug 21, 2021
  • Number of updates: 3
  • Update frequency: every 12.3 days
  • Top authors: redefiningtheweb (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) | All plugins must install correctly, without throwing any errors, warnings, or notices
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Error in wp-content/plugins/variation-swatches-master-lite-for-woocommerce/includes/rtwvsmlw-class-woocommerce-variation-swatches-master-activator.php+83
    Uncaught Error: Call to undefined function wc_get_attribute_taxonomies() in wp-content/plugins/variation-swatches-master-lite-for-woocommerce/includes/rtwvsmlw-class-woocommerce-variation-swatches-master-activator.php:83
    Stack trace:
    #0 wp-content/plugins/variation-swatches-master-lite-for-woocommerce/rtwvsmlw-variation-swatches-master-lite-for-woocommerce.php(46): Rtwvsmlw_Variation_Swatches_Master_For_Woocommerce_Activator::rtwvsmlw_activate()
    #1 wp-includes/class-wp-hook.php(310): rtwvsmlw_activate_variation_swatches_master_for_woocommerce()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/includes/plugin.php(693): do_action()

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.09ms] Passed 4 tests

Server-side resources used by Variation Swatches Master Lite for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.82 ▼6.75
Dashboard /wp-admin3.31 ▲0.0045.19 ▼6.28
Posts /wp-admin/edit.php3.36 ▲0.0046.89 ▲0.59
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.62 ▼4.80
Media Library /wp-admin/upload.php3.23 ▲0.0033.41 ▼2.51

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 37 new files
Database: no new tables, 9 new options
New WordPress options
theysaidso_admin_options
rtwwvsm_advanced_variation_data
rtwwvsm_shop_page_variation_data
can_compress_scripts
rtwwvsm_simple_variation_data
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Variation Swatches Master Lite for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.72 ▼1.061.75 ▼0.1539.79 ▼6.03
Dashboard /wp-admin2,206 ▲184.85 ▼1.01110.72 ▼7.7342.04 ▼7.75
Posts /wp-admin/edit.php2,089 ▼02.04 ▼0.0139.55 ▲3.8235.08 ▲0.43
Add New Post /wp-admin/post-new.php1,539 ▲2023.12 ▼0.33666.57 ▼21.1270.69 ▲13.62
Media Library /wp-admin/upload.php1,388 ▼04.20 ▼0.03106.30 ▲2.4045.17 ▼1.50

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 9 options in the database
    • rtwwvsm_advanced_variation_data
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • rtwwvsm_shop_page_variation_data
    • rtwwvsm_simple_variation_data
    • widget_theysaidso_widget
    • can_compress_scripts

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 no errors were found, this is by no means an exhaustive test

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
Please fix the following items
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/variation-swatches-master-lite-for-woocommerce/admin/partials/rtwvsmlw_admin_tabs/rtwvsmlw-admin-simple-variation.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/variation-swatches-master-lite-for-woocommerce/admin/partials/rtwvsmlw_admin_tabs/rtwvsmlw-admin-advanced-variation.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/variation-swatches-master-lite-for-woocommerce/admin/partials/rtwvsmlw_admin_tabs/rtwvsmlw-admin-attribute-settings.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/variation-swatches-master-lite-for-woocommerce/public/partials/rtwvsmlw-attribute-display-on-single-product.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/variation-swatches-master-lite-for-woocommerce/admin/partials/rtwvsmlw_admin_tabs/rtwvsmlw-admin-shop-page-variation.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/variation-swatches-master-lite-for-woocommerce/admin/partials/rtwvsmlw_admin_tabs/rtwvsmlw-admin-global-variation.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/variation-swatches-master-lite-for-woocommerce/admin/partials/rtwvsmlw-variation-swatches-lite-for-woocommerce-admin-display.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/variation-swatches-master-lite-for-woocommerce/admin/partials/rtwvsmlw_admin_tabs/rtwvsmlw-admin-custom-variation.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/variation-swatches-master-lite-for-woocommerce/admin/partials/rtwvsmlw_admin_tabs/rtwvsmlw-compare-pro.php:15

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

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
Please take inspiration from this readme.txt

variation-swatches-master-lite-for-woocommerce/rtwvsmlw-variation-swatches-master-lite-for-woocommerce.php 77% from 13 tests

The main file in "Variation Swatches Master Lite for WooCommerce" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("variation-swatches-master-lite-for-woocommerce.php" instead of "rtwvsmlw-variation-swatches-master-lite-for-woocommerce.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 220 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
Success! There were no dangerous files found in this plugin16,845 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
CSS66461,94213,181
PHP173136702,549
JavaScript61701181,115

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity29.00
▷ Minimum class complexity1.00
▷ Maximum class complexity97.00
Average method complexity4.91
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods43
▷ Static methods12.33%
▷ Public methods3888.37%
▷ Protected methods00.00%
▷ Private methods511.63%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.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
2 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/swatches-logo.png1.97KB1.41KB▼ 28.49%
assets/variation-attribute-setting.png71.99KB25.77KB▼ 64.20%