94% userswitcher

Code Review | User Switcher

WordPress plugin User Switcher scored 94% from 53 tests.

About plugin

  • Plugin page: userswitcher
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.6
  • WordPress version: 5.8.1
  • First release: Sep 13, 2014
  • Latest release: Dec 3, 2016
  • Number of updates: 24
  • Update frequency: every 33.8 days
  • Top authors: irenem (100%)

Code review

53 tests

User reviews

7 reviews

Install metrics

400+ active / 6,343 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.08MB] [CPU: ▼257.86ms] Passed 4 tests

Analyzing server-side resources used by User Switcher
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.92 ▲0.2032.20 ▲10.92
Dashboard /wp-admin3.13 ▲0.0846.30 ▲2.36
Posts /wp-admin/edit.php3.22 ▲0.1143.34 ▲9.36
Add New Post /wp-admin/post-new.php5.50 ▲0.0787.47 ▼1,036.85
Media Library /wp-admin/upload.php3.07 ▲0.0733.75 ▼6.30

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for User Switcher
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,893 ▲28816.76 ▲0.8814.53 ▲6.0546.08 ▼1.62
Dashboard /wp-admin2,996 ▲1436.38 ▲0.52139.13 ▲3.19108.48 ▲6.97
Posts /wp-admin/edit.php2,749 ▲432.74 ▼0.0972.56 ▲7.7595.56 ▼1.05
Add New Post /wp-admin/post-new.php1,622 ▼42021.62 ▲2.17281.51 ▼69.54109.49 ▲1.84
Media Library /wp-admin/upload.php1,809 ▲375.06 ▲0.08152.74 ▲0.94110.01 ▼8.00

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstall script ran successfully

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 no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/userswitcher/userswitcher.php:78

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed: The official readme.txt might help

userswitcher/userswitcher.php 92% from 13 tests

The main file in "User Switcher" v. 2.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 165 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected776 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP182113332
JavaScript22317224
CSS234220

PHP code Passed 2 tests

Analyzing 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.24
Average class complexity27.00
▷ Minimum class complexity27.00
▷ Maximum class complexity27.00
Average method complexity2.37
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods315.79%
▷ Public methods1789.47%
▷ Protected methods210.53%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected