84% dmg-custom-menu-widget

Code Review | DMG Custom Menu Widget

WordPress plugin DMG Custom Menu Widget scored84%from 54 tests.

About plugin

  • Plugin page: dmg-custom-menu-w...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.6
  • WordPress version: 6.3.1
  • First release: Aug 25, 2016
  • Latest release: Aug 25, 2016
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: dancoded (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,128 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼5.45ms] Passed 4 tests

Analyzing server-side resources used by DMG Custom Menu Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0742.27 ▲0.18
Dashboard /wp-admin3.37 ▲0.0353.02 ▼15.08
Posts /wp-admin/edit.php3.49 ▲0.1349.00 ▼1.53
Add New Post /wp-admin/post-new.php5.95 ▲0.0797.91 ▼5.36
Media Library /wp-admin/upload.php3.29 ▲0.0740.48 ▲3.75

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_dmg_custom_menu_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

DMG Custom Menu Widget: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.24 ▼0.381.79 ▲0.2342.68 ▲3.41
Dashboard /wp-admin2,195 ▲155.65 ▲0.0599.69 ▲7.4546.08 ▲3.46
Posts /wp-admin/edit.php2,100 ▼31.99 ▼0.0233.28 ▼8.6135.49 ▲0.17
Add New Post /wp-admin/post-new.php1,526 ▼023.32 ▼0.38669.75 ▲5.3560.70 ▲9.16
Media Library /wp-admin/upload.php1,397 ▼04.18 ▼0.06105.09 ▲3.0347.95 ▲3.29

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_dmg_custom_menu_widget

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'DMG\\WP_Widget_Base\\WP_Widget_Base' not found in wp-content/plugins/dmg-custom-menu-widget/src/WP_Custom_Menu_Widget.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/dmg-custom-menu-widget/vendor/DMG/WP_Widget_Base/src/WP_Widget_Base.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: menu widget, menu, list pages, css

dmg-custom-menu-widget/dmg-custom-menu-widget.php Passed 13 tests

The main PHP file in "DMG Custom Menu Widget" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
116 characters long description:
Displays a menu created on the Apperance > Menus page with advanced options to add CSS classes and display the title

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected372 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP316874342
JSON14018
Markdown25012

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity21.00
▷ Minimum class complexity6.00
▷ Maximum class complexity36.00
Average method complexity2.74
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods23
▷ Static methods00.00%
▷ Public methods23100.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

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin