89% admin-bar-user-switching

Code Review | Admin Bar User Switching

WordPress plugin Admin Bar User Switching scored89%from 54 tests.

About plugin

  • Plugin page: admin-bar-user-sw...
  • Plugin version: 1.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-6.0
  • WordPress version: 6.3.1
  • First release: Nov 27, 2014
  • Latest release: May 24, 2022
  • Number of updates: 32
  • Update frequency: every 85.5 days
  • Top authors: wpmarkuk (62.5%)wpexpertsio (34.38%)drazenbebic (9.38%)

Code review

54 tests

User reviews

11 reviews

Install metrics

3,000+ active /43,675 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.00MB] [CPU: ▼3.02ms] 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 /3.47 ▲0.0039.90 ▲3.43
Dashboard /wp-admin3.31 ▲0.0046.32 ▼0.68
Posts /wp-admin/edit.php3.36 ▲0.0045.15 ▼0.77
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.54 ▼12.93
Media Library /wp-admin/upload.php3.23 ▲0.0035.63 ▲2.32

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, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

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 /2,812 ▲5114.23 ▼0.331.71 ▲0.1042.71 ▼0.02
Dashboard /wp-admin2,195 ▲145.54 ▼0.1786.16 ▼11.0741.73 ▼0.69
Posts /wp-admin/edit.php2,100 ▲31.99 ▲0.0134.81 ▼0.4832.59 ▼2.69
Add New Post /wp-admin/post-new.php1,526 ▼023.02 ▼0.49660.29 ▼26.8258.52 ▲6.66
Media Library /wp-admin/upload.php1,403 ▲64.21 ▲0.0399.81 ▼7.7946.29 ▼1.54

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

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: wordpress, users, user switching

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

"Admin Bar User Switching" version 1.4'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