84% notifications-for-collapsed-admin-menu

Code Review | Notifications for Collapsed Admin Menu

WordPress plugin Notifications for Collapsed Admin Menu scored84%from 54 tests.

About plugin

  • Plugin page: notifications-for...
  • Plugin version: 1.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Aug 26, 2010
  • Latest release: Aug 16, 2023
  • Number of updates: 22
  • Update frequency: every 215.4 days
  • Top authors: coffee2code (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,677 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by Notifications for Collapsed Admin Menu
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0145.49 ▲4.37
Dashboard /wp-admin3.32 ▲0.0144.07 ▼3.76
Posts /wp-admin/edit.php3.37 ▲0.0145.04 ▼1.97
Add New Post /wp-admin/post-new.php5.92 ▲0.0390.22 ▼37.43
Media Library /wp-admin/upload.php3.24 ▲0.0135.00 ▲3.20

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

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

Browser metrics Passed 4 tests

Notifications for Collapsed Admin Menu: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲5913.27 ▼1.111.65 ▼0.2640.92 ▼6.74
Dashboard /wp-admin2,211 ▲204.86 ▼0.02109.15 ▲8.3243.65 ▲1.59
Posts /wp-admin/edit.php2,097 ▲82.04 ▲0.0140.79 ▲3.5937.02 ▲2.80
Add New Post /wp-admin/post-new.php1,542 ▲918.12 ▼2.95601.94 ▼47.2853.20 ▼6.81
Media Library /wp-admin/upload.php1,393 ▲84.25 ▲0.0497.69 ▼6.1042.98 ▼0.82

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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

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
Even though no errors were found, 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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/notifications-for-collapsed-admin-menu/tests/phpunit/bootstrap.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: coffee2code, menu, collapsed, moderation, notifications...

notifications-for-collapsed-admin-menu/notifications-for-collapsed-admin-menu.php Passed 13 tests

"Notifications for Collapsed Admin Menu" version 1.6.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
109 characters long description:
Highlights the comments and plugins icons in the collapsed admin sidebar menu when notifications are pending.

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 detected432 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
Markdown3450174
PHP471135171
JavaScript110047
Bourne Shell16221
XML10014
JSON1005

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity4.00
▷ Minimum class complexity3.00
▷ Maximum class complexity5.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods24
▷ Static methods625.00%
▷ Public methods2291.67%
▷ Protected methods00.00%
▷ Private methods28.33%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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