90% restrict-page-by-role

Code Review | Restrict Page By Role

WordPress plugin Restrict Page By Role scored90%from 54 tests.

About plugin

  • Plugin page: restrict-page-by-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.5.3
  • WordPress version: 6.3.1
  • First release: Jul 29, 2016
  • Latest release: Jul 29, 2016
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: leobaiano (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /2,650 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.05MB] [CPU: ▼9.38ms] Passed 4 tests

This is a short check of server-side resources used by Restrict Page By Role
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0536.20 ▼7.54
Dashboard /wp-admin3.36 ▲0.0546.00 ▼3.00
Posts /wp-admin/edit.php3.41 ▲0.0545.67 ▼3.18
Add New Post /wp-admin/post-new.php5.96 ▲0.0778.46 ▼23.80
Media Library /wp-admin/upload.php3.28 ▲0.0534.37 ▲2.11

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Restrict Page By Role
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲3514.39 ▲0.111.66 ▲0.1044.12 ▲3.12
Dashboard /wp-admin2,196 ▲195.56 ▼0.0185.10 ▼3.9737.37 ▼6.06
Posts /wp-admin/edit.php2,110 ▲102.02 ▲0.0539.87 ▼1.0536.18 ▼0.94
Add New Post /wp-admin/post-new.php1,544 ▲1818.29 ▼4.81646.97 ▼38.8670.66 ▲11.75
Media Library /wp-admin/upload.php1,404 ▲44.26 ▲0.0597.39 ▲2.9445.03 ▼0.62

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

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)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: restricted access, block page by user group, private page, restricted page

restrict-page-by-role/restrict-page-by-role.php 92% from 13 tests

"Restrict Page By Role" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin213 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP342137181
JavaScript12015
Markdown16014
CSS1003

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity11.50
▷ Minimum class complexity1.00
▷ Maximum class complexity22.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods18.33%
▷ Public methods1083.33%
▷ Protected methods00.00%
▷ Private methods216.67%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin