84% sub-categories-widget

Code Review | Sub Categories Widget

WordPress plugin Sub Categories Widget scored 84% from 54 tests.

About plugin

  • Plugin page: sub-categories-wi...
  • Plugin version: 1.5.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-5.9
  • WordPress version: 5.9.2
  • First release: Jun 22, 2011
  • Latest release: Jan 23, 2022
  • Number of updates: 47
  • Update frequency: every 82.3 days
  • Top authors: BrokenCrust (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

5,000+ active / 63,827 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼315.33ms] Passed 4 tests

An overview of server-side resources used by Sub Categories Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.0656.58 ▲2.13
Dashboard /wp-admin3.47 ▲0.0634.43 ▲0.55
Posts /wp-admin/edit.php3.70 ▲0.0635.03 ▼3.01
Add New Post /wp-admin/post-new.php6.94 ▼0.0493.50 ▼1,253.53
Media Library /wp-admin/upload.php3.35 ▲0.0524.41 ▼5.34

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 1 new option
New WordPress options
widget_sub_categories_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Sub Categories Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,795 ▲4116.19 ▲0.495.56 ▼1.512.41 ▼0.27
Dashboard /wp-admin2,888 ▲306.16 ▼0.00130.49 ▼4.39211.46 ▲47.31
Posts /wp-admin/edit.php2,688 ▼33.23 ▼0.0063.73 ▲0.03138.71 ▼9.95
Add New Post /wp-admin/post-new.php1,661 ▼9116.82 ▼4.16398.73 ▼67.62164.66 ▼17.02
Media Library /wp-admin/upload.php1,698 ▼05.60 ▲0.08152.09 ▲8.40223.07 ▲16.39

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 1 option
    • widget_sub_categories_widget

Smoke tests 75% 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)
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sub-categories-widget/sub-categories-widget.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: category, widget, list, sub-category

sub-categories-widget/sub-categories-widget.php Passed 13 tests

The entry point to "Sub Categories Widget" version 1.5.2 is a PHP file that has certain tags in its header comment area
58 characters long description:
This Widget lists the sub-categories for a given category.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected144 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP12925144

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity37.00
▷ Minimum class complexity37.00
▷ Maximum class complexity37.00
Average method complexity10.00
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin