94% setup-of-roles

Code Review | Setup of roles

WordPress plugin Setup of roles scored 94% from 54 tests.

About plugin

  • Plugin page: setup-of-roles
  • Plugin version: 0.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.0.1
  • WordPress version: 5.8.1
  • First release: Dec 16, 2014
  • Latest release: Dec 16, 2014
  • Number of updates: 4
  • Update frequency: every 1.3 days
  • Top authors: Eugene Yudin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 650 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.00MB] [CPU: ▼139.21ms] Passed 4 tests

Server-side resources used by Setup of roles
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1236.22 ▲12.80
Dashboard /wp-admin3.06 ▲0.0144.41 ▲3.12
Posts /wp-admin/edit.php3.11 ▲0.0147.29 ▲1.61
Add New Post /wp-admin/post-new.php5.42 ▼0.0291.26 ▼568.16
Media Library /wp-admin/upload.php3.00 ▲0.0040.37 ▲6.61
Setup of roles /wp-admin/options-general.php?page=setup-of-roles/setup_of_roles_page.php3.0431.69

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Setup of roles
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,686 ▲9015.86 ▲0.359.39 ▼0.5149.86 ▼1.89
Dashboard /wp-admin2,980 ▲466.09 ▲0.10145.06 ▼10.07111.35 ▼3.68
Posts /wp-admin/edit.php2,746 ▲72.70 ▲0.0171.13 ▼2.2583.71 ▼11.92
Add New Post /wp-admin/post-new.php1,688 ▲518.72 ▲0.02401.04 ▼18.98110.77 ▲2.91
Media Library /wp-admin/upload.php1,817 ▲105.01 ▲0.02171.80 ▲10.51118.21 ▼5.60
Setup of roles /wp-admin/options-general.php?page=setup-of-roles/setup_of_roles_page.php3,7192.0968.3977.83

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 25× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Trying to get property 'role_objects' of non-object in wp-content/plugins/setup-of-roles/setup_of_roles_page.php on line 32
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/setup-of-roles/setup_of_roles_page.php on line 32
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/setup-of-roles/setup_of_roles_page.php on line 18
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/setup-of-roles/setup_of_roles_page.php on line 32
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/setup-of-roles/setup_of_roles_page.php on line 32
    • > PHP Notice
      Trying to get property 'role_objects' of non-object in wp-content/plugins/setup-of-roles/setup_of_roles_page.php on line 32
    • > PHP Notice
      Trying to get property 'role_objects' of non-object in wp-content/plugins/setup-of-roles/setup_of_roles_page.php on line 32
    • > PHP Notice
      Trying to get property 'role_objects' of non-object in wp-content/plugins/setup-of-roles/setup_of_roles_page.php on line 32
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/setup-of-roles/setup_of_roles_page.php on line 32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/setup-of-roles/setup_of_roles_page.php:87

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (screenshot-1.png "Setup of roles" WordPress plugin) image missing
You can take inspiration from this readme.txt

setup-of-roles/setup_of_roles.php 92% from 13 tests

The main PHP file in "Setup of roles" ver. 0.0.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("setup-of-roles.php" instead of "setup_of_roles.php")

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
No dangerous file extensions were detected205 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP21118126
PO File1131446
CSS18033

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.05MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png54.44KB15.38KB▼ 71.75%