79% leira-roles

Code Review | Roles & Capabilities

WordPress plugin Roles & Capabilities scored79%from 54 tests.

About plugin

  • Plugin page: leira-roles
  • Plugin version: 1.1.8.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-5.9
  • WordPress version: 6.3.1
  • First release: Aug 28, 2019
  • Latest release: May 5, 2022
  • Number of updates: 34
  • Update frequency: every 29.7 days
  • Top authors: arielhr1987 (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active /14,711 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.27MB] [CPU: ▲2.65ms] Passed 4 tests

An overview of server-side resources used by Roles & Capabilities
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0638.78 ▲0.99
Dashboard /wp-admin3.69 ▲0.3946.17 ▼0.91
Posts /wp-admin/edit.php3.74 ▲0.3946.29 ▲5.76
Add New Post /wp-admin/post-new.php6.21 ▲0.3392.11 ▲5.39
Media Library /wp-admin/upload.php3.55 ▲0.3338.66 ▲5.11
Capabilities /wp-admin/users.php?page=leira-roles-capabilities3.7033.60
Roles /wp-admin/users.php?page=leira-roles3.7333.89

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Roles & Capabilities
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲6413.26 ▼1.004.57 ▲3.0440.38 ▲0.15
Dashboard /wp-admin2,219 ▲274.89 ▼0.0498.64 ▼21.6939.59 ▼5.32
Posts /wp-admin/edit.php2,099 ▲102.00 ▼0.0239.35 ▲5.1935.17 ▲2.65
Add New Post /wp-admin/post-new.php1,526 ▼1623.45 ▲5.12635.99 ▼48.5760.63 ▲8.38
Media Library /wp-admin/upload.php1,395 ▲44.29 ▲0.0799.70 ▼1.5143.39 ▲1.10
Capabilities /wp-admin/users.php?page=leira-roles-capabilities1,7721.7625.2634.24
Roles /wp-admin/users.php?page=leira-roles1,8162.3539.7232.64

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/leira-roles/public/partials/leira-roles-public-display.php
    • > /wp-content/plugins/leira-roles/admin/partials/leira-roles-admin-display.php
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/leira-roles/admin/class-leira-roles-list-table.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/leira-roles/admin/class-leira-roles-capabilities-list-table.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/leira-roles/admin/class-leira-roles-list-table.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/leira-roles/admin/class-leira-roles-capabilities-list-table.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/leira-roles/admin/class-leira-roles-capabilities-list-table.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/leira-roles/admin/class-leira-roles-list-table.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
9 plugin tags: capabilities, role, member, admin, user...

leira-roles/leira-roles.php Passed 13 tests

The main PHP script in "Roles & Capabilities" version 1.1.8.0 is automatically included on every request by WordPress
139 characters long description:
Roles & Capabilities is a plugin that will allows you to manage user roles and capabilities and also assign capabilities to specific users.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin2,914 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP175481,6421,989
JavaScript9126366442
PO File1136181290
Sass1402116
CSS23577

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.37
Average class complexity22.17
▷ Minimum class complexity1.00
▷ Maximum class complexity84.00
Average method complexity2.72
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods126
▷ Static methods32.38%
▷ Public methods9575.40%
▷ Protected methods2620.63%
▷ Private methods53.97%
Functions8
▷ Named functions337.50%
▷ Anonymous functions562.50%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

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