88% last-login-time

Code Review | Last Login Time

WordPress plugin Last Login Time scored 88% from 54 tests.

About plugin

  • Plugin page: last-login-time
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-5.8
  • WordPress version: 5.8.1
  • First release: Sep 26, 2020
  • Latest release: Aug 30, 2021
  • Number of updates: 5
  • Update frequency: every 68.4 days
  • Top authors: sgsoftwaresolutions (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 145 total downloads


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.07MB] [CPU: ▼142.66ms] Passed 4 tests

A check of server-side resources used by Last Login Time
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.90 ▲0.1837.91 ▲16.90
Dashboard /wp-admin3.11 ▲0.0645.98 ▲2.72
Posts /wp-admin/edit.php3.23 ▲0.1244.15 ▼2.72
Add New Post /wp-admin/post-new.php5.48 ▲0.0588.89 ▼568.03
Media Library /wp-admin/upload.php3.06 ▲0.0532.90 ▼2.62

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 23 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Last Login Time
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,816 ▲22116.64 ▲1.0612.61 ▲4.8748.10 ▼0.72
Dashboard /wp-admin2,974 ▲435.88 ▼0.04135.46 ▼3.65117.18 ▲5.10
Posts /wp-admin/edit.php2,743 ▲72.69 ▼0.0065.48 ▼0.4894.06 ▲6.28
Add New Post /wp-admin/post-new.php1,687 ▲18718.74 ▲0.24375.46 ▲12.61106.44 ▼8.78
Media Library /wp-admin/upload.php1,808 ▼55.02 ▲0.01141.32 ▼20.21127.15 ▲4.51

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 completely, with no zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/last-login-time/admin/partials/sg-last-login-time-admin-display.php
    • > /wp-content/plugins/last-login-time/public/partials/sg-last-login-time-public-display.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/last-login-time/includes/class-sg-last-login-time-files.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test


Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === last-login-time === )
Please take inspiration from this readme.txt

last-login-time/sg-last-login-time.php 85% from 13 tests

The main PHP file in "Last Login Time" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("last-login-time.php" instead of "sg-last-login-time.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
Good job! No executable or dangerous file extensions detected213 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity1.43
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.13
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
▷ Static methods28.70%
▷ Public methods1878.26%
▷ Protected methods00.00%
▷ Private methods521.74%
▷ Named functions8100.00%
▷ Anonymous functions00.00%
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin