62% user-activity-logger

Code Review | User Activity Logger

WordPress plugin User Activity Logger scored62%from 54 tests.

About plugin

  • Plugin page: user-activity-logger
  • Plugin version: 0.0.2
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.9
  • WordPress version: 6.3.1
  • First release: Oct 3, 2017
  • Latest release: Dec 5, 2017
  • Number of updates: 8
  • Update frequency: every 8.1 days
  • Top authors: klickonit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /676 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.80MB] [CPU: ▼33.55ms] Passed 4 tests

A check of server-side resources used by User Activity Logger
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0941.42 ▲0.53
Dashboard /wp-admin3.14 ▼0.1625.57 ▼28.18
Posts /wp-admin/edit.php3.14 ▼0.2129.11 ▼21.03
Add New Post /wp-admin/post-new.php3.14 ▼2.7428.39 ▼72.78
Media Library /wp-admin/upload.php3.14 ▼0.0824.45 ▼12.20
User Activity Logger /wp-admin/options-general.php?page=klick_ual3.1528.11

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 51 new files
Database: no new tables, 8 new options
New WordPress options
klick-ual-logging
klick-ual-notice-display-time
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for User Activity Logger
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,897 ▲13614.61 ▼0.121.59 ▼0.3742.54 ▲1.49
Dashboard /wp-admin2,288 ▲1115.57 ▼0.0989.37 ▲1.4183.22 ▲37.89
Posts /wp-admin/edit.php2,110 ▲72.00 ▼0.0237.19 ▼7.6631.71 ▼4.24
Add New Post /wp-admin/post-new.php1,535 ▲923.41 ▲0.33668.35 ▼124.4670.29 ▲6.74
Media Library /wp-admin/upload.php1,410 ▲74.23 ▼0.0197.67 ▼22.3842.39 ▼6.43
User Activity Logger /wp-admin/options-general.php?page=klick_ual1,6131.8127.6027.01

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=klick_ual
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

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
  • 15× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/user-activity-logger/includes/class-klick-ual-abstract-logger.php
    • > /wp-content/plugins/user-activity-logger/includes/class-klick-ual-commands.php
    • > /wp-content/plugins/user-activity-logger/includes/class-klick-ual-dashboard.php
    • > /wp-content/plugins/user-activity-logger/includes/class-klick-ual-options.php
    • > /wp-content/plugins/user-activity-logger/user-activity-logger.php
    • > /wp-content/plugins/user-activity-logger/includes/class-klick-ual-logger.php
    • > /wp-content/plugins/user-activity-logger/templates/klick-ual-tabs-header.php
    • > /wp-content/plugins/user-activity-logger/includes/class-klick-ual-abstract-notice.php
    • > /wp-content/plugins/user-activity-logger/notices/notice-klick-ual-no-config.php
    • > /wp-content/plugins/user-activity-logger/templates/klick-ual-tab-change-log.php
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/user-activity-logger/templates/klick-ual-tab-information.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to a member function is_configured_email_and_toggle() on null in wp-content/plugins/user-activity-logger/templates/klick-ual-tab-information.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/user-activity-logger/templates/klick-ual-tab-our-other-plugins.php:3
    • > PHP Warning
      Use of undefined constant KLICK_UAL_PLUGIN_URL - assumed 'KLICK_UAL_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/user-activity-logger/templates/klick-ual-tab-our-other-plugins.php on line 3

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 96% from 29 tests

readme.txt Passed 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
3 plugin tags: logger, activity tracker, user

user-activity-logger/user-activity-logger.php 92% from 13 tests

The main file in "User Activity Logger" v. 0.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, 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
Everything looks great! No dangerous files found in this plugin1,695 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
PHP19283473811
SVG11011521
CSS61310216
JavaScript21941101
Markdown126046

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity8.25
▷ Minimum class complexity1.00
▷ Maximum class complexity18.00
Average method complexity2.26
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes216.67%
▷ Concrete classes1083.33%
▷ Final classes00.00%
Methods70
▷ Static methods57.14%
▷ Public methods6998.57%
▷ Protected methods00.00%
▷ Private methods11.43%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
6 PNG files occupy 0.16MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/ual-banner.png81.81KB30.48KB▼ 62.75%
images/notices/ual_notice_icon.png20.74KB1.79KB▼ 91.39%
images/small_icon.png18.12KB0.45KB▼ 97.52%
images/notices/ual_notice_icon3.png30.17KB6.04KB▼ 79.98%
images/notices/ual_notice_icon2.png9.63KB4.69KB▼ 51.23%