78% hide-admin-bar-from-front-end

Code Review | Hide Admin Bar From Front End

WordPress plugin Hide Admin Bar From Front End scored78%from 54 tests.

About plugin

  • Plugin page: hide-admin-bar-fr...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-6.0.1
  • WordPress version: 6.3.1
  • First release: Apr 16, 2016
  • Latest release: Jul 25, 2022
  • Number of updates: 15
  • Update frequency: every 152.7 days
  • Top authors: amu02aftab (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

3,000+ active /27,350 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
Installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼10.67ms] Passed 4 tests

Analyzing server-side resources used by Hide Admin Bar From Front End
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0034.26 ▼6.13
Dashboard /wp-admin3.32 ▼0.0344.05 ▼17.24
Posts /wp-admin/edit.php3.37 ▲0.0143.59 ▼0.20
Add New Post /wp-admin/post-new.php5.90 ▲0.0179.53 ▼19.12
Media Library /wp-admin/upload.php3.24 ▲0.0134.57 ▲1.35
Hide/Show Admin Bar /wp-admin/options-general.php?page=hide_admin_bar_from_front_end3.2130.92

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Hide Admin Bar From Front End
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.23 ▼0.061.61 ▼0.1240.31 ▼1.53
Dashboard /wp-admin2,196 ▲195.63 ▼0.0479.40 ▼8.4240.69 ▲2.48
Posts /wp-admin/edit.php2,104 ▲41.99 ▲0.0032.98 ▼7.6837.88 ▼2.41
Add New Post /wp-admin/post-new.php1,529 ▼1323.22 ▲4.93650.55 ▲29.5564.19 ▼7.55
Media Library /wp-admin/upload.php1,404 ▲44.20 ▲0.0494.35 ▼4.2740.38 ▼1.86
Hide/Show Admin Bar /wp-admin/options-general.php?page=hide_admin_bar_from_front_end8292.0327.0827.95

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=hide_admin_bar_from_front_end
    • > Notice in wp-content/plugins/hide-admin-bar-from-front-end/includes/hide_admin_bar_from_front_end.php+8
    Undefined index: add_opt_submit
    • > GET request to /wp-admin/options-general.php?page=hide_admin_bar_from_front_end
    • > Notice in wp-content/plugins/hide-admin-bar-from-front-end/includes/hide_admin_bar_from_front_end.php+27
    Undefined variable: message

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
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/hide-admin-bar-from-front-end/includes/hide_admin_bar_from_front_end.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/hide-admin-bar-from-front-end/hide-admin-bar-from-front-end.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Screenshots: Screenshot #1 (Back End Hide/Show Admin Bar setting) image required
You can take inspiration from this readme.txt

hide-admin-bar-from-front-end/hide-admin-bar-from-front-end.php Passed 13 tests

The main PHP script in "Hide Admin Bar From Front End" version 1.0.0 is automatically included on every request by WordPress
68 characters long description:
This plugin provides feature to hide/show admin bar from front end.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin64 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2241564

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png26.76KB14.17KB▼ 47.04%