84% toggleable-admin-bar

Code Review | Toggleable Admin Bar

WordPress plugin Toggleable Admin Bar scored84%from 54 tests.

About plugin

  • Plugin page: toggleable-admin-bar
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Oct 21, 2015
  • Latest release: Aug 3, 2021
  • Number of updates: 8
  • Update frequency: every 264.1 days
  • Top authors: Xanthonius (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /2,098 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

An overview of server-side resources used by Toggleable Admin Bar
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.67 ▼6.26
Dashboard /wp-admin3.31 ▲0.0145.78 ▲2.95
Posts /wp-admin/edit.php3.36 ▲0.0048.80 ▲2.75
Add New Post /wp-admin/post-new.php5.89 ▲0.0093.06 ▲1.26
Media Library /wp-admin/upload.php3.23 ▲0.0032.69 ▼8.46

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

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

Browser metrics Passed 4 tests

Toggleable Admin Bar: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲8913.21 ▼1.472.07 ▲0.2638.90 ▼4.42
Dashboard /wp-admin2,206 ▲245.87 ▲0.01107.92 ▲9.8741.14 ▼4.92
Posts /wp-admin/edit.php2,092 ▲32.05 ▲0.0639.83 ▲3.2333.22 ▼3.72
Add New Post /wp-admin/post-new.php1,520 ▲623.23 ▲5.69661.98 ▼13.3453.85 ▲2.37
Media Library /wp-admin/upload.php1,382 ▼94.19 ▼0.0894.36 ▼8.9343.18 ▼4.06

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • 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)
Even though everything seems fine, this is not 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 take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/toggleable-admin-bar/toggleable-admin-bar.php:196

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Requires at least: Invalid version format
You can look at the official readme.txt

toggleable-admin-bar/toggleable-admin-bar.php 92% from 13 tests

"Toggleable Admin Bar" version 1.3.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 162 characters long)

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 plugin129 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11258129

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.75
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin