74% just-an-admin-button

Code Review | Just an admin button

WordPress plugin Just an admin button scored74%from 54 tests.

About plugin

  • Plugin page: just-an-admin-button
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-5.0.2
  • WordPress version: 6.3.1
  • First release: Jul 1, 2017
  • Latest release: Jan 6, 2019
  • Number of updates: 15
  • Update frequency: every 37.6 days
  • Top authors: cristidraghici (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /5,937 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

Server-side resources used by Just an admin button
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.443.73 ▼32.24
Dashboard /wp-admin2.05 ▼1.306.85 ▼51.58
Posts /wp-admin/edit.php2.05 ▼1.315.80 ▼44.61
Add New Post /wp-admin/post-new.php2.05 ▼3.845.64 ▼88.69
Media Library /wp-admin/upload.php2.05 ▼1.185.24 ▼29.80

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Just an admin button
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,635 ▼11113.16 ▼1.501.45 ▼0.1745.92 ▲1.66
Dashboard /wp-admin2,205 ▲175.79 ▲0.8799.67 ▼1.6638.49 ▼2.40
Posts /wp-admin/edit.php2,091 ▲22.06 ▼0.0538.96 ▲3.1836.74 ▼0.16
Add New Post /wp-admin/post-new.php1,539 ▲618.28 ▼5.09610.06 ▼35.8254.99 ▲11.19
Media Library /wp-admin/upload.php1,393 ▲54.23 ▼0.0495.15 ▲1.5141.81 ▲1.85

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 50% 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
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the just-an-admin-button-css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, 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 take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/just-an-admin-button/just-an-admin-button.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
2 plugin tags: hide administration toolbar, hidden admin toolbar

just-an-admin-button/just-an-admin-button.php Passed 13 tests

Analyzing the main PHP file in "Just an admin button" version 1.2.0
68 characters long description:
This plugin will hide the admin bar and just display a button to it.

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 plugin33 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
CSS13020
PHP141513

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.60
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG files were detected