83% hide-admin-bar-for-user-roles

Code Review | Hide Admin Bar For User Roles

WordPress plugin Hide Admin Bar For User Roles scored83%from 54 tests.

About plugin

  • Plugin page: hide-admin-bar-fo...
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.0-5.9
  • WordPress version: 6.3.1
  • First release: May 5, 2021
  • Latest release: Feb 18, 2022
  • Number of updates: 5
  • Update frequency: every 57.8 days
  • Top authors: subodhghulaxe (100%)

Code review

54 tests

User reviews

1 review

Install metrics

800+ active /3,094 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.97ms] Passed 4 tests

Analyzing server-side resources used by Hide Admin Bar For User Roles
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.01 ▼4.53
Dashboard /wp-admin3.32 ▲0.0250.59 ▲1.73
Posts /wp-admin/edit.php3.37 ▲0.0256.90 ▼0.31
Add New Post /wp-admin/post-new.php5.90 ▲0.0287.20 ▼16.76
Media Library /wp-admin/upload.php3.24 ▲0.0239.06 ▲2.34
Hide Admin Bar /wp-admin/options-general.php?page=habfur_options3.2534.80

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Hide Admin Bar For User Roles
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.25 ▼0.021.89 ▲0.1443.35 ▲2.98
Dashboard /wp-admin2,199 ▲255.62 ▲0.0886.94 ▼1.6239.31 ▼2.89
Posts /wp-admin/edit.php2,104 ▲42.11 ▲0.0834.27 ▼9.2834.34 ▼6.25
Add New Post /wp-admin/post-new.php1,529 ▲123.03 ▲0.05664.52 ▲39.3060.02 ▲8.05
Media Library /wp-admin/upload.php1,407 ▲74.15 ▼0.15102.26 ▼2.1246.70 ▲1.66
Hide Admin Bar /wp-admin/options-general.php?page=habfur_options1,0291.9922.6646.70

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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 | 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
Almost there! Just fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/hide-admin-bar-for-user-roles/admin/pages/options.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/hide-admin-bar-for-user-roles/admin/pages/tabs/help.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/hide-admin-bar-for-user-roles/admin/pages/tabs/settings.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: Add images for these screenshots: #1 (**Hide Admin Bar** - Select the desired role and hide admin bar.), #2 (**Settings Page** - Here you can manage admin bar settings.), #3 (**Help Page** - List of FAQ and support contact information.)
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

hide-admin-bar-for-user-roles/HABFUR.php 77% from 13 tests

The entry point to "Hide Admin Bar For User Roles" version 1.1.1 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("hide-admin-bar-for-user-roles.php" instead of "HABFUR.php")
  • Domain Path: The domain path folder was not found ("/languages")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 220 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin529 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP756121247
CSS111183
JavaScript115999

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity8.50
▷ Minimum class complexity8.00
▷ Maximum class complexity9.00
Average method complexity2.07
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods214.29%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
There were not PNG files found in your plugin