10% user-hierarchy

Code Review | User Hierarchy

WordPress plugin User Hierarchy scored10%from 54 tests.

About plugin

  • Plugin page: user-hierarchy
  • Plugin version: 0.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.5.1
  • WordPress version: 6.3.1
  • First release: Apr 1, 2013
  • Latest release: Apr 27, 2013
  • Number of updates: 12
  • Update frequency: every 2.2 days
  • Top authors: Jesper800 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /2,520 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/user-hierarchy/lib/adminmenu.php+28
    Non-static method JWUH_AdminMenu::init() should not be called statically

Server metrics [RAM: ▼1.89MB] [CPU: ▼60.05ms] Passed 4 tests

Server-side resources used by User Hierarchy
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0246.66 ▲4.80
Dashboard /wp-admin2.10 ▼1.255.97 ▼52.38
Posts /wp-admin/edit.php2.10 ▼1.305.37 ▼56.36
Add New Post /wp-admin/post-new.php2.10 ▼3.835.30 ▼99.31
Media Library /wp-admin/upload.php2.10 ▼1.175.15 ▼32.13
User Hierarchy /wp-admin/options-general.php?page=userhierarchy-access2.106.52

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

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

Browser metrics Passed 4 tests

A check of browser resources used by User Hierarchy
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.31 ▼0.252.00 ▲0.1443.44 ▼0.12
Dashboard /wp-admin2,198 ▲215.51 ▼0.0988.58 ▼6.3038.17 ▼4.15
Posts /wp-admin/edit.php2,106 ▲62.00 ▼0.0333.47 ▼8.6736.95 ▼3.18
Add New Post /wp-admin/post-new.php1,531 ▲522.93 ▲1.64662.85 ▼30.4662.92 ▲7.51
Media Library /wp-admin/upload.php1,400 ▲34.17 ▼0.01101.40 ▼14.9446.19 ▲1.28
User Hierarchy /wp-admin/options-general.php?page=userhierarchy-access2,1551.8344.0933.66

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/user-hierarchy/lib/adminmenu.php+28
    Non-static method JWUH_AdminMenu::init() should not be called statically
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=userhierarchy-access
    • > Deprecated in wp-content/plugins/user-hierarchy/lib/adminmenu.php+28
    Non-static method JWUH_AdminMenu::init() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=userhierarchy-access
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method JWUH_AdminMenu::menu() should not be called statically
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=userhierarchy-access
    • > Notice in wp-content/plugins/user-hierarchy/lib/classes/AdminMenuPage/class.Access.php+133
    Undefined index: administrator
  • 230 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=userhierarchy-access
    • > Notice in wp-content/plugins/user-hierarchy/lib/classes/AdminMenuPage/class.Access.php+133
    Trying to access array offset on value of type null
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=userhierarchy-access
    • > Notice in wp-content/plugins/user-hierarchy/lib/classes/AdminMenuPage/class.Access.php+133
    Undefined index: editor
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=userhierarchy-access
    • > Notice in wp-content/plugins/user-hierarchy/lib/classes/AdminMenuPage/class.Access.php+133
    Undefined index: author
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=userhierarchy-access
    • > Notice in wp-content/plugins/user-hierarchy/lib/classes/AdminMenuPage/class.Access.php+133
    Undefined index: contributor
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=userhierarchy-access
    • > Notice in wp-content/plugins/user-hierarchy/lib/classes/AdminMenuPage/class.Access.php+133
    Undefined index: subscriber

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
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-hierarchy/lib/admin.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/user-hierarchy/user-hierarchy.php:17
    • > PHP Fatal error
      require_once(): Failed opening required 'JWUH_LIBRARY_PATH/classes/AdminMenuPage/class.Access.php' (include_path='.:/usr/share/php') in wp-content/plugins/user-hierarchy/lib/adminmenu.php on line 12
    • > PHP Warning
      Use of undefined constant JWUH_LIBRARY_PATH - assumed 'JWUH_LIBRARY_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/user-hierarchy/lib/adminmenu.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-hierarchy/lib/roles.php:13
    • > PHP Warning
      require_once(JWUH_LIBRARY_PATH/classes/AdminMenuPage/class.Access.php): failed to open stream: No such file or directory in wp-content/plugins/user-hierarchy/lib/adminmenu.php on line 12

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)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
10 plugin tags: role, promote, users, create, roles...

user-hierarchy/user-hierarchy.php 92% from 13 tests

The primary PHP file in "User Hierarchy" version 0.1.2 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 171 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected546 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP6130257452
PO File181045
JavaScript17325
CSS14424

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.35
Average class complexity14.20
▷ Minimum class complexity1.00
▷ Maximum class complexity31.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods36
▷ Static methods1130.56%
▷ Public methods36100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
5 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/arrow-down.png1.04KB0.20KB▼ 81.14%
public/images/switch.png1.28KB0.47KB▼ 62.95%
public/images/helparrow-q2-cc.png1.25KB0.60KB▼ 52.26%
public/images/helparrow-q4-cc.png1.27KB0.62KB▼ 51.30%
public/images/helparrow-q3-c.png1.27KB0.63KB▼ 50.39%