84% user-last-visit

Code Review | User Last Visit

WordPress plugin User Last Visit scored84%from 54 tests.

About plugin

  • Plugin page: user-last-visit
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.2.2
  • WordPress version: 6.3.1
  • First release: Apr 14, 2015
  • Latest release: Dec 11, 2016
  • Number of updates: 9
  • Update frequency: every 84.8 days
  • Top authors: cnhk_systems (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active /1,749 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.07MB] [CPU: ▼4.83ms] Passed 4 tests

Server-side resources used by User Last Visit
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0443.02 ▲6.88
Dashboard /wp-admin3.38 ▲0.0846.95 ▼1.52
Posts /wp-admin/edit.php3.49 ▲0.1447.84 ▼7.20
Add New Post /wp-admin/post-new.php5.96 ▲0.0898.26 ▼13.02
Media Library /wp-admin/upload.php3.30 ▲0.0738.91 ▲2.44
User Last Visit /wp-admin/options-general.php?page=ulv_admin_page3.2932.81

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by User Last Visit
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.34 ▼0.241.89 ▼0.0844.28 ▲1.81
Dashboard /wp-admin2,202 ▲255.63 ▼0.0383.90 ▼3.7335.58 ▼6.84
Posts /wp-admin/edit.php2,104 ▲12.02 ▼0.0135.08 ▼9.4137.16 ▲0.47
Add New Post /wp-admin/post-new.php1,552 ▲1518.35 ▲0.11628.36 ▲5.8771.77 ▲5.78
Media Library /wp-admin/upload.php1,398 ▲14.21 ▲0.0197.08 ▲0.0740.92 ▼5.63
User Last Visit /wp-admin/options-general.php?page=ulv_admin_page1,0052.0146.6627.37

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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

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 everything seems fine, this is not 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
Almost there! Just fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/user-last-visit/includes/functions.php:92
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-last-visit/includes/ulv-ajax-cb.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/user-last-visit/views/admin-page.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: multisite, visit, logged in, record, user

user-last-visit/main.php 85% from 13 tests

Analyzing the main PHP file in "User Last Visit" version 1.0
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 ("user-last-visit.php" instead of "main.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin869 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP847199518
PO File28688226
JavaScript1141585
CSS110740

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity13.50
▷ Minimum class complexity7.00
▷ Maximum class complexity21.00
Average method complexity3.08
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods24
▷ Static methods416.67%
▷ Public methods1979.17%
▷ Protected methods00.00%
▷ Private methods520.83%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants480.00%
▷ Class constants120.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin