93% user-drop-down-roles-in-registration

Code Review | Adding drop down roles in registration

WordPress plugin Adding drop down roles in registration scored 93% from 54 tests.

About plugin

  • Plugin page: user-drop-down-ro...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.3
  • WordPress version: 5.8.1
  • First release: Aug 1, 2015
  • Latest release: Oct 30, 2016
  • Number of updates: 17
  • Update frequency: every 27.1 days
  • Top authors: madiriaashish (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

40+ active / 2,085 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼144.09ms] Passed 4 tests

A check of server-side resources used by Adding drop down roles in registration
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1332.91 ▲12.05
Dashboard /wp-admin3.08 ▲0.0244.55 ▼5.81
Posts /wp-admin/edit.php3.13 ▲0.0246.56 ▲0.63
Add New Post /wp-admin/post-new.php5.43 ▲0.0087.32 ▼564.00
Media Library /wp-admin/upload.php3.02 ▲0.0232.38 ▼7.19

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Adding drop down roles in registration
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,723 ▲12716.23 ▲0.618.80 ▼2.6948.84 ▼3.33
Dashboard /wp-admin2,990 ▲535.84 ▼0.10142.23 ▼13.84111.27 ▼0.24
Posts /wp-admin/edit.php2,759 ▲202.72 ▲0.0174.65 ▲7.7287.59 ▲5.19
Add New Post /wp-admin/post-new.php1,617 ▼2,07918.86 ▼2.03407.16 ▼113.00108.36 ▲6.77
Media Library /wp-admin/upload.php1,827 ▲205.05 ▼0.03156.38 ▼0.27113.60 ▼4.19

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 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 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× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-drop-down-roles-in-registration/new_usersroles.php:105

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 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed: The official readme.txt might help

user-drop-down-roles-in-registration/new_usersroles.php 92% from 13 tests

The entry point to "Adding drop down roles in registration" version 1.1 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("user-drop-down-roles-in-registration.php" instead of "new_usersroles.php")

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
No dangerous file extensions were detected91 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1551091

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.20
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%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin