84% admin-bar-disabler

Code Review | Admin Bar Disabler

WordPress plugin Admin Bar Disabler scored 84% from 54 tests.

About plugin

  • Plugin page: admin-bar-disabler
  • Plugin version: 1.4.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.9
  • WordPress version: 6.3.1
  • First release: Feb 24, 2011
  • Latest release: Mar 5, 2022
  • Number of updates: 29
  • Update frequency: every 138.9 days
  • Top authors: sc0ttkclark (100%)

Code review

54 tests

User reviews

30 reviews

Install metrics

10,000+ active / 162,645 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼2.53ms] Passed 4 tests

A check of server-side resources used by Admin Bar Disabler
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0638.62 ▼5.72
Dashboard /wp-admin3.37 ▲0.0647.02 ▲0.63
Posts /wp-admin/edit.php3.42 ▲0.0648.75 ▼0.41
Add New Post /wp-admin/post-new.php5.95 ▲0.0688.56 ▼4.62
Media Library /wp-admin/upload.php3.29 ▲0.0637.45 ▲3.52
Admin Bar Disabler /wp-admin/options-general.php?page=admin_bar_disabler3.2529.08

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Admin Bar Disabler
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.24 ▼1.121.61 ▼0.1539.83 ▼1.42
Dashboard /wp-admin2,213 ▲285.83 ▼0.05112.63 ▲5.9143.28 ▼0.16
Posts /wp-admin/edit.php2,096 ▲72.04 ▼0.0040.75 ▲1.0335.88 ▲1.01
Add New Post /wp-admin/post-new.php1,546 ▲1318.69 ▼4.40601.06 ▲25.6049.28 ▲0.28
Media Library /wp-admin/upload.php1,386 ▲14.26 ▲0.1295.07 ▼2.2441.67 ▼1.57
Admin Bar Disabler /wp-admin/options-general.php?page=admin_bar_disabler9552.0226.1439.95

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

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
Everything seems fine, however this is by no means an exhaustive test

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
  • 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/admin-bar-disabler/admin-bar-disabler.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
3 plugin tags: admin bar, admin menu, toolbar

admin-bar-disabler/admin-bar-disabler.php Passed 13 tests

The main PHP file in "Admin Bar Disabler" ver. 1.4.2 adds more information about the plugin and also serves as the entry point for this plugin
138 characters long description:
Disable the WP Admin Bar / Toolbar on the frontend of sites for specific roles and capabilities based on inclusion and exclusion settings.

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
No dangerous file extensions were detected289 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP16662289

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity38.00
▷ Minimum class complexity38.00
▷ Maximum class complexity38.00
Average method complexity4.08
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected