67% xt-woo-variation-swatches

Code Review | XT Variation Swatches for WooCommerce

WordPress plugin XT Variation Swatches for WooCommerce scored67%from 54 tests.

About plugin

  • Plugin page: xt-woo-variation-...
  • Plugin version: 1.9.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Feb 23, 2019
  • Latest release: Aug 25, 2023
  • Number of updates: 223
  • Update frequency: every 7.4 days
  • Top authors: xplodedthemes (100%)

Code review

54 tests

User reviews

26 reviews

Install metrics

900+ active /48,136 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲6.20MB] [CPU: ▲31.19ms] 50% from 4 tests

Analyzing server-side resources used by XT Variation Swatches for WooCommerce
Please have a look at the following items
  • RAM: Total memory usage must be kept under 10MB (currently 10.20MB on /wp-admin/admin.php?page=freemius)
  • Extra RAM: Extra memory usage should kept under 5MB (currently 6.20MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.75 ▲6.2870.84 ▲29.42
Dashboard /wp-admin10.19 ▲6.8998.13 ▲47.82
Posts /wp-admin/edit.php10.20 ▲6.8592.29 ▲38.20
Add New Post /wp-admin/post-new.php10.65 ▲4.76124.51 ▲9.30
Media Library /wp-admin/upload.php10.20 ▲6.9790.11 ▲53.56
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius10.2074.01

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 812 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts
fs_debug_mode
can_compress_scripts
xtfw_active_plugins
fs_active_plugins
theysaidso_admin_options
fs_accounts

Browser metrics Passed 4 tests

Checking browser requirements for XT Variation Swatches for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲7614.69 ▲0.321.66 ▲0.0828.70 ▼14.12
Dashboard /wp-admin2,223 ▲525.63 ▲0.0290.93 ▼1.8744.50 ▼1.83
Posts /wp-admin/edit.php2,132 ▲322.12 ▲0.1740.04 ▲1.6937.85 ▲3.42
Add New Post /wp-admin/post-new.php1,423 ▼10319.24 ▼3.72622.27 ▼15.0451.42 ▼3.19
Media Library /wp-admin/upload.php1,431 ▲284.16 ▼0.0595.84 ▼9.1545.46 ▲1.52
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0861.6726.0728.47

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/xt-woo-variation-swatches/xt-framework/includes/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 10 options
    • theysaidso_admin_options
    • fs_active_plugins
    • db_upgraded
    • can_compress_scripts
    • xtfw_active_plugins
    • fs_accounts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • fs_debug_mode

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 8× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/xt-woo-variation-swatches/xt-framework/includes/customizer/xirki/controls/views/select.php
    • > /wp-content/plugins/xt-woo-variation-swatches/xt-framework/includes/customizer/xirki/controls/views/number.php
    • > /wp-content/plugins/xt-woo-variation-swatches/xt-framework/includes/customizer/xirki/controls/views/radio.php
    • > /wp-content/plugins/xt-woo-variation-swatches/xt-framework/includes/customizer/xirki/controls/views/color.php
    • > /wp-content/plugins/xt-woo-variation-swatches/xt-framework/includes/customizer/xirki/controls/views/generic.php
    • > /wp-content/plugins/xt-woo-variation-swatches/xt-framework/includes/customizer/xirki/controls/views/textarea.php
    • > /wp-content/plugins/xt-woo-variation-swatches/xt-framework/includes/customizer/xirki/modules/webfonts/class-xirki-fonts-helper.php
    • > /wp-content/plugins/xt-woo-variation-swatches/xt-framework/includes/customizer/xirki/controls/views/code.php
  • 99× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Xirki_Field_Select' not found in wp-content/plugins/xt-woo-variation-swatches/xt-framework/includes/customizer/xirki/field/class-xirki-field-preset.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Upload_Control' not found in wp-content/plugins/xt-woo-variation-swatches/xt-framework/includes/customizer/xirki/controls/php/class-xirki-control-upload.php:15
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/xt-woo-variation-swatches/admin/customizer/fields/swatch-tooltip.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function xt_woo_variation_swatches() in wp-content/plugins/xt-woo-variation-swatches/public/templates/bundle-variable.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Xirki_Output_Property' not found in wp-content/plugins/xt-woo-variation-swatches/xt-framework/includes/customizer/xirki/modules/css/property/class-xirki-output-property-background-image.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Section' not found in wp-content/plugins/xt-woo-variation-swatches/xt-framework/includes/customizer/xirki/modules/custom-sections/sections/class-xirki-sections-default-section.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Cropped_Image_Control' not found in wp-content/plugins/xt-woo-variation-swatches/xt-framework/includes/customizer/xirki/controls/php/class-xirki-control-cropped-image.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Xirki_Control_Base' not found in wp-content/plugins/xt-woo-variation-swatches/xt-framework/includes/customizer/xirki/controls/php/class-xirki-control-background.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Xirki_Field_Select' not found in wp-content/plugins/xt-woo-variation-swatches/xt-framework/includes/customizer/xirki/field/class-xirki-field-fontawesome.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Xirki_Field' not found in wp-content/plugins/xt-woo-variation-swatches/xt-framework/includes/customizer/xirki/field/class-xirki-field-code.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)
There were no browser issues found

Optimizations

Plugin configuration 93% 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
8 plugin tags: color swatches, variation swatches for woocommerce, image swatches, variation swatches, product attributes...

xt-woo-variation-swatches/xt-woo-variation-swatches.php 85% from 13 tests

Analyzing the main PHP file in "XT Variation Swatches for WooCommerce" version 1.9.0
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 204 characters long)
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.6" instead of "3.0.0")

Code Analysis 97% from 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
No dangerous file extensions were detected100,482 lines of code in 655 files:
LanguageFilesBlank linesComment linesLines of code
PHP34612,99928,66653,611
JavaScript1566,9524,57625,031
JSON5008,319
Sass911,367948,084
SVG12092,786
CSS388641,376
Markdown235201,107
XML42453141
YAML17027

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please tend to the following items
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity32.70
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity3.97
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes221
▷ Abstract classes52.26%
▷ Concrete classes21697.74%
▷ Final classes104.63%
Methods2,365
▷ Static methods33414.12%
▷ Public methods1,69571.67%
▷ Protected methods26711.29%
▷ Private methods40317.04%
Functions262
▷ Named functions17667.18%
▷ Anonymous functions8632.82%
Constants175
▷ Global constants12571.43%
▷ Class constants5028.57%
▷ Public constants50100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
58 PNG files occupy 0.58MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
xt-framework/dist/pricing/c03f665db27af43971565560adfba594.png6.06KB3.01KB▼ 50.27%
xt-framework/assets/images/social/twitter.png1.27KB1.19KB▼ 6.61%
admin/customizer/assets/images/archives-color-swatch.png30.97KB34.70KB0.00%
xt-framework/dist/pricing/e366d70661d8ad2493bd6afbd779f125.png10.86KB3.99KB▼ 63.26%
admin/customizer/assets/images/single-image-swatch.png20.67KB23.20KB0.00%