84% dmg-categories-widget

Code Review | DMG Categories Widget

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

About plugin

  • Plugin page: dmg-categories-wi...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.6
  • WordPress version: 5.8.1
  • First release: Aug 31, 2016
  • Latest release: Aug 31, 2016
  • Number of updates: 3
  • Update frequency: every 2.3 days
  • Top authors: dancoded (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 532 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼138.22ms] Passed 4 tests

Analyzing server-side resources used by DMG Categories Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1238.27 ▲15.75
Dashboard /wp-admin3.07 ▲0.0153.23 ▲10.42
Posts /wp-admin/edit.php3.15 ▲0.0440.28 ▼1.15
Add New Post /wp-admin/post-new.php5.42 ▼0.0190.86 ▼562.85
Media Library /wp-admin/upload.php3.01 ▲0.0133.09 ▲0.70

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: no new tables, 1 new option
New WordPress options

Browser metrics Passed 4 tests

An overview of browser requirements for DMG Categories Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8315.88 ▲0.318.59 ▼0.4345.38 ▲2.95
Dashboard /wp-admin2,967 ▲335.89 ▼0.01142.34 ▼5.54108.18 ▲2.27
Posts /wp-admin/edit.php2,739 ▼02.69 ▲0.0166.45 ▼3.7287.09 ▲1.00
Add New Post /wp-admin/post-new.php1,672 ▼1118.94 ▲0.16382.82 ▼13.85106.51 ▼1.86
Media Library /wp-admin/upload.php1,810 ▲35.00 ▼0.01166.52 ▼7.88112.28 ▲1.33

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • widget_dmg_categories_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/dmg-categories-widget/vendor/DMG/WP_Widget_Base/src/WP_Widget_Base.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'DMG\\WP_Widget_Base\\WP_Widget_Base' not found in wp-content/plugins/dmg-categories-widget/src/WP_Categories_Widget.php:26

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)
There were no browser issues found


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
5 plugin tags: categories widget, list categories, category list, css, menu

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

The main PHP file in "DMG Categories Widget" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 172 characters long)

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
Everything looks great! No dangerous files found in this plugin394 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity25.50
▷ Minimum class complexity15.00
▷ Maximum class complexity36.00
Average method complexity3.13
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods23100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions00.00%
▷ Anonymous functions1100.00%
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin