84% custom-roles-for-author

Code Review | Custom roles for author

WordPress plugin Custom roles for author scored84%from 54 tests.

About plugin

  • Plugin page: custom-roles-for-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Mar 11, 2012
  • Latest release: Mar 12, 2012
  • Number of updates: 12
  • Update frequency: every 0.1 days
  • Top authors: david.binda (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /4,114 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
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Custom roles for author
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0236.50 ▼4.73
Dashboard /wp-admin3.33 ▲0.0347.85 ▼6.43
Posts /wp-admin/edit.php3.38 ▲0.0350.05 ▲0.54
Add New Post /wp-admin/post-new.php5.91 ▲0.0397.24 ▲5.41
Media Library /wp-admin/upload.php3.25 ▲0.0237.72 ▼3.70
Custom roles 4 author /wp-admin/users.php?page=custom-roles-for-author3.2233.60

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Custom roles for author
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.24 ▼0.301.80 ▲0.2841.86 ▼1.47
Dashboard /wp-admin2,199 ▲255.61 ▲0.0289.23 ▼4.4841.05 ▼1.92
Posts /wp-admin/edit.php2,107 ▲72.02 ▲0.0140.87 ▼2.0735.66 ▼3.40
Add New Post /wp-admin/post-new.php1,544 ▲1618.11 ▼5.02616.34 ▲14.9678.80 ▲14.60
Media Library /wp-admin/upload.php1,398 ▼24.22 ▲0.0299.91 ▼7.0343.77 ▼2.58
Custom roles 4 author /wp-admin/users.php?page=custom-roles-for-author8352.0324.3729.87

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-roles-for-author/custom-roles-for-author.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Requires at least: The plugin version is formatted incorrectly
You can take inspiration from this readme.txt

custom-roles-for-author/custom-roles-for-author.php Passed 13 tests

"Custom roles for author" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
74 characters long description:
Allows to set users with custom role as post/page/custom post type author.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected123 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2299123

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.55
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

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin