10% activitytime

Code Review | WP Sessions Time Monitoring Full Automatic

WordPress plugin WP Sessions Time Monitoring Full Automatic scored 10% from 54 tests.

About plugin

  • Plugin page: activitytime
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9
  • WordPress version: 5.9.2
  • First release: Dec 5, 2020
  • Latest release: Mar 18, 2022
  • Number of updates: 18
  • Update frequency: every 26.1 days
  • Top authors: switcorp (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

200+ active / 1,190 total downloads

Benchmarks

Plugin footprint 39% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/activitytime/freemius/includes/class-freemius.php+7806
    Trying to access array offset on value of type null

Server metrics [RAM: ▲5.05MB] [CPU: ▼286.04ms] 50% from 4 tests

A check of server-side resources used by WP Sessions Time Monitoring Full Automatic
Please have a look at the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 914.68ms on /wp-admin/admin.php?page=activitytime-addons)
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 5.05MB on /wp-admin/admin.php?page=activitytime-pricing)
PageMemory (MB)CPU Time (ms)
Home /8.67 ▲5.1689.91 ▲39.77
Dashboard /wp-admin8.69 ▲5.2861.76 ▲26.53
Posts /wp-admin/edit.php8.69 ▲5.0570.39 ▲22.21
Add New Post /wp-admin/post-new.php11.65 ▲4.69117.62 ▼1,215.06
Media Library /wp-admin/upload.php8.69 ▲5.3954.15 ▲22.15
Current Active /wp-admin/admin.php?page=actt_current_active8.6960.13
Support Forum /wp-admin/admin.php?page=activitytime-wp-support-forum8.7246.78
Time per page /wp-admin/admin.php?page=actt_time_per_page8.7255.66
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius8.7255.39
Sessions activity /wp-admin/admin.php?page=actt_sessions8.7254.80
Settings /wp-admin/admin.php?page=actt_settings8.7253.24
Related plugins /wp-admin/admin.php?page=actt_related8.721,963.53
Add-Ons /wp-admin/admin.php?page=activitytime-addons8.72914.68
Contact Us /wp-admin/admin.php?page=activitytime-contact8.7254.45
Upgrade  ➤ /wp-admin/admin.php?page=activitytime-pricing8.7253.66

Server storage [IO: ▲5.93MB] [DB: ▲0.02MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 263 new files
Database: 3 new tables, 10 new options
New tables
wp_actt_user_sessions
wp_actt_report
wp_actt_visited_pages
New WordPress options
actt_timeout_mins
actt_general_section
fs_debug_mode
actt_db_version
fs_accounts
fs_active_plugins
actt_log_days
activitytime-submenuitems
fs_gdpr
activitytime-menuitems

Browser metrics Passed 4 tests

Checking browser requirements for WP Sessions Time Monitoring Full Automatic
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,016 ▲27416.29 ▲0.309.62 ▲3.941.90 ▼0.42
Dashboard /wp-admin3,012 ▲1516.89 ▲0.71123.81 ▼12.65158.69 ▲2.42
Posts /wp-admin/edit.php2,807 ▲1163.54 ▲0.3068.14 ▲4.29158.95 ▲16.75
Add New Post /wp-admin/post-new.php1,748 ▼2517.42 ▼4.67410.36 ▼43.99168.15 ▲16.45
Media Library /wp-admin/upload.php1,814 ▲1165.98 ▲0.46123.74 ▼17.89189.90 ▼5.41
Current Active /wp-admin/admin.php?page=actt_current_active3,7145.04131.79427.41
Support Forum /wp-admin/admin.php?page=activitytime-wp-support-forum1,3763.1577.16126.63
Time per page /wp-admin/admin.php?page=actt_time_per_page3,9293.85126.77416.92
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,6333.1360.63115.84
Sessions activity /wp-admin/admin.php?page=actt_sessions2,5103.83116.70193.56
Settings /wp-admin/admin.php?page=actt_settings1,2063.2761.94128.11
Related plugins /wp-admin/admin.php?page=actt_related1,2833.0760.34134.57
Add-Ons /wp-admin/admin.php?page=activitytime-addons1,4193.9274.37151.77
Contact Us /wp-admin/admin.php?page=activitytime-contact1,8774.4285.59123.44
Upgrade  ➤ /wp-admin/admin.php?page=activitytime-pricing1,9635.4996.85146.28

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie tables were found after uninstall: 3 tables
    • wp_actt_report
    • wp_actt_visited_pages
    • wp_actt_user_sessions
  • The uninstall procedure has failed, leaving 10 options in the database
    • fs_gdpr
    • fs_debug_mode
    • actt_log_days
    • activitytime-submenuitems
    • fs_accounts
    • actt_general_section
    • actt_timeout_mins
    • fs_active_plugins
    • activitytime-menuitems
    • actt_db_version

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
The smoke test was a success, however most plugin functionality was not tested

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 fix the following
  • 8× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/activitytime/application/controllers/Actt_contact_us.php
    • > /wp-content/plugins/activitytime/application/controllers/Actt_related.php
    • > /wp-content/plugins/activitytime/application/controllers/Actt_current_active.php
    • > /wp-content/plugins/activitytime/application/controllers/Actt_time_per_page.php
    • > /wp-content/plugins/activitytime/admin/partials/activitytime-admin-display.php
    • > /wp-content/plugins/activitytime/public/partials/activitytime-public-display.php
    • > /wp-content/plugins/activitytime/application/controllers/Actt_sessions.php
    • > /wp-content/plugins/activitytime/application/controllers/Activitytime.php
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/activitytime/application/views/actt_time_per_page/index.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/activitytime/vendor/Winter_MVC/core/mvc_loader.php:49
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/activitytime/application/views/acct_contact/index.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function echo_js() in wp-content/plugins/activitytime/application/views/general/footer.php:67
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/activitytime/application/views/activitytime/index.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/activitytime/application/views/actt_related/index.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'CI_Model' not found in wp-content/plugins/activitytime/application/core/MY_Model.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/activitytime/application/views/actt_current_active/index.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/activitytime/application/views/actt_sessions/index.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (Sessions time and time per page analytics graphs), #2 (Activity time tracking per page), #3 (Activity time tracking per session)
The official readme.txt might help

activitytime/activitytime.php 92% from 13 tests

Analyzing the main PHP file in "WP Sessions Time Monitoring Full Automatic" version 1.0.6
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 164 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected50,173 lines of code in 195 files:
LanguageFilesBlank linesComment linesLines of code
PHP1479,36717,62137,312
CSS25909596,200
SVG2002,959
JavaScript157608192,892
Markdown2820405
PO File2158280369
JSON10027
HTML1209

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity64.84
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity4.33
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes69
▷ Abstract classes22.90%
▷ Concrete classes6797.10%
▷ Final classes00.00%
Methods1,352
▷ Static methods17813.17%
▷ Public methods99873.82%
▷ Protected methods211.55%
▷ Private methods33324.63%
Functions185
▷ Named functions18398.92%
▷ Anonymous functions21.08%
Constants128
▷ Global constants10380.47%
▷ Class constants2519.53%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
admin/img/details_close.png0.67KB0.79KB0.00%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
admin/img/details_open.png0.69KB0.80KB0.00%