58% woo-product-slider

Code Review | Product Slider for WooCommerce

WordPress plugin Product Slider for WooCommerce scored 58% from 54 tests.

About plugin

  • Plugin page: woo-product-slider
  • Plugin version: 2.5.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9.2
  • WordPress version: 5.9.2
  • First release: Apr 6, 2016
  • Latest release: Mar 29, 2022
  • Number of updates: 147
  • Update frequency: every 14.9 days
  • Top authors: rubel_miah (56.46%)shapedplugin (44.22%)

Code review

54 tests

User reviews

183 reviews

Install metrics

20,000+ active / 449,720 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲1.41MB] [CPU: ▼292.15ms] Passed 4 tests

A check of server-side resources used by Product Slider for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.99 ▲1.4876.49 ▲12.54
Dashboard /wp-admin4.81 ▲1.4045.10 ▲2.60
Posts /wp-admin/edit.php5.03 ▲1.4059.09 ▲7.22
Add New Post /wp-admin/post-new.php8.34 ▲1.37110.74 ▼1,190.95
Media Library /wp-admin/upload.php4.76 ▲1.4646.44 ▲15.55
All Sliders /wp-admin/edit.php?post_type=sp_wps_shortcodes4.8445.86
Add New /wp-admin/post-new.php?post_type=sp_wps_shortcodes5.0158.90
Tools /wp-admin/edit.php?post_type=sp_wps_shortcodes&page=wps_tools4.7838.48
Settings /wp-admin/edit.php?post_type=sp_wps_shortcodes&page=wps_settings4.7838.78
Premium /wp-admin/edit.php?post_type=sp_wps_shortcodes&page=wps_premium4.79271.31
Help /wp-admin/edit.php?post_type=sp_wps_shortcodes&page=wps_help4.7838.84

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 150 new files
Database: no new tables, 4 new options
New WordPress options
sp_woo_product_slider_options
woo_product_slider_db_version
sp_woo_product_slider_review_notice_dismiss
woo_product_slider_version

Browser metrics Passed 4 tests

Checking browser requirements for Product Slider for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,940 ▲21815.91 ▲0.957.62 ▼0.712.51 ▼0.41
Dashboard /wp-admin3,039 ▲1526.74 ▲0.31155.98 ▼57.87179.66 ▼26.31
Posts /wp-admin/edit.php2,804 ▲1133.48 ▲0.0673.23 ▼14.12168.15 ▼6.76
Add New Post /wp-admin/post-new.php1,693 ▲5519.14 ▼1.75525.18 ▼1.94189.45 ▲0.23
Media Library /wp-admin/upload.php1,817 ▲1225.98 ▲0.29161.66 ▼25.34230.90 ▲4.77
All Sliders /wp-admin/edit.php?post_type=sp_wps_shortcodes1,8296.31106.62172.53
Add New /wp-admin/post-new.php?post_type=sp_wps_shortcodes5,7597.62161.04304.95
Tools /wp-admin/edit.php?post_type=sp_wps_shortcodes&page=wps_tools1,5745.9699.50156.94
Settings /wp-admin/edit.php?post_type=sp_wps_shortcodes&page=wps_settings1,5835.8399.61206.33
Premium /wp-admin/edit.php?post_type=sp_wps_shortcodes&page=wps_premium4,6695.85100.24370.52
Help /wp-admin/edit.php?post_type=sp_wps_shortcodes&page=wps_help2,80213.70411.00261.03

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin cannot be uninstalled
    • > Compile error in wp-content/plugins/woo-product-slider/main.php+46
    Cannot redeclare is_woo_product_slider_pro() (previously declared in wp-content/plugins/woo-product-slider/main.php:47)
  • Incomplete uninstall procedure, leaving 150 files (2.31MB) in the plugin directory
    • (new file) src/Admin/Helper/SP_WPS_WQV.php
    • (new file) src/Admin/DBUpdates.php
    • (new file) src/Admin/Dashboard_Notice.php
    • (new file) main.php
    • (new file) languages/woo-product-slider.pot
    • (new file) src/Admin/Admin.php
    • (new file) src/Admin/Helper/Premium_Page.php
    • (new file) index.php
    • (new file) src/Admin/Helper/Help_Page.php
    • (new file) readme.txt
    • ...
  • This plugin does not fully uninstall, leaving 5 options in the database
    • sp_woo_product_slider_review_notice_dismiss
    • recovery_mode_email_last_sent
    • woo_product_slider_db_version
    • woo_product_slider_version
    • sp_woo_product_slider_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% 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
  • 23× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: post_id in wp-content/plugins/woo-product-slider/src/Frontend/views/partials/dynamic-style.php on line 194
    • > PHP Notice
      Undefined variable: post_id in wp-content/plugins/woo-product-slider/src/Frontend/views/partials/dynamic-style.php on line 181
    • > PHP Fatal error
      Uncaught Error: Call to undefined function update_option() in wp-content/plugins/woo-product-slider/src/Admin/updates/update-2.2.0.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/woo-product-slider/src/Frontend/views/templates/loop/thumbnail.php:11
    • > PHP Notice
      Undefined variable: post_id in wp-content/plugins/woo-product-slider/src/Frontend/views/partials/dynamic-style.php on line 189
    • > PHP Notice
      Undefined variable: preloader in wp-content/plugins/woo-product-slider/src/Frontend/views/templates/preloader.php on line 14
    • > PHP Notice
      Undefined variable: post_id in wp-content/plugins/woo-product-slider/src/Frontend/views/partials/dynamic-style.php on line 176
    • > PHP Notice
      Undefined variable: product_name in wp-content/plugins/woo-product-slider/src/Frontend/views/templates/loop/title.php on line 11
    • > PHP Notice
      Undefined variable: dynamic_style in wp-content/plugins/woo-product-slider/src/Frontend/views/partials/dynamic-style.php on line 168
    • > PHP Notice
      Undefined variable: slider_title in wp-content/plugins/woo-product-slider/src/Frontend/views/templates/slider-title.php on line 11

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
    • > GET request to /wp-admin/edit.php?post_type=sp_wps_shortcodes&page=wps_premium
    • > Network (severe)
    wp-content/plugins/woo-product-slider/src/Admin/assets/css/images/premium/filter.svg - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Tags: Too many tags (30 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

woo-product-slider/main.php 85% from 13 tests

"Product Slider for WooCommerce" version 2.5.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 176 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("woo-product-slider.php" instead of "main.php")

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
Success! There were no dangerous files found in this plugin20,062 lines of code in 135 files:
LanguageFilesBlank linesComment linesLines of code
PHP641,4132,4126,945
JavaScript111,6153435,466
CSS181,0782,3314,875
SVG41122,771
JSON1005

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity26.19
▷ Minimum class complexity1.00
▷ Maximum class complexity142.00
Average method complexity5.93
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes37
▷ Abstract classes25.41%
▷ Concrete classes3594.59%
▷ Final classes00.00%
Methods190
▷ Static methods4322.63%
▷ Public methods18798.42%
▷ Protected methods00.00%
▷ Private methods31.58%
Functions24
▷ Named functions2395.83%
▷ Anonymous functions14.17%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/Admin/views/models/assets/images/checkerboard.png2.02KB2.54KB0.00%
src/Admin/views/models/assets/images/logo.png2.71KB1.81KB▼ 33.15%