74% custom-role-creator

Code Review | Custom Role Creator (CRC)

WordPress plugin Custom Role Creator (CRC) scored 74% from 54 tests.

About plugin

  • Plugin page: custom-role-creator
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2
  • WordPress version: 6.3.1
  • First release: May 5, 2021
  • Latest release: May 5, 2023
  • Number of updates: 18
  • Update frequency: every 40.6 days
  • Top authors: ratulhasan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 771 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

This is a short check of server-side resources used by Custom Role Creator (CRC)
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.22 ▼2.68
Dashboard /wp-admin3.34 ▲0.0446.38 ▼3.27
Posts /wp-admin/edit.php3.39 ▲0.0348.99 ▲8.02
Add New Post /wp-admin/post-new.php5.94 ▲0.0596.03 ▲11.14
Media Library /wp-admin/upload.php3.26 ▲0.0333.99 ▼0.60
Custom Role Creator /wp-admin/users.php?page=custom-role-creator3.3232.94
Custom Role Creator /wp-admin/options-general.php?page=crc-settings3.2829.97

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 27 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
_custom_role_creator_version
db_upgraded
can_compress_scripts
_custom_role_creator_installed
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Custom Role Creator (CRC)
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲9813.14 ▼1.234.70 ▲2.8738.63 ▼6.00
Dashboard /wp-admin2,211 ▲255.83 ▲0.8598.16 ▼19.9339.69 ▼4.23
Posts /wp-admin/edit.php2,097 ▲82.03 ▼0.0039.85 ▲6.3834.26 ▲1.70
Add New Post /wp-admin/post-new.php1,548 ▲1918.12 ▼5.09592.52 ▼62.5553.02 ▲1.49
Media Library /wp-admin/upload.php1,390 ▼14.17 ▼0.0296.96 ▼15.8643.93 ▼11.02
Custom Role Creator /wp-admin/users.php?page=custom-role-creator1,1991.8928.3554.35
Custom Role Creator /wp-admin/options-general.php?page=crc-settings9391.9925.9528.29

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/custom-role-creator/vendor/composer/ClassLoader.php+571
    include(wp-content/plugins/custom-role-creator/vendor/composer/../appsero/client/src/License.php): failed to open stream: No such file or directory
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 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
Please take a closer look at the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/custom-role-creator/vendor/appsero/client/vendor/tareq1988/wp-php-cs-fixer/loader.php' (include_path='.:/usr/share/php') in wp-content/plugins/custom-role-creator/vendor/appsero/client/.php-cs-fixer.dist.php on line 3
    • > PHP Warning
      require_once(wp-content/plugins/custom-role-creator/vendor/appsero/client/vendor/tareq1988/wp-php-cs-fixer/loader.php): failed to open stream: No such file or directory in wp-content/plugins/custom-role-creator/vendor/appsero/client/.php-cs-fixer.dist.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (All Roles), #2 (Add new role), #3 (Edit role), #4 (Assign capabilities), #5 (Currently capable of), #6 (Add capabilities to User), #7 (Reset Roles)
Please take inspiration from this readme.txt

custom-role-creator/custom-role-creator.php Passed 13 tests

Analyzing the main PHP file in "Custom Role Creator (CRC)" version 1.1.1
90 characters long description:
Custom Role Creator plugin allows you to add or change user roles and capabilities easily.

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 detected4,461 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
PHP256541,2783,155
CSS222490
Markdown3950302
JSON300132
PO File14559126
XML2821113
JavaScript223111
YAML16032

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity31.00
▷ Minimum class complexity1.00
▷ Maximum class complexity86.00
Average method complexity3.52
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods156
▷ Static methods2113.46%
▷ Public methods11976.28%
▷ Protected methods74.49%
▷ Private methods3019.23%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants7
▷ Global constants685.71%
▷ Class constants114.29%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin