84% test-user-role

Code Review | Test User Role

WordPress plugin Test User Role scored84%from 54 tests.

About plugin

  • Plugin page: test-user-role
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.0.1
  • WordPress version: 6.3.1
  • First release: Dec 9, 2014
  • Latest release: Dec 9, 2014
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: mitchoyoshitaka (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

80+ active /2,296 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: ▼2.53ms] Passed 4 tests

Server-side resources used by Test User Role
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.22 ▼0.45
Dashboard /wp-admin3.33 ▲0.0344.41 ▼4.32
Posts /wp-admin/edit.php3.38 ▲0.0246.82 ▼0.86
Add New Post /wp-admin/post-new.php5.91 ▲0.0289.69 ▼3.20
Media Library /wp-admin/upload.php3.25 ▲0.0233.16 ▼1.75

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Test User Role
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,864 ▲11813.21 ▼1.431.69 ▲0.0339.72 ▼3.22
Dashboard /wp-admin2,238 ▲475.80 ▼0.1096.73 ▼10.3637.72 ▼8.69
Posts /wp-admin/edit.php2,121 ▲322.01 ▼0.0041.15 ▲6.0634.47 ▲2.37
Add New Post /wp-admin/post-new.php1,564 ▲3123.27 ▼0.06648.57 ▼13.6961.60 ▲14.23
Media Library /wp-admin/upload.php1,423 ▲354.24 ▲0.0194.02 ▼17.8741.60 ▼7.35

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/test-user-role/test-user-role.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 97% 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
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (Test User Role menu) image required
Please take inspiration from this readme.txt

test-user-role/test-user-role.php Passed 13 tests

Analyzing the main PHP file in "Test User Role" version 1.0
93 characters long description:
Quickly test other user roles from a super admin account, to see what other users experience.

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
There were no executable files found in this plugin70 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1221670

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
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
1 PNG file occupies 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png37.41KB9.66KB▼ 74.17%