89% login-as-customer-or-user

Code Review | Login as User or Customer

WordPress plugin Login as User or Customer scored89%from 54 tests.

About plugin

  • Plugin page: login-as-customer...
  • Plugin version: 3.8
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3.1
  • WordPress version: 6.3.1
  • First release: Feb 4, 2020
  • Latest release: Sep 16, 2023
  • Number of updates: 71
  • Update frequency: every 18.6 days
  • Top authors: osamaesh (76.06%)codepressplugins (19.72%)wp-buy (7.04%)

Code review

54 tests

User reviews

12 reviews

Install metrics

300+ active /12,173 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.17MB] [CPU: ▼11.07ms] Passed 4 tests

A check of server-side resources used by Login as User or Customer
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1740.43 ▼1.99
Dashboard /wp-admin3.48 ▲0.1445.15 ▼16.59
Posts /wp-admin/edit.php3.59 ▲0.2446.11 ▲1.60
Add New Post /wp-admin/post-new.php6.06 ▲0.1880.98 ▼27.30
Media Library /wp-admin/upload.php3.40 ▲0.1736.31 ▲3.62

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 14 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
loginas_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Login as User or Customer
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,906 ▲13513.57 ▼1.015.61 ▲3.6236.35 ▼7.13
Dashboard /wp-admin2,228 ▲365.84 ▲0.9398.56 ▼12.1538.28 ▲1.53
Posts /wp-admin/edit.php2,111 ▲222.04 ▲0.0135.36 ▼7.5133.00 ▼1.37
Add New Post /wp-admin/post-new.php1,552 ▲3323.13 ▲0.03676.73 ▲77.5655.15 ▲2.37
Media Library /wp-admin/upload.php1,410 ▲224.26 ▲0.07104.74 ▲9.8744.96 ▲3.94

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 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • loginas_options
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
You can take inspiration from this readme.txt

login-as-customer-or-user/loginas.php 92% from 13 tests

The main PHP file in "Login as User or Customer" ver. 3.8 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("login-as-customer-or-user.php" instead of "loginas.php")

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 plugin1,968 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP6202281,105
CSS320462834
JavaScript173229

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity29.60
▷ Minimum class complexity13.00
▷ Maximum class complexity53.00
Average method complexity4.65
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods35
▷ Static methods00.00%
▷ Public methods3291.43%
▷ Protected methods00.00%
▷ Private methods38.57%
Functions9
▷ Named functions666.67%
▷ Anonymous functions333.33%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin