84% hide-and-show-admin-bar

Code Review | Hide and Show Admin Bar

WordPress plugin Hide and Show Admin Bar scored84%from 54 tests.

About plugin

  • Plugin page: hide-and-show-adm...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.6.1
  • WordPress version: 6.3.1
  • First release: Nov 29, 2016
  • Latest release: Dec 20, 2016
  • Number of updates: 3
  • Update frequency: every 6.3 days
  • Top authors: kiranb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /707 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

Server-side resources used by Hide and Show Admin Bar
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.79 ▼1.67
Dashboard /wp-admin3.31 ▲0.0150.98 ▼1.41
Posts /wp-admin/edit.php3.36 ▲0.0048.93 ▼4.68
Add New Post /wp-admin/post-new.php5.89 ▲0.00100.37 ▼0.10
Media Library /wp-admin/upload.php3.23 ▲0.0036.71 ▲2.93

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Hide and Show Admin Bar
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,942 ▲19613.76 ▼0.628.51 ▲6.6543.44 ▼10.49
Dashboard /wp-admin2,206 ▲185.91 ▲0.05100.51 ▼11.4838.29 ▼3.06
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0434.09 ▼4.3834.51 ▼2.23
Add New Post /wp-admin/post-new.php1,352 ▼16217.14 ▼0.38530.04 ▼185.9460.50 ▼0.22
Media Library /wp-admin/upload.php1,391 ▲34.15 ▼0.00102.56 ▼5.0151.83 ▲4.79

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/hide-and-show-admin-bar/kb-hidenshow-adminbar.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

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, show, adminbar, toolbar, hide and show...

hide-and-show-admin-bar/kb-hidenshow-adminbar.php 92% from 13 tests

The main PHP file in "Hide and Show Admin Bar" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("hide-and-show-admin-bar.php" instead of "kb-hidenshow-adminbar.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin65 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
CSS16039
PHP16914
JavaScript19012

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.14
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%
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 images were found in this plugin