84% hide-admin-bar-from-non-admins

Code Review | Hide Admin Bar from Non-Admins

WordPress plugin Hide Admin Bar from Non-Admins scored84%from 54 tests.

About plugin

  • Plugin page: hide-admin-bar-fr...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2
  • WordPress version: 6.3.1
  • First release: Jun 20, 2013
  • Latest release: Apr 12, 2023
  • Number of updates: 10
  • Update frequency: every 360.7 days
  • Top authors: strangerstudios (100%)

Code review

54 tests

User reviews

29 reviews

Install metrics

20,000+ active /200,568 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

An overview of server-side resources used by Hide Admin Bar from Non-Admins
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0041.20 ▼5.65
Dashboard /wp-admin3.31 ▼0.0450.88 ▼13.97
Posts /wp-admin/edit.php3.36 ▲0.0055.49 ▲4.09
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.32 ▼20.84
Media Library /wp-admin/upload.php3.23 ▲0.0044.28 ▲7.13

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Hide Admin Bar from Non-Admins
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.20 ▼0.071.69 ▼0.0546.08 ▲4.09
Dashboard /wp-admin2,195 ▲155.61 ▼0.0591.32 ▲1.2438.45 ▼3.72
Posts /wp-admin/edit.php2,100 ▲31.97 ▼0.0640.29 ▲3.0536.15 ▲3.25
Add New Post /wp-admin/post-new.php1,526 ▼323.12 ▼0.61679.23 ▲18.5555.14 ▲3.36
Media Library /wp-admin/upload.php1,400 ▼34.17 ▲0.0299.29 ▼2.0443.53 ▼1.94

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hide-admin-bar-from-non-admins/hide-admin-bar-from-non-admins.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

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
5 plugin tags: admin bar, adminbar, membership, toolbar, dashboard

hide-admin-bar-from-non-admins/hide-admin-bar-from-non-admins.php Passed 13 tests

The main file in "Hide Admin Bar from Non-Admins" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
64 characters long description:
Hides the WordPress toolbar (admin bar) for all non-admin users.

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
There were no executable files found in this plugin23 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP131223

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
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%
Functions3
▷ Named functions3100.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
No PNG files were detected