84% toggle-admin-toolbar

Code Review | Toggle Admin Toolbar

WordPress plugin Toggle Admin Toolbar scored84%from 54 tests.

About plugin

  • Plugin page: toggle-admin-toolbar
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.1
  • WordPress version: 6.3.1
  • First release: May 12, 2022
  • Latest release: Nov 6, 2022
  • Number of updates: 9
  • Update frequency: every 20.7 days
  • Top authors: JRyven (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /632 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼3.08ms] Passed 4 tests

An overview of server-side resources used by Toggle Admin Toolbar
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0643.01 ▼0.43
Dashboard /wp-admin3.36 ▲0.0652.58 ▲1.96
Posts /wp-admin/edit.php3.48 ▲0.1248.92 ▲0.76
Add New Post /wp-admin/post-new.php5.96 ▲0.0884.73 ▼14.60
Media Library /wp-admin/upload.php3.29 ▲0.0641.29 ▲5.88
Toggle Toolbar /wp-admin/options-general.php?page=bpm_tat3.2531.23

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Toggle Admin Toolbar
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,850 ▲6413.25 ▼1.331.92 ▼0.2844.25 ▲1.80
Dashboard /wp-admin2,236 ▲335.83 ▼0.07103.61 ▼4.0340.42 ▲0.97
Posts /wp-admin/edit.php2,121 ▲212.04 ▲0.0535.89 ▼3.0938.06 ▲3.88
Add New Post /wp-admin/post-new.php1,540 ▲1417.64 ▲0.07634.03 ▼65.9861.99 ▲5.52
Media Library /wp-admin/upload.php1,418 ▲214.24 ▲0.02102.95 ▼0.4749.24 ▼0.81
Toggle Toolbar /wp-admin/options-general.php?page=bpm_tat8392.1926.2230.97

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/toggle-admin-toolbar/lib/admin-settings.php:41

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
2 plugin tags: development, email

toggle-admin-toolbar/toggle-admin-toolbar.php Passed 13 tests

The primary PHP file in "Toggle Admin Toolbar" version 1.0.2 is used by WordPress to initiate all plugin functionality
45 characters long description:
Adds options to toggle admin menu visibility.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected295 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP355182295

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity1.91
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods19.09%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.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
There were not PNG files found in your plugin