84% color-or-image-variation-swatches-for-woocommerce

Code Review | Variation Swatches for WooCommerce – Color & Image Swatches

WordPress plugin Variation Swatches for WooCommerce – Color & Image Swatches scored84%from 54 tests.

About plugin

  • Plugin page: color-or-image-va...
  • Plugin version: 1.1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Apr 7, 2017
  • Latest release: Sep 21, 2023
  • Number of updates: 30
  • Update frequency: every 78.6 days
  • Top authors: algoritmika (80%)wpcodefactory (13.33%)Karzin (13.33%)

Code review

54 tests

User reviews

9 reviews

Install metrics

800+ active /19,147 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

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

A check of server-side resources used by Variation Swatches for WooCommerce – Color & Image Swatches
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.60 ▼8.90
Dashboard /wp-admin3.32 ▼0.0344.10 ▼15.30
Posts /wp-admin/edit.php3.37 ▲0.0143.94 ▼0.78
Add New Post /wp-admin/post-new.php5.90 ▲0.0189.45 ▼4.40
Media Library /wp-admin/upload.php3.24 ▲0.0129.80 ▼3.74

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 422 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Variation Swatches for WooCommerce – Color & Image Swatches
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.41 ▼0.011.67 ▲0.0138.86 ▼5.14
Dashboard /wp-admin2,195 ▲185.55 ▼0.0784.35 ▼16.7735.91 ▼5.75
Posts /wp-admin/edit.php2,100 ▼02.04 ▲0.0636.55 ▲0.1232.66 ▲1.27
Add New Post /wp-admin/post-new.php1,526 ▼1023.22 ▲5.01631.58 ▼8.3458.73 ▼7.18
Media Library /wp-admin/upload.php1,400 ▲34.22 ▲0.0396.43 ▼2.1443.24 ▲0.99

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 39× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Select' not found in wp-content/plugins/color-or-image-variation-swatches-for-woocommerce/vendor/cmb2/cmb2/includes/types/CMB2_Type_Select_Timezone.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/color-or-image-variation-swatches-for-woocommerce/vendor/cmb2/cmb2/includes/types/CMB2_Type_Taxonomy_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/color-or-image-variation-swatches-for-woocommerce/vendor/cmb2/cmb2/includes/types/CMB2_Type_Taxonomy_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Radio' not found in wp-content/plugins/color-or-image-variation-swatches-for-woocommerce/vendor/cmb2/cmb2/includes/types/CMB2_Type_Taxonomy_Radio_Hierarchical.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Counter_Base' not found in wp-content/plugins/color-or-image-variation-swatches-for-woocommerce/vendor/cmb2/cmb2/includes/types/CMB2_Type_Textarea.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/color-or-image-variation-swatches-for-woocommerce/vendor/cmb2/cmb2/includes/types/CMB2_Type_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/color-or-image-variation-swatches-for-woocommerce/vendor/cmb2/cmb2/includes/types/CMB2_Type_Text_Datetime_Timestamp.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup' not found in wp-content/plugins/color-or-image-variation-swatches-for-woocommerce/vendor/cmb2/cmb2/includes/CMB2_Options_Hookup.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Multicheck' not found in wp-content/plugins/color-or-image-variation-swatches-for-woocommerce/vendor/cmb2/cmb2/includes/types/CMB2_Type_Taxonomy_Multicheck_Hierarchical.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/color-or-image-variation-swatches-for-woocommerce/vendor/cmb2/cmb2/includes/types/CMB2_Type_Text_Date.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% 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
6 plugin tags: variation, woocommerce, swatches, color, attribute...

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

The main PHP file in "Variation Swatches for WooCommerce – Color & Image Swatches" ver. 1.1.7 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.4" instead of "3.0.0")

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 plugin50,118 lines of code in 259 files:
LanguageFilesBlank linesComment linesLines of code
PO File12114,33518,52732,404
PHP852,6477,1559,085
CSS142571,2044,592
JavaScript103796581,572
Sass20316291,470
Markdown32440755
JSON500233
Bourne Shell1017

PHP code Passed 2 tests

A short 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.48
Average class complexity17.87
▷ Minimum class complexity1.00
▷ Maximum class complexity188.00
Average method complexity3.24
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes86
▷ Abstract classes910.47%
▷ Concrete classes7789.53%
▷ Final classes00.00%
Methods652
▷ Static methods11317.33%
▷ Public methods55184.51%
▷ Protected methods9314.26%
▷ Private methods81.23%
Functions42
▷ Named functions4095.24%
▷ Anonymous functions24.76%
Constants16
▷ Global constants743.75%
▷ Class constants956.25%
▷ 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
14 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/cmb2/cmb2/images/ico-delete.png0.70KB0.72KB0.00%
vendor/cmb2/cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
vendor/cmb2/cmb2/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
vendor/cmb2/cmb2/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
vendor/cmb2/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%