94% lh-login-logger

Code Review | LH Login Logger

WordPress plugin LH Login Logger scored 94% from 54 tests.

About plugin

  • Plugin page: lh-login-logger
  • Plugin version: 1.03
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.8
  • WordPress version: 5.8.1
  • First release: Apr 15, 2017
  • Latest release: Jul 28, 2017
  • Number of updates: 4
  • Update frequency: every 26.0 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 544 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.05MB] [CPU: ▼145.70ms] Passed 4 tests

An overview of server-side resources used by LH Login Logger
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.0522.37 ▼0.67
Dashboard /wp-admin3.11 ▲0.0531.23 ▼6.93
Posts /wp-admin/edit.php3.20 ▲0.0929.34 ▲0.28
Add New Post /wp-admin/post-new.php5.47 ▲0.0467.31 ▼575.48
Media Library /wp-admin/upload.php3.05 ▲0.0524.02 ▲2.26

Server storage [IO: ▲0.01MB] [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

An overview of browser requirements for LH Login Logger
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,676 ▲7016.02 ▲0.395.10 ▲0.0975.66 ▼1.47
Dashboard /wp-admin2,929 ▲346.10 ▼0.08114.10 ▼18.00164.70 ▼8.68
Posts /wp-admin/edit.php2,737 ▼33.24 ▼0.0164.00 ▼1.37137.10 ▼4.71
Add New Post /wp-admin/post-new.php3,815 ▲819.08 ▲0.30415.91 ▼36.76159.86 ▼5.30
Media Library /wp-admin/upload.php1,749 ▼65.55 ▲0.04148.40 ▼0.86196.54 ▲10.78

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstaller ran successfully

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 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
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/lh-login-logger/lh-login-logger.php:331

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)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: admin, login, last login, user, plugin

lh-login-logger/lh-login-logger.php Passed 13 tests

"LH Login Logger" version 1.03's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
82 characters long description:
Keeps track of the last login by each user and how many times they have logged in

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin167 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP114953167

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity35.00
▷ Minimum class complexity35.00
▷ Maximum class complexity35.00
Average method complexity3.83
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.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

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin