74% user-login-stat

Code Review | User Login Statistics

WordPress plugin User Login Statistics scored74%from 54 tests.

About plugin

  • Plugin page: user-login-stat
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-5.4
  • WordPress version: 6.3.1
  • First release: Mar 5, 2012
  • Latest release: Mar 14, 2020
  • Number of updates: 7
  • Update frequency: every 418.7 days
  • Top authors: tareq1988 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /4,422 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.00MB] [CPU: ▼8.31ms] Passed 4 tests

Server-side resources used by User Login Statistics
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.93 ▲0.47
Dashboard /wp-admin3.32 ▼0.0350.53 ▼14.86
Posts /wp-admin/edit.php3.37 ▲0.0147.31 ▼3.68
Add New Post /wp-admin/post-new.php5.90 ▲0.0185.75 ▼15.18
Media Library /wp-admin/upload.php3.24 ▲0.0136.51 ▲0.60
User Login Stats /wp-admin/options-general.php?page=user_stats3.2140.82

Server storage [IO: ▲0.03MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 3 new files
Database: 1 new table, 6 new options
New tables
wp_user_stats
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for User Login Statistics
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.29 ▼0.271.89 ▲0.1544.56 ▲0.71
Dashboard /wp-admin2,202 ▲255.62 ▲0.0194.42 ▼0.5942.97 ▼2.44
Posts /wp-admin/edit.php2,101 ▲41.97 ▼0.0233.05 ▼5.8533.05 ▼4.35
Add New Post /wp-admin/post-new.php1,529 ▲123.18 ▼0.10640.36 ▼12.5348.94 ▼2.69
Media Library /wp-admin/upload.php1,398 ▼54.18 ▲0.04108.42 ▲4.8447.16 ▲0.85
User Login Stats /wp-admin/options-general.php?page=user_stats7922.0226.1725.79

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_user_stats
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/user-login-stat/user-login-stats.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/user-login-stat/user-login-stats.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add an image for screenshot #1 (Screenshot of this plugin)
You can take inspiration from this readme.txt

user-login-stat/user-login-stats.php 92% from 13 tests

The primary PHP file in "User Login Statistics" version 0.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("user-login-stat.php" instead of "user-login-stats.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected109 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP13255109

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.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

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png18.76KB5.72KB▼ 69.51%