77% woo-swatches-manager

Code Review | WooCommerce Variation Swatches for Products

WordPress plugin WooCommerce Variation Swatches for Products scored 77% from 54 tests.

About plugin

  • Plugin page: woo-swatches-manager
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-4.8
  • WordPress version: 5.8.1
  • First release: Nov 29, 2017
  • Latest release: Feb 26, 2019
  • Number of updates: 73
  • Update frequency: every 6.2 days
  • Top authors: jcodex (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 1,929 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲3.93MB] [CPU: ▼134.61ms] Passed 4 tests

A check of server-side resources used by WooCommerce Variation Swatches for Products
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /7.37 ▲4.5448.19 ▲20.84
Dashboard /wp-admin7.39 ▲4.3350.32 ▲10.97
Posts /wp-admin/edit.php7.39 ▲4.2846.06 ▲13.40
Add New Post /wp-admin/post-new.php8.16 ▲2.7384.64 ▼581.03
Media Library /wp-admin/upload.php7.39 ▲4.3940.84 ▲18.24
Freemius Debug [v.2.2.4] /wp-admin/admin.php?page=freemius7.3936.34

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 213 new files
Database: no new tables, 5 new options
New WordPress options
fs_accounts
fs_debug_mode
fs_api_cache
fs_gdpr
fs_active_plugins

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Variation Swatches for Products
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,707 ▲10615.74 ▲0.155.59 ▲0.6573.80 ▼3.66
Dashboard /wp-admin2,974 ▲786.17 ▲0.02115.90 ▼18.92182.65 ▲2.37
Posts /wp-admin/edit.php2,783 ▲433.36 ▲0.1266.02 ▲1.12152.35 ▲16.63
Add New Post /wp-admin/post-new.php3,821 ▲1417.90 ▼0.80435.02 ▲9.39164.71 ▲7.13
Media Library /wp-admin/upload.php1,791 ▲395.53 ▲0.02153.46 ▲0.90197.35 ▲5.11
Freemius Debug [v.2.2.4] /wp-admin/admin.php?page=freemius1,4852.4055.60128.67

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 5 options in the database
    • fs_gdpr
    • fs_accounts
    • fs_debug_mode
    • fs_active_plugins
    • fs_api_cache

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/woo-swatches-manager/freemius/templates/ajax-loader.php
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/woo-swatches-manager/freemius/templates/account/partials/addon.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/woo-swatches-manager/freemius/templates/account/partials/addon.php:9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/woo-swatches-manager/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/woo-swatches-manager/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/woo-swatches-manager/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/woo-swatches-manager/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/woo-swatches-manager/freemius/templates/account/partials/addon.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/woo-swatches-manager/freemius/templates/partials/network-activation.php:6

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 issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention: The official readme.txt might help

woo-swatches-manager/swatches-manager-for-woocommerce.php 77% from 13 tests

"WooCommerce Variation Swatches for Products" version 1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woo-swatches-manager.php" instead of "swatches-manager-for-woocommerce.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Requires at least: The required version number must match the one declared in readme.txt ("4.5" instead of "4.4.0")

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
Everything looks great! No dangerous files found in this plugin42,269 lines of code in 169 files:
LanguageFilesBlank linesComment linesLines of code
PHP1106,46314,79927,056
PO File105,5506,66712,010
Sass28399772,515
JavaScript57376345
Markdown1610192
CSS14200124
JSON10027

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 2,360)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity72.46
▷ Minimum class complexity1.00
▷ Maximum class complexity2,360.00
Average method complexity4.28
▷ Minimum method complexity1.00
▷ Maximum method complexity83.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes48
▷ Abstract classes24.17%
▷ Concrete classes4695.83%
▷ Final classes12.17%
Methods1,076
▷ Static methods17015.80%
▷ Public methods76270.82%
▷ Protected methods151.39%
▷ Private methods29927.79%
Functions95
▷ Named functions95100.00%
▷ Anonymous functions00.00%
Constants116
▷ Global constants9682.76%
▷ Class constants2017.24%
▷ Public constants20100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/premium-banner.png6.55KB3.66KB▼ 44.21%
freemius/assets/img/woo-swatches-manager.png15.12KB8.26KB▼ 45.38%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%