10% user-role-widget-areas

Code Review | User Role Widget Areas

WordPress plugin User Role Widget Areas scored10%from 54 tests.

About plugin

  • Plugin page: user-role-widget-...
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.3.1
  • WordPress version: 6.3.1
  • First release: Mar 5, 2015
  • Latest release: Oct 24, 2015
  • Number of updates: 35
  • Update frequency: every 6.9 days
  • Top authors: Rob Smelik (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

30+ active /4,180 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/user-role-widget-areas/user-role-widget-areas.php+262
    Declaration of urwa_widget::widget() should be compatible with WP_Widget::widget($args, $instance)

Server metrics [RAM: ▼1.96MB] [CPU: ▼53.00ms] Passed 4 tests

Server-side resources used by User Role Widget Areas
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.18 ▼40.58
Dashboard /wp-admin2.05 ▼1.265.15 ▼44.01
Posts /wp-admin/edit.php2.05 ▼1.315.03 ▼42.24
Add New Post /wp-admin/post-new.php2.05 ▼3.845.91 ▼85.15
Media Library /wp-admin/upload.php2.05 ▼1.185.21 ▼28.64
URWA Documents /wp-admin/options-general.php?page=urwa-documentation2.055.48

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

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

Browser metrics Passed 4 tests

Checking browser requirements for User Role Widget Areas
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.29 ▼0.082.02 ▼0.0243.35 ▼3.35
Dashboard /wp-admin2,196 ▲195.62 ▼0.03100.90 ▲13.4745.50 ▼0.33
Posts /wp-admin/edit.php2,104 ▲42.01 ▲0.0134.34 ▼3.6535.63 ▼3.02
Add New Post /wp-admin/post-new.php1,554 ▲1518.58 ▼6.51652.42 ▲44.0068.77 ▼8.85
Media Library /wp-admin/upload.php1,404 ▲44.23 ▼0.0098.43 ▼8.7041.65 ▼1.96
URWA Documents /wp-admin/options-general.php?page=urwa-documentation9551.9825.0650.95

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/user-role-widget-areas/user-role-widget-areas.php+262
    Declaration of urwa_widget::widget() should be compatible with WP_Widget::widget($args, $instance)
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_urwa_widget_logged_in
    • widget_theysaidso_widget
    • widget_urwa_widget
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=urwa-documentation
    • > Warning in wp-content/plugins/user-role-widget-areas/user-role-widget-areas.php+262
    Declaration of urwa_widget::widget() should be compatible with WP_Widget::widget($args, $instance)
    • > GET request to /wp-admin/options-general.php?page=urwa-documentation
    • > Warning in wp-content/plugins/user-role-widget-areas/user-role-widget-areas.php+323
    Declaration of urwa_widget_logged_in::widget() should be compatible with WP_Widget::widget($args, $instance)

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 fix the following items
  • 6× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/user-role-widget-areas/includes/documentation/tab-2-additional-usage.php
    • > /wp-content/plugins/user-role-widget-areas/includes/documentation/tab-4-changelog.php
    • > /wp-content/plugins/user-role-widget-areas/includes/documentation/intro.php
    • > /wp-content/plugins/user-role-widget-areas/user-role-widget-areas.php
    • > /wp-content/plugins/user-role-widget-areas/includes/documentation/tab-5-support.php
    • > /wp-content/plugins/user-role-widget-areas/includes/documentation/tab-3-advanced-styling.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/user-role-widget-areas/includes/documentation/tabs.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/user-role-widget-areas/includes/documentation/tab-1-tutorial.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Tags: You are using too many tags: 16 tag instead of maximum 10
Please take inspiration from this readme.txt

user-role-widget-areas/user-role-widget-areas.php Passed 13 tests

The main PHP file in "User Role Widget Areas" ver. 1.4 adds more information about the plugin and also serves as the entry point for this plugin
101 characters long description:
Selectively display widgets to logged in users based on standard WordPress user roles or user status.

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
No dangerous file extensions were detected368 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP1010860368

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity7.50
▷ Minimum class complexity4.00
▷ Maximum class complexity11.00
Average method complexity4.25
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected