74% role-includer

Code Review | Role Includer

WordPress plugin Role Includer scored74%from 54 tests.

About plugin

  • Plugin page: role-includer
  • Plugin version: 1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.2.2
  • WordPress version: 6.3.1
  • First release: Feb 12, 2015
  • Latest release: Jul 6, 2023
  • Number of updates: 61
  • Update frequency: every 50.3 days
  • Top authors: JustinTicktock (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /3,918 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.56MB] [CPU: ▲6.42ms] Passed 4 tests

Server-side resources used by Role Includer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.04 ▲0.5839.44 ▲3.23
Dashboard /wp-admin3.90 ▲0.6055.01 ▲7.97
Posts /wp-admin/edit.php3.95 ▲0.6050.45 ▲7.36
Add New Post /wp-admin/post-new.php6.42 ▲0.53101.46 ▲14.83
Media Library /wp-admin/upload.php3.76 ▲0.5340.77 ▲7.10
Role Includer /wp-admin/users.php?page=role-includer-settings3.8137.95

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Role Includer
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.72 ▲0.161.54 ▼0.1038.09 ▼2.23
Dashboard /wp-admin2,202 ▲255.63 ▲0.0390.14 ▲2.9341.70 ▲1.25
Posts /wp-admin/edit.php2,104 ▲11.96 ▼0.0241.81 ▲0.6935.63 ▼0.35
Add New Post /wp-admin/post-new.php1,529 ▲122.92 ▼0.19599.38 ▼92.9151.02 ▼9.90
Media Library /wp-admin/upload.php1,404 ▲74.30 ▲0.1296.74 ▼5.2444.75 ▼0.28
Role Includer /wp-admin/users.php?page=role-includer-settings7922.0323.6228.96

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
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'role-includer' not found
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • 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 everything seems fine, this is not an exhaustive test

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
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/role-includer/includes/class-tgm-plugin-activation.php:1910

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === role-includer === )
The official readme.txt is a good inspiration

role-includer/role-includer.php 92% from 13 tests

The principal PHP file in "Role Includer" v. 1.6 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Domain Path: The domain path is invalid: folder "/languages/" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected2,475 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP78091,8762,475

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity31.38
▷ Minimum class complexity1.00
▷ Maximum class complexity178.00
Average method complexity3.80
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods141
▷ Static methods128.51%
▷ Public methods11984.40%
▷ Protected methods2014.18%
▷ Private methods21.42%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants666.67%
▷ Class constants333.33%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin