90% content-by-role

Code Review | Content By Role

WordPress plugin Content By Role scored90%from 54 tests.

About plugin

  • Plugin page: content-by-role
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.1
  • WordPress version: 6.3.1
  • First release: Dec 30, 2017
  • Latest release: Dec 30, 2017
  • Number of updates: 6
  • Update frequency: N/A
  • Top authors: mguay22 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /628 total downloads


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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.68ms] Passed 4 tests

Server-side resources used by Content By Role
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.19 ▼3.45
Dashboard /wp-admin3.32 ▲0.0248.39 ▼6.43
Posts /wp-admin/edit.php3.37 ▲0.0250.09 ▼2.24
Add New Post /wp-admin/post-new.php5.90 ▲0.0192.38 ▼2.58
Media Library /wp-admin/upload.php3.24 ▲0.0238.78 ▼0.50
Content By Role /wp-admin/options-general.php?page=content_by_role3.2533.88

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 22 new files
Database: 1 new table, 6 new options
New tables
New WordPress options

Browser metrics Passed 4 tests

An overview of browser requirements for Content By Role
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.35 ▼0.021.61 ▼0.2143.62 ▼1.73
Dashboard /wp-admin2,204 ▲275.63 ▲0.1188.62 ▼12.3140.55 ▼7.87
Posts /wp-admin/edit.php2,106 ▲62.01 ▼0.0138.77 ▲2.6335.03 ▼3.16
Add New Post /wp-admin/post-new.php1,533 ▲722.91 ▼0.30655.53 ▼7.6556.81 ▲4.24
Media Library /wp-admin/upload.php1,406 ▲34.11 ▼0.03109.46 ▲8.0447.50 ▲3.55
Content By Role /wp-admin/options-general.php?page=content_by_role8912.0325.6626.23

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

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

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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


Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === content-by-role === )
The official readme.txt is a good inspiration

content-by-role/content-by-role.php Passed 13 tests

The entry point to "Content By Role" version 1.0.0 is a PHP file that has certain tags in its header comment area
100 characters long description:
Allows multiple redirects to be added to a restricted page based off of the user's role on the site.

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
Success! There were no dangerous files found in this plugin457 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity2.33
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.35
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
▷ Static methods14.35%
▷ Public methods1773.91%
▷ Protected methods00.00%
▷ Private methods626.09%
▷ Named functions10100.00%
▷ Anonymous functions00.00%
▷ Global constants1100.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
No PNG files were detected