90% wp-user-switch

Code Review | WP User Switch

WordPress plugin WP User Switch scored 90% from 54 tests.

About plugin

  • Plugin page: wp-user-switch
  • Plugin version: 1.0.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.2
  • WordPress version: 6.3.1
  • First release: Feb 2, 2020
  • Latest release: Jul 11, 2023
  • Number of updates: 12
  • Update frequency: every 104.7 days
  • Top authors: iqbalrony (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

1,000+ active / 14,514 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼7.27ms] Passed 4 tests

Analyzing server-side resources used by WP User Switch
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.05 ▼5.34
Dashboard /wp-admin3.33 ▲0.0243.06 ▼6.56
Posts /wp-admin/edit.php3.38 ▲0.0245.77 ▼1.23
Add New Post /wp-admin/post-new.php5.91 ▲0.0282.81 ▼15.95
Media Library /wp-admin/upload.php3.25 ▲0.0235.47 ▲3.18

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

WP User Switch: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,926 ▲19113.59 ▼0.729.04 ▲6.9042.07 ▼8.55
Dashboard /wp-admin2,238 ▲474.86 ▼0.01103.71 ▲1.8839.48 ▼8.91
Posts /wp-admin/edit.php2,121 ▲322.06 ▲0.0238.93 ▼1.7035.26 ▼1.12
Add New Post /wp-admin/post-new.php1,551 ▲3723.18 ▲5.61664.28 ▲43.2653.74 ▲2.00
Media Library /wp-admin/upload.php1,423 ▲384.17 ▼0.07104.84 ▲3.4943.78 ▼2.82

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests Passed 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 Passed 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
Looking good! No server-side errors or output on direct access of PHP files

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 on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: switch user, user switching, user switch, switching account, wp user switch

wp-user-switch/wp-user-switch.php Passed 13 tests

The main PHP script in "WP User Switch" version 1.0.4 is automatically included on every request by WordPress
110 characters long description:
Switch instantly between one user account to another account in WordPress. This plugin make this easy for you.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected594 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP75690414
CSS2182126
Markdown119030
JavaScript14124

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity23.00
▷ Minimum class complexity23.00
▷ Maximum class complexity23.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods18.33%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/front-icon.png5.73KB3.10KB▼ 45.98%
assets/images/icon.png56.32KB14.74KB▼ 73.82%