10% hidden-by-roles-the-admin-bar

Code Review | Hidden By Roles the Admin Bar

WordPress plugin Hidden By Roles the Admin Bar scored10%from 54 tests.

About plugin

  • Plugin page: hidden-by-roles-t...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.6
  • WordPress version: 6.3.1
  • First release: Jul 20, 2020
  • Latest release: Dec 29, 2020
  • Number of updates: 13
  • Update frequency: every 12.9 days
  • Top authors: kheloshop (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /395 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/hidden-by-roles-the-admin-bar/HBRAB.php+124
    Undefined index: action

Server metrics [RAM: ▼1.86MB] [CPU: ▼54.31ms] Passed 4 tests

A check of server-side resources used by Hidden By Roles the Admin Bar
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.14 ▼1.328.76 ▼31.20
Dashboard /wp-admin2.16 ▼1.195.63 ▼57.63
Posts /wp-admin/edit.php2.16 ▼1.206.92 ▼38.98
Add New Post /wp-admin/post-new.php2.16 ▼3.736.02 ▼89.42
Media Library /wp-admin/upload.php2.16 ▼1.076.01 ▼27.90

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 21 new files
Database: 1 new table, 7 new options
New tables
wp_hbrab_roles_list
New WordPress options
widget_recent-comments
hbrab_db_version
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Hidden By Roles the Admin Bar
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲7813.32 ▼1.086.02 ▲4.3742.85 ▲0.14
Dashboard /wp-admin2,233 ▲455.88 ▲0.01100.35 ▼23.9639.62 ▼5.54
Posts /wp-admin/edit.php2,113 ▲242.04 ▲0.0134.20 ▼4.6432.83 ▼1.93
Add New Post /wp-admin/post-new.php1,535 ▲1617.90 ▼5.21715.25 ▲39.5264.88 ▲6.63
Media Library /wp-admin/upload.php1,409 ▲244.27 ▲0.0798.33 ▼5.1942.05 ▼1.20

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/hidden-by-roles-the-admin-bar/HBRAB.php+124
    Undefined index: action
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • 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
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hidden-by-roles-the-admin-bar/inc/HBRABAdmin.php:76

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: managing roles, admin bar, managing roles custom, custom, hide...

hidden-by-roles-the-admin-bar/HBRAB.php 85% from 13 tests

"Hidden By Roles the Admin Bar" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 415 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("hidden-by-roles-the-admin-bar.php" instead of "HBRAB.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin1,003 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PO File6111114668
PHP44645220
JavaScript15460
CSS115155

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
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%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
1 PNG file occupies 0.31MB with 0.15MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
inc/LogoKheloShopFlat.png318.19KB162.61KB▼ 48.90%