84% sidebar-per-user-role

Code Review | Sidebar Per User Role

WordPress plugin Sidebar Per User Role scored 84% from 54 tests.

About plugin

  • Plugin page: sidebar-per-user-...
  • Plugin version: 0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-4.7.0
  • WordPress version: 6.3.1
  • First release: Mar 13, 2013
  • Latest release: Dec 14, 2016
  • Number of updates: 10
  • Update frequency: every 137.3 days
  • Top authors: bainternet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,790 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼2.19ms] Passed 4 tests

Server-side resources used by Sidebar Per User Role
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.79 ▼5.19
Dashboard /wp-admin3.35 ▲0.0550.43 ▼2.79
Posts /wp-admin/edit.php3.46 ▲0.1151.35 ▲5.45
Add New Post /wp-admin/post-new.php5.93 ▲0.0492.08 ▼3.38
Media Library /wp-admin/upload.php3.27 ▲0.0437.64 ▲2.59
Sidebar Per Role /wp-admin/options-general.php?page=SimplePanel3.2431.21

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Sidebar Per User Role
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4713.59 ▼0.801.66 ▼0.4940.57 ▼7.36
Dashboard /wp-admin2,207 ▲195.87 ▲0.99106.97 ▼9.7642.65 ▼5.24
Posts /wp-admin/edit.php2,093 ▲12.04 ▼0.0139.61 ▲0.7134.77 ▼1.06
Add New Post /wp-admin/post-new.php1,540 ▲523.15 ▲0.12655.53 ▼8.0260.73 ▲10.54
Media Library /wp-admin/upload.php1,392 ▲44.10 ▼0.07108.20 ▼2.2145.76 ▲2.05
Sidebar Per Role /wp-admin/options-general.php?page=SimplePanel9502.0322.8327.78

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sidebar-per-user-role/sidebar-per-user-role.php:217
    • > PHP Fatal error
      Uncaught Error: Class 'SimplePanel' not found in wp-content/plugins/sidebar-per-user-role/inc/Sidebar_Panel_Class.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 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
5 plugin tags: user, sidebar per user, per role, sidebars, role

sidebar-per-user-role/sidebar-per-user-role.php Passed 13 tests

Analyzing the main PHP file in "Sidebar Per User Role" version 0.3
52 characters long description:
This Plugin lets you display a sidebar per user role

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
There were no executable files found in this plugin368 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP357170368

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity15.00
▷ Minimum class complexity5.00
▷ Maximum class complexity25.00
Average method complexity2.27
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods33
▷ Static methods00.00%
▷ Public methods33100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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