84% fast-user-switching

Code Review | Fast User Switching

WordPress plugin Fast User Switching scored84%from 54 tests.

About plugin

  • Plugin page: fast-user-switching
  • Plugin version: 1.4.9
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.5.1
  • WordPress version: 6.3.1
  • First release: Sep 24, 2017
  • Latest release: Oct 1, 2020
  • Number of updates: 34
  • Update frequency: every 32.4 days
  • Top authors: ehsantikweb (97.06%)Kasperta (5.88%)

Code review

54 tests

User reviews

9 reviews

Install metrics

3,000+ active /15,091 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼6.31ms] Passed 4 tests

Analyzing server-side resources used by Fast User Switching
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1341.70 ▲1.42
Dashboard /wp-admin3.44 ▲0.1047.64 ▼17.66
Posts /wp-admin/edit.php3.56 ▲0.2052.91 ▲5.94
Add New Post /wp-admin/post-new.php6.04 ▲0.1584.55 ▼8.58
Media Library /wp-admin/upload.php3.37 ▲0.1335.14 ▼0.41
Fast user switching /wp-admin/options-general.php?page=fast_user_switching3.3333.13

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
can_compress_scripts
fus_settings
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Fast User Switching
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,108 ▲36214.39 ▼0.1915.12 ▲13.5342.30 ▲0.09
Dashboard /wp-admin2,265 ▲805.31 ▲0.35116.04 ▼11.8335.88 ▼16.54
Posts /wp-admin/edit.php2,148 ▲592.27 ▲0.2446.18 ▲9.4136.19 ▲2.14
Add New Post /wp-admin/post-new.php1,558 ▲1623.73 ▲5.43714.41 ▲78.3456.03 ▲5.02
Media Library /wp-admin/upload.php1,456 ▲654.50 ▲0.3298.72 ▼0.8341.14 ▼3.12
Fast user switching /wp-admin/options-general.php?page=fast_user_switching9731.9331.5126.31

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • fus_settings
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 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
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/fast-user-switching/admin-option.php:2

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
You can look at the official readme.txt

fast-user-switching/fast-user-switching.php 92% from 13 tests

Analyzing the main PHP file in "Fast User Switching" version 1.4.9
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 145 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin763 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP4270133666
PO File1232664
JavaScript210133

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity31.00
▷ Minimum class complexity31.00
▷ Maximum class complexity31.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods440.00%
▷ Public methods880.00%
▷ Protected methods00.00%
▷ Private methods220.00%
Functions29
▷ Named functions2793.10%
▷ Anonymous functions26.90%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin