94% role-quick-changer

Code Review | Role Quick Changer

WordPress plugin Role Quick Changer scored 94% from 54 tests.

About plugin

  • Plugin page: role-quick-changer
  • Plugin version: 0.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.0-4.4.2
  • WordPress version: 5.8.1
  • First release: Sep 25, 2014
  • Latest release: Mar 9, 2016
  • Number of updates: 21
  • Update frequency: every 25.4 days
  • Top authors: joelworsham (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

40+ active / 2,202 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

A check of server-side resources used by Role Quick Changer
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.0328.98 ▲5.17
Dashboard /wp-admin3.09 ▲0.0235.47 ▼8.90
Posts /wp-admin/edit.php3.14 ▲0.0332.92 ▼7.77
Add New Post /wp-admin/post-new.php5.45 ▲0.0176.03 ▼717.98
Media Library /wp-admin/upload.php3.03 ▲0.0322.87 ▼3.80

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Role Quick Changer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,932 ▲30615.96 ▼0.028.90 ▲3.3378.45 ▲3.37
Dashboard /wp-admin2,981 ▲856.05 ▼0.14116.11 ▼13.94171.30 ▼3.88
Posts /wp-admin/edit.php2,787 ▲443.25 ▲0.0264.93 ▲4.26141.09 ▲4.79
Add New Post /wp-admin/post-new.php2,397 ▼1,29616.07 ▲1.03389.34 ▼41.97159.07 ▲1.09
Media Library /wp-admin/upload.php1,799 ▲475.56 ▲0.09151.73 ▲5.69189.03 ▲9.16

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/role-quick-changer/role-quick-changer.php:64

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
8 plugin tags: user, quickly, switch, switcher, change...

role-quick-changer/role-quick-changer.php Passed 13 tests

The principal PHP file in "Role Quick Changer" v. 0.2.1 is loaded by WordPress automatically on each request
94 characters long description:
Allows the admin to easily and seamlessly switch user role privileges without ever logging out

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin138 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP150117121
JavaScript251517

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity2.88
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected