78% wp-users-masquerade

Code Review | WP Users Masquerade

WordPress plugin WP Users Masquerade scored78%from 54 tests.

About plugin

  • Plugin page: wp-users-masquerade
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.8
  • WordPress version: 6.3.1
  • First release: Jul 27, 2017
  • Latest release: Jul 27, 2017
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: lagunaisw (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /1,189 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼6.46ms] Passed 4 tests

A check of server-side resources used by WP Users Masquerade
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0642.89 ▼0.21
Dashboard /wp-admin3.36 ▲0.0550.07 ▼1.50
Posts /wp-admin/edit.php3.41 ▲0.0547.34 ▼6.76
Add New Post /wp-admin/post-new.php5.96 ▲0.0786.59 ▼13.62
Media Library /wp-admin/upload.php3.28 ▲0.0537.31 ▼3.94

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

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

Browser metrics Passed 4 tests

A check of browser resources used by WP Users Masquerade
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,890 ▲10414.27 ▼0.083.58 ▲1.6542.21 ▼1.18
Dashboard /wp-admin2,295 ▲1185.59 ▼0.0885.89 ▼7.9441.78 ▼1.52
Posts /wp-admin/edit.php2,173 ▲732.07 ▲0.0837.24 ▼1.4538.78 ▲3.68
Add New Post /wp-admin/post-new.php1,559 ▲3323.28 ▲0.42664.36 ▼14.3556.40 ▲0.24
Media Library /wp-admin/upload.php1,461 ▲614.28 ▲0.1298.16 ▼4.9549.31 ▲1.25

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% from 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
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-users-masquerade/partials/admin-bar-node.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/wp-users-masquerade/partials/active-notification.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 on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: admin login as user, user login, admin login, login as user, masquerade as user

wp-users-masquerade/masquerade.php 92% from 13 tests

The main PHP file in "WP Users Masquerade" ver. 2.0.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-users-masquerade.php" instead of "masquerade.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin6,460 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
HTML36403,167
JavaScript7189242,349
CSS77340752
PHP34523178
JSON10014

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity32.00
▷ Minimum class complexity32.00
▷ Maximum class complexity32.00
Average method complexity3.58
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods18.33%
▷ Public methods1191.67%
▷ Protected methods00.00%
▷ Private methods18.33%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
6 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/chosen_v1.3.0/docsupport/chosen.png1.47KB2.08KB0.00%
css/chosen-sprite.png0.53KB0.88KB0.00%
css/chosen-sprite@2x.png0.72KB0.83KB0.00%
vendor/chosen_v1.3.0/docsupport/oss-credit.png4.30KB3.26KB▼ 24.02%
vendor/chosen_v1.3.0/chosen-sprite.png0.53KB0.88KB0.00%