78% subcategory-list-widget

Code Review | Flynsarmy Subcategory List Widget

WordPress plugin Flynsarmy Subcategory List Widget scored78%from 54 tests.

About plugin

  • Plugin page: subcategory-list-...
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.2-5.7.1
  • WordPress version: 6.3.1
  • First release: Nov 15, 2013
  • Latest release: Apr 27, 2021
  • Number of updates: 15
  • Update frequency: every 181.3 days
  • Top authors: flynsarmy (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /3,557 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.05MB] [CPU: ▼1.34ms] Passed 4 tests

A check of server-side resources used by Flynsarmy Subcategory List Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0543.72 ▼2.00
Dashboard /wp-admin3.36 ▲0.0552.89 ▼3.27
Posts /wp-admin/edit.php3.41 ▲0.0549.89 ▲4.38
Add New Post /wp-admin/post-new.php5.95 ▲0.0594.17 ▼4.45
Media Library /wp-admin/upload.php3.29 ▲0.0638.17 ▲4.78

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_flyncw_subcatwidget
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Flynsarmy Subcategory List Widget: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.07 ▼0.281.86 ▼0.0143.63 ▲3.05
Dashboard /wp-admin2,195 ▲185.59 ▼0.0295.85 ▲4.9940.93 ▼2.07
Posts /wp-admin/edit.php2,097 ▼32.00 ▼0.0334.01 ▼4.6135.38 ▼1.95
Add New Post /wp-admin/post-new.php1,531 ▲523.21 ▲0.08669.97 ▲55.3544.13 ▼15.33
Media Library /wp-admin/upload.php1,403 ▲34.16 ▼0.0297.79 ▼5.0647.19 ▼1.08

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_flyncw_subcatwidget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% 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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/subcategory-list-widget/flyn-subcatlist-widget.php
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Category_Checklist' not found in wp-content/plugins/subcategory-list-widget/includes/walker_named_category_checklist.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_list_categories() in wp-content/plugins/subcategory-list-widget/views/subcat-widget/frontend/widget.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/subcategory-list-widget/subcat-widget.php:8

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 90% from 29 tests

readme.txt 88% from 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
These attributes need to be fixed:
  • Contributors: The plugin contributors field is missing
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Backend widget options), #2 (Example output)
Please take inspiration from this readme.txt

subcategory-list-widget/flyn-subcatlist-widget.php 92% from 13 tests

The main PHP script in "Flynsarmy Subcategory List Widget" version 1.2.2 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("subcategory-list-widget.php" instead of "flyn-subcatlist-widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected260 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP439135260

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity17.00
▷ Minimum class complexity3.00
▷ Maximum class complexity31.00
Average method complexity5.00
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.17MB with 0.11MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png135.86KB47.47KB▼ 65.06%
screenshot-2.png40.93KB17.59KB▼ 57.03%