78% auto-hide-admin-bar

Code Review | Auto Hide Admin Bar

WordPress plugin Auto Hide Admin Bar scored78%from 54 tests.

About plugin

  • Plugin page: auto-hide-admin-bar
  • Plugin version: 1.6.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Mar 3, 2011
  • Latest release: Jan 24, 2023
  • Number of updates: 90
  • Update frequency: every 48.3 days
  • Top authors: mbootsman (100%)

Code review

54 tests

User reviews

30 reviews

Install metrics

5,000+ active /113,021 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.08MB] [CPU: ▼7.16ms] Passed 4 tests

A check of server-side resources used by Auto Hide Admin Bar
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0340.36 ▼5.70
Dashboard /wp-admin3.40 ▲0.0953.79 ▲0.07
Posts /wp-admin/edit.php3.51 ▲0.1552.59 ▲1.81
Add New Post /wp-admin/post-new.php5.98 ▲0.0995.13 ▼24.83
Media Library /wp-admin/upload.php3.32 ▲0.0942.54 ▲7.18
Auto Hide Admin Bar /wp-admin/options-general.php?page=auto-hide-admin-bar3.2734.14

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Auto Hide Admin Bar
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,989 ▲22813.87 ▼0.7212.17 ▲10.2847.60 ▼1.32
Dashboard /wp-admin2,199 ▲225.62 ▼0.0991.02 ▼11.0540.53 ▼5.36
Posts /wp-admin/edit.php2,104 ▲42.04 ▲0.0341.67 ▲2.9536.10 ▼0.35
Add New Post /wp-admin/post-new.php1,534 ▼1122.82 ▼0.47680.31 ▲2.6059.03 ▼0.57
Media Library /wp-admin/upload.php1,404 ▲14.20 ▼0.02101.18 ▼5.8841.46 ▼7.68
Auto Hide Admin Bar /wp-admin/options-general.php?page=auto-hide-admin-bar1,0622.1727.8331.36

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=auto-hide-admin-bar
    • > Notice in wp-content/plugins/auto-hide-admin-bar/ahab_options.php+549
    Trying to access array offset on value of type bool

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 take a closer look at 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/auto-hide-admin-bar/ahab_options.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/auto-hide-admin-bar/auto-hide-admin-bar.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: admin bar, toolbar, adminbar, auto, hide...

auto-hide-admin-bar/auto-hide-admin-bar.php 92% from 13 tests

Analyzing the main PHP file in "Auto Hide Admin Bar" version 1.6.2
It is important to fix the following:
  • Domain Path: The domain path is invalid: folder "/languages/" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin807 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP2101321483
JavaScript24669236
CSS115188

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
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%
Functions30
▷ Named functions30100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin