84% lh-assign-role-on-logon

Code Review | LH Assign Role On Logon

WordPress plugin LH Assign Role On Logon scored84%from 54 tests.

About plugin

  • Plugin page: lh-assign-role-on...
  • Plugin version: 1.04
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.4
  • WordPress version: 6.3.1
  • First release: Dec 19, 2015
  • Latest release: Jun 26, 2016
  • Number of updates: 6
  • Update frequency: every 31.8 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /733 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

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

An overview of server-side resources used by LH Assign Role On Logon
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.03 ▲1.12
Dashboard /wp-admin3.31 ▲0.0148.86 ▲2.98
Posts /wp-admin/edit.php3.37 ▲0.0143.63 ▲1.08
Add New Post /wp-admin/post-new.php5.90 ▲0.0183.29 ▼1.75
Media Library /wp-admin/upload.php3.24 ▲0.0135.46 ▲0.65

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for LH Assign Role On Logon
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▲0.011.86 ▼0.0445.29 ▼2.67
Dashboard /wp-admin2,198 ▲285.62 ▼0.0593.98 ▼8.3041.82 ▲0.26
Posts /wp-admin/edit.php2,100 ▼02.01 ▼0.0036.26 ▲0.8330.56 ▼8.76
Add New Post /wp-admin/post-new.php1,528 ▲223.36 ▼0.23682.71 ▼5.1755.87 ▼1.72
Media Library /wp-admin/upload.php1,403 ▲34.26 ▼0.0296.71 ▼13.4242.42 ▼3.43

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
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 get_option() in wp-content/plugins/lh-assign-role-on-logon/lh-assign-role-on-login.php:230

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: multiuser, buddypress, login, roles, multisite...

lh-assign-role-on-logon/lh-assign-role-on-login.php 92% from 13 tests

"LH Assign Role On Logon" version 1.04's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("lh-assign-role-on-logon.php" instead of "lh-assign-role-on-login.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
Everything looks great! No dangerous files found in this plugin124 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP19723124

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity21.00
▷ Minimum class complexity21.00
▷ Maximum class complexity21.00
Average method complexity3.50
▷ 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 methods450.00%
▷ Protected methods00.00%
▷ Private methods450.00%
Functions0
▷ Named functions00.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 files were detected