79% product-swatches-light

Code Review | Product Swatches Light

WordPress plugin Product Swatches Light scored79%from 54 tests.

About plugin

  • Plugin page: product-swatches-...
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4
  • WordPress version: 6.3.1
  • First release: May 15, 2023
  • Latest release: Oct 26, 2023
  • Number of updates: 7
  • Update frequency: every 23.7 days
  • Top authors: laolaweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /205 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
This plugin's installer ran successfully

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

Analyzing server-side resources used by Product Swatches Light
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.25 ▼1.91
Dashboard /wp-admin3.31 ▲0.0045.59 ▼2.20
Posts /wp-admin/edit.php3.36 ▲0.0042.84 ▼1.10
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.43 ▼7.67
Media Library /wp-admin/upload.php3.23 ▲0.0033.28 ▲0.60

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 52 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Product Swatches Light
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲4814.67 ▲0.261.78 ▲0.2243.70 ▼1.10
Dashboard /wp-admin2,198 ▲175.62 ▼0.0584.00 ▼14.3941.19 ▼1.84
Posts /wp-admin/edit.php2,100 ▼01.96 ▼0.0732.83 ▼1.2934.09 ▼2.23
Add New Post /wp-admin/post-new.php1,526 ▼923.54 ▲5.25681.57 ▲51.2552.59 ▼6.99
Media Library /wp-admin/upload.php1,394 ▼64.20 ▼0.0495.71 ▼1.4440.09 ▼4.05

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
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

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 no errors were found, 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
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/product-swatches-light/templates/parts/list-end.php
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/product-swatches-light/templates/parts/list-start.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'LW_Swatches\\fieldtype' not found in wp-content/plugins/product-swatches-light/classes/fieldtype/class-colorselect.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/product-swatches-light/templates/parts/list-item-linked.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/product-swatches-light/templates/parts/list-item.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/product-swatches-light/inc/transients.php:42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/product-swatches-light/inc/admin.php:54
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/product-swatches-light/inc/woocommerce.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'LW_Swatches\\attributeType' not found in wp-content/plugins/product-swatches-light/classes/attributetype/class-color.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: woocommerce, variant swatches, variation swatches, product swatches

product-swatches-light/product-swatches-light.php Passed 13 tests

"Product Swatches Light" version 1.0.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
42 characters long description:
Provides product swatches for WooCommerce.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin1,738 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP232587921,330
PO File2102126238
JavaScript31032129
CSS311541

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity12.18
▷ Minimum class complexity1.00
▷ Maximum class complexity32.00
Average method complexity3.56
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces3
Interfaces2
Traits1
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods53
▷ Static methods3667.92%
▷ Public methods4992.45%
▷ Protected methods00.00%
▷ Private methods47.55%
Functions27
▷ Named functions2696.30%
▷ Anonymous functions13.70%
Constants10
▷ Global constants00.00%
▷ Class constants10100.00%
▷ Public constants10100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
17 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/jquery/images/ui-icons_777620_256x240.png4.56KB4.18KB▼ 8.31%
lib/jquery/images/ui-icons_888888_256x240.png6.94KB4.18KB▼ 39.78%
lib/jquery/images/ui-icons_222222_256x240.png6.86KB4.18KB▼ 39.05%
lib/jquery/images/ui-icons_444444_256x240.png6.97KB4.18KB▼ 40.04%
lib/jquery/images/ui-icons_555555_256x240.png6.96KB4.18KB▼ 39.91%