99% admin-bar-user-switching

Code Review | Admin Bar User Switching

WordPress plugin Admin Bar User Switching scored 99% from 54 tests.

About plugin

  • Plugin page: admin-bar-user-sw...
  • Plugin version: 1.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.8.1
  • WordPress version: 5.8.1
  • First release: Nov 27, 2014
  • Latest release: Oct 22, 2021
  • Number of updates: 28
  • Update frequency: every 90.0 days
  • Top authors: wpmarkuk (71.43%)wpexpertsio (25%)drazenbebic (10.71%)

Code review

54 tests

User reviews

9 reviews

Install metrics

2,000+ active / 32,432 total downloads

Benchmarks

Plugin footprint Passed 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.00MB] [CPU: ▼137.22ms] Passed 4 tests

This is a short check of server-side resources used by Admin Bar User Switching
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1238.51 ▲11.42
Dashboard /wp-admin3.06 ▲0.0054.48 ▲8.12
Posts /wp-admin/edit.php3.11 ▲0.0045.03 ▼0.49
Add New Post /wp-admin/post-new.php5.42 ▼0.0291.95 ▼562.24
Media Library /wp-admin/upload.php3.00 ▲0.0038.13 ▲5.75

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 18 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Admin Bar User Switching
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,712 ▲7515.91 ▲0.2111.38 ▲1.4251.10 ▼2.93
Dashboard /wp-admin2,989 ▲586.00 ▼0.02148.47 ▼3.29116.70 ▲0.67
Posts /wp-admin/edit.php2,739 ▲32.72 ▲0.0163.52 ▼0.6892.08 ▼4.26
Add New Post /wp-admin/post-new.php1,683 ▼18918.74 ▼0.43409.05 ▲25.18116.54 ▲5.80
Media Library /wp-admin/upload.php1,807 ▼35.03 ▼0.01165.78 ▲17.71139.09 ▲18.76

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstall script ran successfully

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 90% from 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
3 plugin tags: users, wordpress, user switching

admin-bar-user-switching/admin-bar-user-switching.php 77% from 13 tests

"Admin Bar User Switching" version 1.3'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:
  • Domain Path: The domain path points to an invalid folder, "/i18n/languages/" does not exist
  • Description: Please don't use more than 140 characters for the plugin description (currently 365 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
Success! There were no dangerous files found in this plugin771 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP14164280676
JavaScript126994
JSON1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity9.62
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.86
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes112.50%
Methods38
▷ Static methods410.53%
▷ Public methods3694.74%
▷ Protected methods00.00%
▷ Private methods25.26%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants10
▷ Global constants10100.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 images were found in this plugin