84% wp-user-admin

Code Review | WP User Admin

WordPress plugin WP User Admin scored84%from 54 tests.

About plugin

  • Plugin page: wp-user-admin
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-6.0.1
  • WordPress version: 6.3.1
  • First release: Feb 5, 2019
  • Latest release: Jul 21, 2022
  • Number of updates: 9
  • Update frequency: every 140.2 days
  • Top authors: bitofwp (66.67%)wprepublic (44.44%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /752 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.16MB] [CPU: ▼1.28ms] Passed 4 tests

A check of server-side resources used by WP User Admin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1341.93 ▼0.59
Dashboard /wp-admin3.47 ▲0.1749.53 ▼1.73
Posts /wp-admin/edit.php3.59 ▲0.2352.26 ▼1.57
Add New Post /wp-admin/post-new.php6.07 ▲0.1893.94 ▼1.23
Media Library /wp-admin/upload.php3.40 ▲0.1636.81 ▲0.17

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 34 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by WP User Admin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7013.60 ▼0.771.77 ▲0.0543.05 ▲4.69
Dashboard /wp-admin2,219 ▲315.82 ▼0.0696.15 ▼3.4938.92 ▼1.68
Posts /wp-admin/edit.php2,108 ▲161.98 ▼0.0341.37 ▼0.8234.39 ▼2.27
Add New Post /wp-admin/post-new.php1,546 ▲2723.08 ▼0.13695.79 ▲95.9351.71 ▼4.61
Media Library /wp-admin/upload.php1,404 ▲164.21 ▲0.0594.17 ▼3.0141.24 ▼0.25

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 15× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Trait 'BitofWP\\WPUserAdmin\\Singleton' not found in wp-content/plugins/wp-user-admin/inc/Admin/Pages/Wrapper.php on line 21
    • > PHP Fatal error
      Trait 'BitofWP\\WPUserAdmin\\Singleton' not found in wp-content/plugins/wp-user-admin/inc/Admin/Form/Schedule.php on line 21
    • > PHP Fatal error
      Trait 'BitofWP\\WPUserAdmin\\Singleton' not found in wp-content/plugins/wp-user-admin/inc/Main.php on line 20
    • > PHP Fatal error
      Uncaught Error: Class 'BitofWP\\WPUserAdmin\\ObjectType\\AbstractObject' not found in wp-content/plugins/wp-user-admin/inc/ObjectType/Activity.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'BitofWP\\WPUserAdmin\\Admin\\Table\\AbstractList' not found in wp-content/plugins/wp-user-admin/inc/Admin/Table/JobList.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'BitofWP\\WPUserAdmin\\Admin\\Table\\AbstractList' not found in wp-content/plugins/wp-user-admin/inc/Admin/Table/ActivityList.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-user-admin/wp-user-admin.php:67
    • > PHP Fatal error
      Trait 'BitofWP\\WPUserAdmin\\Singleton' not found in wp-content/plugins/wp-user-admin/inc/Admin/Pages/Schedule.php on line 21
    • > PHP Fatal error
      Trait 'BitofWP\\WPUserAdmin\\Singleton' not found in wp-content/plugins/wp-user-admin/inc/Admin/Pages/Activity.php on line 19
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-user-admin/inc/Admin/Table/AbstractList.php on line 14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 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: user role changer, change user role, user role scheduler, user role editor, user admin tools

wp-user-admin/wp-user-admin.php 92% from 13 tests

"WP User Admin" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Domain Path: The domain path folder does not exist ("/languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin6,201 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript88385284,433
PHP233358661,225
CSS2820543

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity5.67
▷ Minimum class complexity1.00
▷ Maximum class complexity20.00
Average method complexity2.17
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces6
Interfaces1
Traits1
Classes19
▷ Abstract classes210.53%
▷ Concrete classes1789.47%
▷ Final classes00.00%
Methods88
▷ Static methods2326.14%
▷ Public methods8192.05%
▷ Protected methods77.95%
▷ Private methods00.00%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.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