78% user-login-history

Code Review | User Login History

WordPress plugin User Login History scored78%from 54 tests.

About plugin

  • Plugin page: user-login-history
  • Plugin version: 2.1.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.4.1
  • WordPress version: 6.3.1
  • First release: May 7, 2016
  • Latest release: Nov 10, 2023
  • Number of updates: 180
  • Update frequency: every 15.2 days
  • Top authors: faiyazalam (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

20,000+ active /186,552 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.47MB] [CPU: ▲0.57ms] Passed 4 tests

An overview of server-side resources used by User Login History
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.04 ▲0.5843.99 ▲6.80
Dashboard /wp-admin3.79 ▲0.4551.91 ▼9.43
Posts /wp-admin/edit.php3.84 ▲0.4960.44 ▲12.47
Add New Post /wp-admin/post-new.php6.35 ▲0.4687.10 ▼0.93
Media Library /wp-admin/upload.php3.69 ▲0.4639.50 ▲5.84
Pro Features /wp-admin/admin.php?page=faulh-pro3.6938.03
User Login History /wp-admin/options-general.php?page=faulh-settings3.7139.46
Login List /wp-admin/admin.php?page=faulh-login-listing4.5748.66

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 75 new files
Database: 1 new table, 9 new options
New tables
wp_fa_user_logins
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
fa_userloginhostory_version
faulh_basics
faulh_advanced
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by User Login History
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,970 ▲19814.87 ▲0.591.76 ▲0.0340.03 ▼2.06
Dashboard /wp-admin2,360 ▲1796.29 ▲0.62121.94 ▲16.38100.63 ▲52.67
Posts /wp-admin/edit.php2,303 ▲2003.53 ▲1.4554.78 ▲10.2772.73 ▲36.99
Add New Post /wp-admin/post-new.php1,560 ▲3423.82 ▲0.26632.23 ▼84.81151.94 ▲99.30
Media Library /wp-admin/upload.php1,446 ▲554.25 ▲0.0687.52 ▼14.0874.38 ▲29.48
Pro Features /wp-admin/admin.php?page=faulh-pro1,3123.3647.0185.46
User Login History /wp-admin/options-general.php?page=faulh-settings1,1183.2747.8873.65
Login List /wp-admin/admin.php?page=faulh-login-listing4,0473.7958.1183.04

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% 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
Please fix the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/user-login-history/inc/frontend/views/html-faulh-public-display.php
    • > /wp-content/plugins/user-login-history/inc/admin/views/html-faulh-admin-display.php
  • 16× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'User_Login_History\\Inc\\Common\\Helpers\\Template' not found in wp-content/plugins/user-login-history/inc/admin/views/settings/network-admin.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/user-login-history/inc/admin/views/forms/filter.php:16
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/user-login-history/inc/frontend/views/listing.php:12
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/user-login-history/inc/frontend/views/forms/filter.php:14
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/user-login-history/inc/common/abstracts/class-list-table.php on line 21
    • > PHP Fatal error
      Uncaught Error: Class 'User_Login_History\\Inc\\Common\\Abstracts\\User_Profile' not found in wp-content/plugins/user-login-history/inc/frontend/class-user-profile.php:19
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/user-login-history/inc/common/abstracts/class-list-table.php on line 21
    • > PHP Fatal error
      Uncaught Error: Class 'User_Login_History\\Inc\\Admin\\Login_List_Table' not found in wp-content/plugins/user-login-history/inc/admin/class-admin-login-list-table.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'User_Login_History\\Inc\\Common\\Helpers\\Template' not found in wp-content/plugins/user-login-history/inc/admin/views/login-list-table.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'User_Login_History\\Inc\\Admin\\Login_List_Table' not found in wp-content/plugins/user-login-history/inc/admin/class-network-admin-login-list-table.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: brute force indicator, history, tool, login log, login activity...

user-login-history/user-login-history.php 85% from 13 tests

The main PHP file in "User Login History" ver. 2.1.3 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 141 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
No dangerous file extensions were detected17,451 lines of code in 57 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript52,4131,64212,720
PHP461,0242,8644,503
CSS62319228

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity21.53
▷ Minimum class complexity1.00
▷ Maximum class complexity249.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity52.00
Code structure
Namespaces8
Interfaces2
Traits0
Classes32
▷ Abstract classes39.38%
▷ Concrete classes2990.62%
▷ Final classes310.34%
Methods350
▷ Static methods3710.57%
▷ Public methods25171.71%
▷ Protected methods6819.43%
▷ Private methods318.86%
Functions9
▷ Named functions777.78%
▷ Anonymous functions222.22%
Constants117
▷ Global constants1512.82%
▷ Class constants10287.18%
▷ Public constants102100.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
5 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/admin/css/images/ui-icons_444444_256x240.png6.84KB4.18KB▼ 38.90%
inc/frontend/css/images/cal.png1.83KB1.49KB▼ 18.40%
inc/admin/images/icon.png0.92KB0.92KB0.32%
inc/admin/css/images/cal.png1.83KB1.49KB▼ 18.40%
inc/frontend/css/images/ui-icons_444444_256x240.png6.84KB4.18KB▼ 38.90%