83% woo-widget-product-slideshow

Code Review | Product Widget Slider for WooCommerce

WordPress plugin Product Widget Slider for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: woo-widget-produc...
  • Plugin version: 2.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4
  • WordPress version: 6.3.1
  • First release: Nov 12, 2012
  • Latest release: Nov 22, 2023
  • Number of updates: 139
  • Update frequency: every 29.0 days
  • Top authors: a3rev (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

700+ active /138,766 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
Install script ran successfully

Server metrics [RAM: ▲2.48MB] [CPU: ▲12.46ms] Passed 4 tests

This is a short check of server-side resources used by Product Widget Slider for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /6.06 ▲2.6059.45 ▲22.13
Dashboard /wp-admin5.87 ▲2.5757.29 ▲11.84
Posts /wp-admin/edit.php5.99 ▲2.6359.87 ▲14.05
Add New Post /wp-admin/post-new.php8.06 ▲2.1792.37 ▲9.00
Media Library /wp-admin/upload.php5.80 ▲2.5750.41 ▲14.96
Widget Product Slider /wp-admin/admin.php?page=wc-product-slider5.8458.95

Server storage [IO: ▲3.10MB] [DB: ▲0.06MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 202 new files
Database: no new tables, 14 new options
New WordPress options
widget_wc_product_slider_carousel
widget_recent-comments
widget_widget_product_cycle
widget_recent-posts
widget_theysaidso_widget
woo_gallery_widget_lite_version
can_compress_scripts
wc_product_slider_global_settings
db_upgraded
wc_product_slider_widget_skin_settings
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Product Widget Slider for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲4614.32 ▼0.022.08 ▲0.6140.36 ▲2.81
Dashboard /wp-admin2,199 ▲225.57 ▼0.1190.73 ▼0.9942.84 ▲0.06
Posts /wp-admin/edit.php2,104 ▲42.03 ▲0.0740.07 ▼11.3236.95 ▲0.60
Add New Post /wp-admin/post-new.php2,059 ▲53323.34 ▲0.38678.74 ▲23.0961.27 ▲2.09
Media Library /wp-admin/upload.php1,404 ▲74.27 ▲0.1398.87 ▼2.0342.69 ▼2.59
Widget Product Slider /wp-admin/admin.php?page=wc-product-slider1,6233.7881.3096.26

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 13 options in the database
    • theysaidso_admin_options
    • wc_product_slider_global_settings
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • wc_widget_product_slider_lite_style_version
    • widget_recent-posts
    • wc_product_slider_widget_skin_settings
    • widget_widget_product_cycle
    • ...

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
Good news, no errors were detected

SRP 50% 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
Please take a closer look at the following
  • 25× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: slider_pager_position in wp-content/plugins/woo-widget-product-slideshow/includes/wc_product_slider_widget.php on line 75
    • > PHP Notice
      Undefined index: WC_PRODUCT_SLIDER_PREFIXadmin_interface in wp-content/plugins/woo-widget-product-slideshow/includes/wc_product_slider_widget.php on line 100
    • > PHP Notice
      Undefined variable: enable_slider_control in wp-content/plugins/woo-widget-product-slideshow/includes/wc_product_slider_widget.php on line 21
    • > PHP Notice
      Undefined variable: control_next_icon_margin_right in wp-content/plugins/woo-widget-product-slideshow/includes/wc_product_slider_widget.php on line 49
    • > PHP Notice
      Undefined variable: is_slider_tall_dynamic in wp-content/plugins/woo-widget-product-slideshow/includes/wc_product_slider_widget.php on line 11
    • > PHP Notice
      Undefined variable: slider_pager_position in wp-content/plugins/woo-widget-product-slideshow/includes/wc_product_slider_widget.php on line 85
    • > PHP Warning
      extract() expects parameter 1 to be array, null given in wp-content/plugins/woo-widget-product-slideshow/includes/wc_product_slider_widget.php on line 6
    • > PHP Notice
      Undefined variable: enable_slider_pager in wp-content/plugins/woo-widget-product-slideshow/includes/wc_product_slider_widget.php on line 54
    • > PHP Notice
      Undefined variable: slider_control_icons_color in wp-content/plugins/woo-widget-product-slideshow/includes/wc_product_slider_widget.php on line 38
    • > PHP Warning
      Use of undefined constant WC_PRODUCT_SLIDER_PREFIX - assumed 'WC_PRODUCT_SLIDER_PREFIX' (this will throw an Error in a future version of PHP) in wp-content/plugins/woo-widget-product-slideshow/includes/wc_product_slider_widget.php on line 100

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
6 plugin tags: woocommerce widgets, woocommerce, woothemes, woocommerce product images, wordpress ecommerce...

woo-widget-product-slideshow/product-image-gallery-widget.php 85% from 13 tests

Analyzing the main PHP file in "Product Widget Slider for WooCommerce" version 2.2.2
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 192 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-widget-product-slideshow.php" instead of "product-image-gallery-widget.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin55,671 lines of code in 142 files:
LanguageFilesBlank linesComment linesLines of code
JSON50023,803
JavaScript502,5201,93615,003
PHP482,7302,51111,470
CSS223001523,635
LESS68527998
PO File1285463653
SVG64059
HTML12029
Sass32121

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 410)
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity48.02
▷ Minimum class complexity1.00
▷ Maximum class complexity801.00
Average method complexity5.33
▷ Minimum method complexity1.00
▷ Maximum method complexity410.00
Code structure
Namespaces9
Interfaces0
Traits0
Classes42
▷ Abstract classes00.00%
▷ Concrete classes42100.00%
▷ Final classes00.00%
Methods458
▷ Static methods306.55%
▷ Public methods28963.10%
▷ Protected methods14130.79%
▷ Private methods286.11%
Functions21
▷ Named functions1885.71%
▷ Anonymous functions314.29%
Constants22
▷ Global constants1777.27%
▷ Class constants522.73%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
29 PNG files occupy 0.15MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/slider-handle2.png2.50KB1.65KB▼ 33.85%
admin/assets/images/ico-refresh.png1.77KB0.53KB▼ 70.24%
admin/includes/uploader/delete.png0.13KB0.13KB0.00%
admin/assets/images/slider-handle-disable.png2.64KB1.81KB▼ 31.61%
admin/assets/images/slider-handle.png2.67KB1.71KB▼ 36.00%