77% color-image-variation-swatches-for-woocommerce

Code Review | SySwatches Variation Swatches For WooCommerce

WordPress plugin SySwatches Variation Swatches For WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: color-image-varia...
  • Plugin version: 1.2.3
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-6.1.1
  • WordPress version: 6.3.1
  • First release: Jul 8, 2021
  • Latest release: Mar 17, 2023
  • Number of updates: 94
  • Update frequency: every 6.6 days
  • Top authors: phppoet (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /2,442 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by SySwatches Variation Swatches For WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0137.81 ▼4.98
Dashboard /wp-admin3.32 ▲0.0247.51 ▼3.48
Posts /wp-admin/edit.php3.37 ▲0.0148.33 ▼0.94
Add New Post /wp-admin/post-new.php5.90 ▲0.0177.89 ▼21.59
Media Library /wp-admin/upload.php3.24 ▲0.0132.80 ▼3.23

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 73 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for SySwatches Variation Swatches For WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲8413.30 ▼0.952.09 ▲0.2344.93 ▼1.07
Dashboard /wp-admin2,211 ▲234.83 ▼1.03113.04 ▲11.2343.57 ▼0.43
Posts /wp-admin/edit.php2,093 ▲72.02 ▼0.0237.51 ▼0.9332.77 ▲1.45
Add New Post /wp-admin/post-new.php1,519 ▼1517.76 ▼5.48645.76 ▼17.5952.43 ▼8.74
Media Library /wp-admin/upload.php1,393 ▲54.31 ▲0.1096.38 ▼5.9643.15 ▼1.78

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/color-image-variation-swatches-for-woocommerce/includes/forms/accordion/wcva_sub_accordion_header.php
  • 26× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/color-image-variation-swatches-for-woocommerce/includes/admin/forms/product_swatches_form.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/color-image-variation-swatches-for-woocommerce/color-image-variation-swatches-for-woocommerce.php:21
    • > PHP Notice
      Undefined variable: woocommerce in wp-content/plugins/color-image-variation-swatches-for-woocommerce/includes/forms/wcva_accordion_header.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/color-image-variation-swatches-for-woocommerce/includes/forms/accordion/wcva_display_type_dropdown.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/color-image-variation-swatches-for-woocommerce/includes/admin/forms/global_swatches_form.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_get_attribute_taxonomies() in wp-content/plugins/color-image-variation-swatches-for-woocommerce/includes/admin/forms/global_values_swatches_form.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_get_product() in wp-content/plugins/color-image-variation-swatches-for-woocommerce/includes/forms/wcva_variation_select_tab_content.php:5
    • > PHP Notice
      Undefined variable: key in wp-content/plugins/color-image-variation-swatches-for-woocommerce/includes/forms/accordion/wcva_upper_meta_div.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/color-image-variation-swatches-for-woocommerce/includes/forms/wcva_upper_div_form.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/color-image-variation-swatches-for-woocommerce/includes/class_override_woocommerce_variable_tamplate.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (Color Image Variation Swatches For WooCommerce each product), #2 (Color Image Variation Swatches For WooCommerce each product), #3 (Color Image Variation Swatches For WooCommerce sidebar widget), #4 (Color Image Variation Swatches For WooCommerce settings page), #5 (Color Image Variation Swatches For WooCommerce product frontend view), #6 (Color Image Variation Swatches For WooCommerce shop swatches)
  • Tags: You are using too many tags: 12 tag instead of maximum 10
You can look at the official readme.txt

color-image-variation-swatches-for-woocommerce/color-image-variation-swatches-for-woocommerce.php 77% from 13 tests

The main PHP file in "SySwatches Variation Swatches For WooCommerce" ver. 1.2.3 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 164 characters long)
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.0" instead of "3.3")

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
No dangerous file extensions were detected9,086 lines of code in 64 files:
LanguageFilesBlank linesComment linesLines of code
PHP272,0579254,179
JavaScript211,4135463,920
CSS1634661987

PHP code Passed 2 tests

An overview 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.55
Average class complexity82.50
▷ Minimum class complexity5.00
▷ Maximum class complexity221.00
Average method complexity9.07
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods101
▷ Static methods98.91%
▷ Public methods9493.07%
▷ Protected methods76.93%
▷ Private methods00.00%
Functions19
▷ Named functions1684.21%
▷ Anonymous functions315.79%
Constants17
▷ Global constants847.06%
▷ Class constants952.94%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/help.png0.37KB0.45KB0.00%
assets/images/icon.png0.75KB0.92KB0.00%
assets/images/left-arrow.png0.33KB0.53KB0.00%
assets/css/images/ui-icons_ffffff_256x240.png3.19KB3.49KB0.00%
assets/images/placeholder.png2.75KB2.92KB0.00%