94% go-roles

Code Review | Gigaom Roles

WordPress plugin Gigaom Roles scored 94% from 54 tests.

About plugin

  • Plugin page: go-roles
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-3.8.1
  • WordPress version: 5.8.1
  • First release: Mar 12, 2014
  • Latest release: Mar 12, 2014
  • Number of updates: 2
  • Update frequency: every 9.0 days
  • Top authors: zbtirrell (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 579 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Gigaom Roles
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.0234.12 ▲1.97
Dashboard /wp-admin3.08 ▲0.0248.41 ▲5.12
Posts /wp-admin/edit.php3.13 ▲0.0145.03 ▼6.43
Add New Post /wp-admin/post-new.php5.43 ▼0.0090.28 ▼555.56
Media Library /wp-admin/upload.php3.02 ▲0.0231.03 ▼0.82

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Gigaom Roles: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲4216.14 ▲0.128.24 ▼2.1450.51 ▲6.37
Dashboard /wp-admin2,973 ▲395.89 ▼0.03133.35 ▼8.22115.26 ▲13.74
Posts /wp-admin/edit.php2,736 ▼32.69 ▼0.0169.95 ▲6.8384.87 ▼9.69
Add New Post /wp-admin/post-new.php1,872 ▲26819.14 ▲0.31369.68 ▼1.22116.33 ▲3.49
Media Library /wp-admin/upload.php1,807 ▲35.03 ▼0.09143.37 ▼10.20129.18 ▲7.26

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's 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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/go-roles/components/class-go-roles.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
2 plugin tags: widgets, admin

go-roles/go-roles.php Passed 13 tests

The main PHP file in "Gigaom Roles" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
66 characters long description:
Allow filterable definition of custom roles and their capabilities

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin77 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2233177

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity5.33
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods266.67%
▷ Protected methods00.00%
▷ Private methods133.33%
Functions1
▷ Named functions1100.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
No PNG images were found in this plugin