83% toggle-admin-bar

Code Review | Toggle Admin Bar

WordPress plugin Toggle Admin Bar scored 83% from 54 tests.

About plugin

  • Plugin page: toggle-admin-bar
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-3.5.1
  • WordPress version: 6.3.1
  • First release: Sep 16, 2011
  • Latest release: Mar 15, 2013
  • Number of updates: 19
  • Update frequency: every 29.3 days
  • Top authors: wycks (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,820 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.15ms] Passed 4 tests

Analyzing server-side resources used by Toggle Admin Bar
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.53 ▼8.50
Dashboard /wp-admin3.31 ▲0.0145.38 ▼2.08
Posts /wp-admin/edit.php3.36 ▲0.0146.36 ▼1.26
Add New Post /wp-admin/post-new.php5.91 ▲0.0396.46 ▼0.74
Media Library /wp-admin/upload.php3.24 ▲0.0136.54 ▲1.69

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

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

Browser metrics Passed 4 tests

Toggle Admin Bar: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,956 ▲22113.66 ▼0.7510.50 ▲8.8043.33 ▼4.20
Dashboard /wp-admin2,232 ▲415.89 ▲1.00103.15 ▼0.6368.04 ▲22.73
Posts /wp-admin/edit.php2,124 ▲352.07 ▲0.0639.41 ▲3.7934.28 ▼0.34
Add New Post /wp-admin/post-new.php1,549 ▲718.20 ▼0.09711.79 ▲58.9078.62 ▲27.40
Media Library /wp-admin/upload.php1,414 ▲294.17 ▼0.06105.16 ▲7.0675.35 ▲31.88

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

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 items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/toggle-admin-bar/justscroll.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 errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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 your attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === toggle-admin-bar === )
  • Screenshots: Add an image for screenshot #1 (It's just a button.)
The official readme.txt is a good inspiration

toggle-admin-bar/justscroll.php 92% from 13 tests

This is the main PHP file of "Toggle Admin Bar" version 1.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("toggle-admin-bar.php" instead of "justscroll.php")

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
Everything looks great! No dangerous files found in this plugin91 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1171790
JavaScript1071

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.13
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%
Constants1
▷ Global constants1100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
slide-arrow.png0.54KB0.62KB0.00%