74% user-visit-log

Code Review | User Visit Log

WordPress plugin User Visit Log scored 74% from 54 tests.

About plugin

  • Plugin page: user-visit-log
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.2.4
  • WordPress version: 5.8.1
  • First release: Aug 15, 2015
  • Latest release: Aug 16, 2015
  • Number of updates: 9
  • Update frequency: every 0.3 days
  • Top authors: rilwis (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 2,311 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼0.03MB] [CPU: ▼148.24ms] Passed 4 tests

This is a short check of server-side resources used by User Visit Log
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1343.28 ▲21.31
Dashboard /wp-admin2.87 ▼0.1928.27 ▼19.92
Posts /wp-admin/edit.php3.13 ▲0.0343.20 ▼4.43
Add New Post /wp-admin/post-new.php5.45 ▲0.0289.40 ▼564.40
Media Library /wp-admin/upload.php3.03 ▲0.0235.08 ▼4.21

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 8 new files
Database: 1 new table, 1 new option
New tables
wp_user_visits_log
New WordPress options
user_visits_log

Browser metrics Passed 4 tests

A check of browser resources used by User Visit Log
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,894 ▲32219.34 ▲3.8213.26 ▲2.3950.24 ▲2.49
Dashboard /wp-admin3,275 ▲3418.64 ▲2.68178.51 ▲26.89135.38 ▲23.85
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0067.38 ▼4.1791.95 ▲7.89
Add New Post /wp-admin/post-new.php3,687 ▲2,18315.13 ▼3.48494.98 ▲64.72108.22 ▼1.41
Media Library /wp-admin/upload.php1,810 ▲35.03 ▼0.01146.10 ▼4.06119.74 ▼2.86

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie tables detected upon uninstall: 1 table
    • wp_user_visits_log
  • Zombie WordPress options detected upon uninstall: 1 option
    • user_visits_log

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_time() in wp-content/plugins/user-visit-log/inc/admin/widgets/today.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-visit-log/inc/admin/database.php:2
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/user-visit-log/inc/admin/widgets/today.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/user-visit-log/user-visit-log.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-visit-log/inc/log.php:2
    • > PHP Warning
      Use of undefined constant UVL_TABLE - assumed 'UVL_TABLE' (this will throw an Error in a future version of PHP) in wp-content/plugins/user-visit-log/inc/admin/widgets/today.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/user-visit-log/inc/admin/widgets/overview.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% 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
These attributes need your attention:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
  • Screenshots: Add a description for screenshot #2 in user-visit-log/assets to your readme.txt
The official readme.txt is a good inspiration

user-visit-log/user-visit-log.php Passed 13 tests

"User Visit Log" version 1.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
22 characters long description:
Log users visit by day

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 plugin280 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP62254239
JavaScript161141

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity1.83
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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 images were found in this plugin