89% restrict-role-login

Code Review | Restrict Role Login

WordPress plugin Restrict Role Login scored89%from 54 tests.

About plugin

  • Plugin page: restrict-role-login
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jun 14, 2016
  • Latest release: Jun 14, 2016
  • Number of updates: 4
  • Update frequency: every 0.8 days
  • Top authors: konnektiv (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /947 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.76ms] Passed 4 tests

An overview of server-side resources used by Restrict Role Login
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0336.51 ▼4.92
Dashboard /wp-admin3.34 ▲0.0444.60 ▼8.44
Posts /wp-admin/edit.php3.39 ▲0.0345.57 ▼6.68
Add New Post /wp-admin/post-new.php5.92 ▲0.0395.08 ▲6.76
Media Library /wp-admin/upload.php3.26 ▲0.0336.22 ▲1.02
Restrict role login /wp-admin/users.php?page=rrl-setting-admin3.3031.42

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Restrict Role Login
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6914.48 ▲0.121.64 ▼0.2542.81 ▼1.67
Dashboard /wp-admin2,210 ▲364.86 ▼0.0199.54 ▼6.7738.22 ▼9.73
Posts /wp-admin/edit.php2,096 ▲72.01 ▼0.0341.49 ▲3.9236.10 ▼0.95
Add New Post /wp-admin/post-new.php1,548 ▲1523.28 ▲0.14646.37 ▼26.8256.17 ▼7.97
Media Library /wp-admin/upload.php1,392 ▲44.20 ▲0.0394.82 ▼9.3841.05 ▼5.61
Restrict role login /wp-admin/users.php?page=rrl-setting-admin8112.0624.5130.27

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Requires at least: Invalid plugin version format
  • Tags: There are too many tags (11 tag instead of maximum 10)
The official readme.txt might help

restrict-role-login/restrict-role-login.php Passed 13 tests

Analyzing the main PHP file in "Restrict Role Login" version 1.0.0
65 characters long description:
Allows administrators to restrict user login based on user roles.

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
Good job! No executable or dangerous file extensions detected147 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP12877115
Markdown119022
JSON10010

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity1.36
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods18.33%
▷ Public methods866.67%
▷ Protected methods00.00%
▷ Private methods433.33%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin