84% auto-hide-admin-menu-items

Code Review | Useful Admin Menu

WordPress plugin Useful Admin Menu scored84%from 54 tests.

About plugin

  • Plugin page: auto-hide-admin-m...
  • Plugin version: 2.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Nov 25, 2019
  • Latest release: Apr 15, 2023
  • Number of updates: 40
  • Update frequency: every 31.0 days
  • Top authors: ioannup (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /28,394 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.40ms] Passed 4 tests

An overview of server-side resources used by Useful Admin Menu
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0339.03 ▼4.80
Dashboard /wp-admin3.32 ▲0.0244.54 ▼3.42
Posts /wp-admin/edit.php3.44 ▲0.0949.99 ▲5.44
Add New Post /wp-admin/post-new.php5.93 ▲0.0481.71 ▼18.82
Media Library /wp-admin/upload.php3.25 ▲0.0342.64 ▲11.50

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Useful Admin Menu
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,779 ▲4413.27 ▼1.134.44 ▲2.6742.75 ▼3.94
Dashboard /wp-admin2,185 ▼64.88 ▼0.03100.30 ▼19.1938.46 ▼7.78
Posts /wp-admin/edit.php2,075 ▼172.08 ▲0.0735.94 ▲0.4436.15 ▲4.16
Add New Post /wp-admin/post-new.php1,556 ▲2318.39 ▼4.77617.35 ▼34.7752.21 ▼3.98
Media Library /wp-admin/upload.php1,385 ▼34.24 ▲0.0698.65 ▼0.9241.63 ▼1.78

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/auto-hide-admin-menu-items/inc/settings.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/auto-hide-admin-menu-items/auto-hide-admin-menu.php:19

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Donate link: Invalid url: ""
Please take inspiration from this readme.txt

auto-hide-admin-menu-items/auto-hide-admin-menu.php 92% from 13 tests

The entry point to "Useful Admin Menu" version 2.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("auto-hide-admin-menu-items.php" instead of "auto-hide-admin-menu.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin551 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP28173344
JavaScript21816169
CSS16038

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity52.00
▷ Minimum class complexity52.00
▷ Maximum class complexity52.00
Average method complexity3.22
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods23
▷ Static methods1460.87%
▷ Public methods939.13%
▷ Protected methods00.00%
▷ Private methods1460.87%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.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