73% roles

Code Review | Roles

WordPress plugin Roles scored 73% from 54 tests.

About plugin

  • Plugin page: roles
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.5.2
  • WordPress version: 6.3.1
  • First release: Jan 5, 2017
  • Latest release: Jan 5, 2017
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: rajeevkumarchy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active / 1,600 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by Roles
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.97 ▼4.41
Dashboard /wp-admin3.34 ▲0.0447.88 ▼0.36
Posts /wp-admin/edit.php3.39 ▲0.0450.29 ▲3.23
Add New Post /wp-admin/post-new.php5.94 ▲0.0687.08 ▼10.23
Media Library /wp-admin/upload.php3.26 ▲0.0336.48 ▲1.32
Roles & Capabilities /wp-admin/users.php?page=icreon-roles-capablities3.2732.43
/wp-admin/admin.php?page=icreon-def3.2030.79

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 53 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
icreon_wp_rc_caps
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Roles
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.67 ▼0.731.93 ▲0.1744.06 ▼2.77
Dashboard /wp-admin2,210 ▲224.85 ▼0.02109.19 ▼1.2638.63 ▼0.21
Posts /wp-admin/edit.php2,093 ▲42.05 ▲0.0639.64 ▼2.0635.66 ▼1.80
Add New Post /wp-admin/post-new.php1,517 ▼2017.78 ▼0.25654.57 ▲46.0453.53 ▼0.59
Media Library /wp-admin/upload.php1,392 ▲74.21 ▲0.01100.84 ▲0.6342.60 ▼3.96
Roles & Capabilities /wp-admin/users.php?page=icreon-roles-capablities2,9623.4487.2483.08
/wp-admin/admin.php?page=icreon-def7501.9228.3321.77

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • icreon_wp_rc_caps
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/users.php?page=icreon-roles-capablities
    • > Notice in wp-content/plugins/roles/includes/templates/head-table.tpl.php+124
    Undefined index: rename_role
    • > GET request to /wp-admin/users.php?page=icreon-roles-capablities
    • > Notice in wp-content/plugins/roles/includes/class-icreon-wp-roles-capabilities-table.php+155
    Undefined index: export
    • > GET request to /wp-admin/users.php?page=icreon-roles-capablities
    • > Notice in wp-content/plugins/roles/includes/class-icreon-wp-roles-capabilities-table.php+161
    Undefined index: import
    • > GET request to /wp-admin/admin.php?page=icreon-def
    • > Notice in wp-content/plugins/roles/includes/class-icreon-wp-roles-capabilities-table.php+26
    Undefined index: user

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 10× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/roles/js/index.php
    • > /wp-content/plugins/roles/css/index.php
    • > /wp-content/plugins/roles/includes/templates/index.php
    • > /wp-content/plugins/roles/includes/templates/table-end.tpl.php
    • > /wp-content/plugins/roles/includes/templates/foot-table.tpl.php
    • > /wp-content/plugins/roles/fonts/index.php
    • > /wp-content/plugins/roles/includes/templates/table-start.tpl.php
    • > /wp-content/plugins/roles/includes/index.php
    • > /wp-content/plugins/roles/index.php
    • > /wp-content/plugins/roles/images/index.php
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/roles/includes/templates/builtin-cap-rows.tpl.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/roles/includes/templates/user-caps-role.tpl.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/roles/includes/templates/default-role.tpl.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/roles/includes/templates/import-cap.tpl.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/roles/includes/templates/head-table.tpl.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/roles/includes/templates/delete-role.tpl.php:6
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/roles/includes/templates/other-cap-rows.tpl.php:1
    • > PHP Notice
      Undefined variable: builtin_capabilities in wp-content/plugins/roles/includes/templates/builtin-cap-rows.tpl.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/roles/includes/templates/add-role.tpl.php:6
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/roles/includes/templates/change-role-name.tpl.php:2

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
2 plugin tags: custom user rols, user rols

roles/roles.php Passed 13 tests

"Roles" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
35 characters long description:
Manage user roles and capabilities.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin12,021 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
CSS4165498,756
PHP222252511,355
JavaScript62172941,100
SVG200810

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity19.38
▷ Minimum class complexity1.00
▷ Maximum class complexity110.00
Average method complexity2.91
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods77
▷ Static methods45.19%
▷ Public methods4355.84%
▷ Protected methods00.00%
▷ Private methods3444.16%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
3 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/sprite-radio.png1.47KB0.56KB▼ 61.58%
images/checkbutton.png0.48KB0.40KB▼ 17.58%
images/adv.png1.06KB0.49KB▼ 54.23%