84% variation-swatches-woo

Code Review | Variation Swatches for WooCommerce by CartFlows

WordPress plugin Variation Swatches for WooCommerce by CartFlows scored 84% from 54 tests.

About plugin

  • Plugin page: variation-swatche...
  • Plugin version: 1.0.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.3
  • WordPress version: 6.3.1
  • First release: Jul 15, 2022
  • Latest release: Aug 25, 2023
  • Number of updates: 16
  • Update frequency: every 25.6 days
  • Top authors: brainstormworg (87.5%)sandesh055 (18.75%)

Code review

54 tests

User reviews

24 reviews

Install metrics

100,000+ active / 912,349 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.43ms] Passed 4 tests

An overview of server-side resources used by Variation Swatches for WooCommerce by CartFlows
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.03 ▼2.64
Dashboard /wp-admin3.32 ▲0.0145.98 ▲0.29
Posts /wp-admin/edit.php3.37 ▲0.0145.22 ▼5.74
Add New Post /wp-admin/post-new.php5.90 ▲0.0183.59 ▼5.62
Media Library /wp-admin/upload.php3.24 ▲0.0136.17 ▲0.91

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 31 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Variation Swatches for WooCommerce by CartFlows
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲3013.58 ▼0.941.79 ▲0.1143.69 ▲2.74
Dashboard /wp-admin2,225 ▲194.86 ▲0.01103.60 ▼9.6040.08 ▼4.86
Posts /wp-admin/edit.php2,107 ▲182.07 ▲0.0735.42 ▼4.3036.45 ▼0.39
Add New Post /wp-admin/post-new.php1,547 ▲3323.47 ▲5.88664.21 ▼17.3956.74 ▼1.00
Media Library /wp-admin/upload.php1,407 ▲194.27 ▲0.1796.77 ▼22.7744.99 ▼3.62

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means 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 items
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Trait 'CFVSW\\Inc\\Traits\\Get_Instance' not found in wp-content/plugins/variation-swatches-woo/admin/term-meta-config.php on line 20
    • > PHP Fatal error
      Trait 'CFVSW\\Inc\\Traits\\Get_Instance' not found in wp-content/plugins/variation-swatches-woo/admin/templates.php on line 20
    • > PHP Fatal error
      Trait 'CFVSW\\Inc\\Traits\\Get_Instance' not found in wp-content/plugins/variation-swatches-woo/admin/product-config.php on line 21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function CFVSW\\add_action() in wp-content/plugins/variation-swatches-woo/plugin-loader.php:81
    • > PHP Fatal error
      Trait 'CFVSW\\Inc\\Traits\\Get_Instance' not found in wp-content/plugins/variation-swatches-woo/admin/attributes-config.php on line 20
    • > PHP Fatal error
      Trait 'CFVSW\\Inc\\Traits\\Get_Instance' not found in wp-content/plugins/variation-swatches-woo/admin-core/admin-menu.php on line 20
    • > PHP Fatal error
      Trait 'CFVSW\\Inc\\Traits\\Get_Instance' not found in wp-content/plugins/variation-swatches-woo/inc/swatches.php on line 23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
10 plugin tags: product size, variation product swatches, product attributes, image variation swatch, woocommerce variation swatches...

variation-swatches-woo/variation-swatches-woo.php Passed 13 tests

The primary PHP file in "Variation Swatches for WooCommerce by CartFlows" version 1.0.7 is used by WordPress to initiate all plugin functionality
120 characters long description:
Provides super easy shopping experience by displaying beautiful variation swatches on WooCommerce shop and product page.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected5,554 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
CSS63112382,652
PHP132798871,870
JavaScript566311,032

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity29.36
▷ Minimum class complexity2.00
▷ Maximum class complexity157.00
Average method complexity4.47
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces6
Interfaces0
Traits1
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods90
▷ Static methods22.22%
▷ Public methods8998.89%
▷ Protected methods00.00%
▷ Private methods11.11%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants9
▷ Global constants9100.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
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin-core/assets/images/logo.png4.22KB2.46KB▼ 41.59%
admin/assets/img/wc-placeholder.png5.71KB5.63KB▼ 1.33%
admin-core/assets/build/images/logo.46bd2419.png4.22KB2.46KB▼ 41.59%
admin-core/assets/images/cfl-gray.png0.68KB0.87KB0.00%