78% list-categories-widget

Code Review | list categories widget

WordPress plugin list categories widget scored78%from 54 tests.

About plugin

  • Plugin page: list-categories-w...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-5.9
  • WordPress version: 6.3.1
  • First release: Feb 17, 2022
  • Latest release: Jul 6, 2022
  • Number of updates: 19
  • Update frequency: every 7.4 days
  • Top authors: peacefulqode (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /689 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.09MB] [CPU: ▼3.32ms] Passed 4 tests

A check of server-side resources used by list categories widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1039.11 ▼5.05
Dashboard /wp-admin3.39 ▲0.0948.10 ▼4.65
Posts /wp-admin/edit.php3.51 ▲0.1548.84 ▼1.53
Add New Post /wp-admin/post-new.php5.99 ▲0.1092.46 ▼2.04
Media Library /wp-admin/upload.php3.32 ▲0.0833.50 ▼0.53

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_custom-post-type-categories
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for list categories widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,912 ▲17713.67 ▼0.939.43 ▲7.5543.44 ▲0.45
Dashboard /wp-admin2,210 ▲255.84 ▲0.8595.79 ▼12.6237.29 ▼9.35
Posts /wp-admin/edit.php2,093 ▲42.05 ▲0.0639.70 ▲1.7235.94 ▲2.79
Add New Post /wp-admin/post-new.php1,527 ▼718.62 ▼4.53647.61 ▼37.2367.32 ▲12.44
Media Library /wp-admin/upload.php1,392 ▲14.25 ▲0.0493.50 ▼8.2741.32 ▼1.61

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • widget_custom-post-type-categories
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

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 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/list-categories-widget/admin/partials/woo-categories-widget-admin-display.php
    • > /wp-content/plugins/list-categories-widget/public/partials/woo-categories-widget-public-display.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Category' not found in wp-content/plugins/list-categories-widget/includes/helper/helper.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/list-categories-widget/includes/widgets/woo-cat.php:11

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% 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
1 plugin tags: category widgetcustom widgetposts-widgettaxonomy widget

list-categories-widget/list-categories-widget.php 92% from 13 tests

Analyzing the main PHP file in "list categories widget" version 1.0.0
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 199 characters long)

Code Analysis Passed 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 plugin367 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP14162541333
JavaScript295420
CSS23914

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity3.55
▷ Minimum class complexity1.00
▷ Maximum class complexity18.00
Average method complexity1.90
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods31
▷ Static methods39.68%
▷ Public methods2683.87%
▷ Protected methods00.00%
▷ Private methods516.13%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected