90% email-on-changing-user-role

Code Review | Email on Changing User Role

WordPress plugin Email on Changing User Role scored90%from 54 tests.

About plugin

  • Plugin page: email-on-changing...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-4.5.3
  • WordPress version: 6.3.1
  • First release: Aug 22, 2016
  • Latest release: Aug 22, 2016
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: hussainarsh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,184 total downloads

Benchmarks

Plugin footprint 83% from 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.00MB] [CPU: ▼1.40ms] Passed 4 tests

Analyzing server-side resources used by Email on Changing User Role
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.98 ▼1.38
Dashboard /wp-admin3.31 ▲0.0145.93 ▼4.22
Posts /wp-admin/edit.php3.36 ▲0.0046.73 ▼0.08
Add New Post /wp-admin/post-new.php5.89 ▲0.00100.72 ▲1.17
Media Library /wp-admin/upload.php3.23 ▲0.0036.76 ▲0.09

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Email on Changing User Role
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲10614.41 ▲0.212.10 ▼0.1143.54 ▼1.93
Dashboard /wp-admin2,222 ▲344.85 ▼0.96110.37 ▼5.8742.95 ▼0.40
Posts /wp-admin/edit.php2,102 ▲131.99 ▼0.0036.09 ▲0.6534.23 ▲2.70
Add New Post /wp-admin/post-new.php1,527 ▼817.68 ▼5.52655.09 ▲9.3053.17 ▼2.87
Media Library /wp-admin/upload.php1,404 ▲224.24 ▲0.0397.37 ▲0.8142.88 ▲1.37

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: user role, send email on changing user role, change user role, notification on changing user role, send email notification on changing user role

email-on-changing-user-role/email-on-changing-user-role.php Passed 13 tests

The main PHP script in "Email on Changing User Role" version 1.0.0 is automatically included on every request by WordPress
93 characters long description:
This plugin is used to send email notification to those users whose role is changed by admin.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin118 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP22715118

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Constants2
▷ Global constants2100.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
No PNG images were found in this plugin