84% wpb-woocommerce-category-slider

Code Review | WPB Product Categories Slider for WooCommerce - Display Categories Slider on Any Page

WordPress plugin WPB Product Categories Slider for WooCommerce - Display Categories Slider on Any Page scored 84% from 54 tests.

About plugin

  • Plugin page: wpb-woocommerce-c...
  • Plugin version: 1.2.9
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Jun 8, 2017
  • Latest release: Aug 29, 2023
  • Number of updates: 60
  • Update frequency: every 37.9 days
  • Top authors: wpbean (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

1,000+ active / 27,197 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.24MB] [CPU: ▼1.44ms] Passed 4 tests

Analyzing server-side resources used by WPB Product Categories Slider for WooCommerce - Display Categories Slider on Any Page
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2042.87 ▲2.02
Dashboard /wp-admin3.62 ▲0.3152.56 ▲0.59
Posts /wp-admin/edit.php3.66 ▲0.3153.88 ▲10.39
Add New Post /wp-admin/post-new.php6.11 ▲0.2283.99 ▼13.13
Media Library /wp-admin/upload.php3.45 ▲0.2237.48 ▲4.78
Settings /wp-admin/admin.php?page=wpb-woocommerce-category-slider-settings3.4540.44
Woo Cat Slider /wp-admin/admin.php?page=wpb-woocommerce-category-slider-about3.4635.74

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 50 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
style_settings
theysaidso_admin_options
widget_recent-comments
general_settings
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by WPB Product Categories Slider for WooCommerce - Display Categories Slider on Any Page
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,081 ▲34614.90 ▲0.531.78 ▼0.1927.02 ▼13.91
Dashboard /wp-admin2,485 ▲2946.77 ▲0.88135.68 ▲35.4844.44 ▲0.06
Posts /wp-admin/edit.php2,306 ▲2173.64 ▲1.6451.80 ▲14.5132.98 ▲1.81
Add New Post /wp-admin/post-new.php1,717 ▲18321.89 ▼1.20684.75 ▼55.4055.11 ▼0.91
Media Library /wp-admin/upload.php1,440 ▲494.33 ▲0.0382.49 ▼17.4542.28 ▼2.65
Settings /wp-admin/admin.php?page=wpb-woocommerce-category-slider-settings1,6254.0474.5030.64
Woo Cat Slider /wp-admin/admin.php?page=wpb-woocommerce-category-slider-about1,3693.5848.9293.06

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 8 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • general_settings
    • widget_recent-posts
    • can_compress_scripts
    • style_settings
    • widget_recent-comments

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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 26× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      Creating default object from empty value in wp-content/plugins/wpb-woocommerce-category-slider/templates/with_image.php on line 15
    • > PHP Warning
      Creating default object from empty value in wp-content/plugins/wpb-woocommerce-category-slider/templates/with_icon.php on line 15
    • > PHP Notice
      Undefined property: stdClass::$term in wp-content/plugins/wpb-woocommerce-category-slider/templates/plain_text.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_queried_object() in wp-content/plugins/wpb-woocommerce-category-slider/templates/plain_text.php:18
    • > PHP Notice
      Undefined property: stdClass::$terms in wp-content/plugins/wpb-woocommerce-category-slider/templates/slider.php on line 15
    • > PHP Notice
      Undefined property: stdClass::$term in wp-content/plugins/wpb-woocommerce-category-slider/templates/with_icon.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpb-woocommerce-category-slider/admin/taxonomie-meta.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WPB_WCS_Template_Loader' not found in wp-content/plugins/wpb-woocommerce-category-slider/templates/slider.php:16
    • > PHP Notice
      Undefined property: stdClass::$term in wp-content/plugins/wpb-woocommerce-category-slider/templates/with_image.php on line 16
    • > PHP Warning
      extract() expects parameter 1 to be array, null given in wp-content/plugins/wpb-woocommerce-category-slider/templates/with_image.php on line 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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: product category, woocommerce, category slider, product category slider, product...

wpb-woocommerce-category-slider/main.php 92% from 13 tests

This is the main PHP file of "WPB Product Categories Slider for WooCommerce - Display Categories Slider on Any Page" version 1.2.9, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wpb-woocommerce-category-slider.php" instead of "main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected14,760 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
SVG3036,332
CSS121481145,149
PHP144165651,400
HTML225041,366
Sass150464
JavaScript342049

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity21.50
▷ Minimum class complexity1.00
▷ Maximum class complexity69.00
Average method complexity2.91
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods43
▷ Static methods00.00%
▷ Public methods4093.02%
▷ Protected methods36.98%
▷ Private methods00.00%
Functions27
▷ Named functions27100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin