84% hide-admin-menu

Code Review | Hide Admin Menu

WordPress plugin Hide Admin Menu scored84%from 54 tests.

About plugin

  • Plugin page: hide-admin-menu
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.2
  • WordPress version: 6.3.1
  • First release: Oct 9, 2017
  • Latest release: Apr 16, 2023
  • Number of updates: 53
  • Update frequency: every 38.0 days
  • Top authors: bhavinthummar (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

20,000+ active /74,872 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
Installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼10.07ms] Passed 4 tests

A check of server-side resources used by Hide Admin Menu
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0847.33 ▲8.89
Dashboard /wp-admin3.45 ▲0.1044.13 ▼15.54
Posts /wp-admin/edit.php3.48 ▲0.1341.55 ▼1.55
Add New Post /wp-admin/post-new.php6.12 ▲0.2476.21 ▼23.27
Media Library /wp-admin/upload.php3.39 ▲0.1634.16 ▲0.07

Server storage [IO: ▲0.02MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Hide Admin Menu
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲7114.15 ▼0.562.24 ▲0.5837.42 ▼3.28
Dashboard /wp-admin2,213 ▲335.63 ▲0.0689.27 ▼2.8137.02 ▲0.93
Posts /wp-admin/edit.php2,121 ▲211.98 ▼0.0333.72 ▼3.9030.14 ▼4.90
Add New Post /wp-admin/post-new.php1,541 ▲1222.95 ▲0.06606.70 ▼4.2353.68 ▼0.80
Media Library /wp-admin/upload.php1,412 ▲124.23 ▲0.0599.00 ▼1.6343.90 ▲0.75

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

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 everything seems fine, this is not an exhaustive test

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
Please fix the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hide-admin-menu/menu-list.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hide-admin-menu/init.php:42

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • License uri: Please fix this invalid url: ""
The official readme.txt might help

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

The principal PHP file in "Hide Admin Menu" v. 1.1.1 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("hide-admin-menu.php" instead of "init.php")

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
Good job! No executable or dangerous file extensions detected424 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP210445402
CSS17622

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin