57% winterlock

Code Review | Activity Log WinterLock

WordPress plugin Activity Log WinterLock scored57%from 54 tests.

About plugin

  • Plugin page: winterlock
  • Plugin version: 1.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Jan 2, 2020
  • Latest release: Aug 10, 2023
  • Number of updates: 57
  • Update frequency: every 23.1 days
  • Top authors: switcorp (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

100+ active /7,979 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲5.36MB] [CPU: ▲24.72ms] 75% from 4 tests

This is a short check of server-side resources used by Activity Log WinterLock
Please fix the following
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.36MB on /wp-admin/admin.php?page=winteractivitylog-contact)
PageMemory (MB)CPU Time (ms)
Home /8.92 ▲5.4667.11 ▲27.88
Dashboard /wp-admin8.94 ▲5.5988.15 ▲28.47
Posts /wp-admin/edit.php8.94 ▲5.5897.83 ▲48.10
Add New Post /wp-admin/post-new.php10.69 ▲4.81111.25 ▲1.87
Media Library /wp-admin/upload.php8.94 ▲5.7179.20 ▲40.67
Settings /wp-admin/admin.php?page=wal_settings8.9477.77
Upgrade  ➤ /wp-admin/admin.php?page=winteractivitylog-pricing8.9466.21
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.9467.21
Contact Us /wp-admin/admin.php?page=winteractivitylog-contact8.9465.93

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 314 new files
Database: 8 new tables, 24 new options
New tables
wp_wal_log
wp_wal_failed_attemps
wp_wal_cloud
wp_wal_sessions
wp_wal_control_rule
wp_wal_report
wp_wal_control
wp_wal_history
New WordPress options
wal_checkbox_hide_ip
dashboard_widget_options
wal_checkbox_log_cron_disable
widget_recent-comments
wal_checkbox_failed_login_block
wal_db_version
wal_checkbox_log_level_2_disable
wal_checkbox_log_plugin_disable
fs_active_plugins
wal_checkbox_enable_winterlock_dash_styles
...

Browser metrics Passed 4 tests

An overview of browser requirements for Activity Log WinterLock
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,139 ▲1,37818.42 ▲4.074.95 ▲3.2131.10 ▼15.07
Dashboard /wp-admin3,357 ▲1,1776.61 ▲0.98155.91 ▲60.74114.08 ▲73.41
Posts /wp-admin/edit.php2,202 ▲1022.37 ▲0.3443.91 ▲3.8839.92 ▲4.16
Add New Post /wp-admin/post-new.php1,613 ▲8723.41 ▲0.35688.54 ▲36.9037.22 ▼12.10
Media Library /wp-admin/upload.php1,505 ▲1054.83 ▲0.6498.92 ▼12.3443.72 ▼4.33
Settings /wp-admin/admin.php?page=wal_settings1,1112.4835.8234.74
Upgrade  ➤ /wp-admin/admin.php?page=winteractivitylog-pricing2,3463.8079.38112.06
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1792.2827.1926.79
Contact Us /wp-admin/admin.php?page=winteractivitylog-contact1,6173.7060.3734.14

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/winterlock/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 8 tables in the database
    • wp_wal_history
    • wp_wal_failed_attemps
    • wp_wal_report
    • wp_wal_sessions
    • wp_wal_control
    • wp_wal_log
    • wp_wal_cloud
    • wp_wal_control_rule
  • Zombie WordPress options were found after uninstall: 24 options
    • wal_log_days
    • fs_accounts
    • wal_checkbox_failed_login_block
    • wal_checkbox_log_level_1_disable
    • wal_checkbox_log_level_3_disable
    • wal_checkbox_enable_winterlock_dash_styles
    • wal_checkbox_disable_multilogin
    • wal_general_section
    • can_compress_scripts
    • winterlock_reviews_installed_on
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 13× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/winterlock/public/partials/winter-activity-log-public-display.php
    • > /wp-content/plugins/winterlock/application/controllers/Wal_logalerts.php
    • > /wp-content/plugins/winterlock/application/controllers/Wal_cloudintegration.php
    • > /wp-content/plugins/winterlock/application/controllers/Wal_disabledlogs.php
    • > /wp-content/plugins/winterlock/application/controllers/Wal_usersessions.php
    • > /wp-content/plugins/winterlock/admin/partials/winter-activity-log-admin-display.php
    • > /wp-content/plugins/winterlock/application/controllers/Wal_history.php
    • > /wp-content/plugins/winterlock/application/controllers/Wal_controlsecurity.php
    • > /wp-content/plugins/winterlock/application/controllers/Wal_favouritelogs.php
    • > /wp-content/plugins/winterlock/application/controllers/Wal_dashwidgets.php
  • 23× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wmvc_btn_delete() in wp-content/plugins/winterlock/application/views/wal_history/edit_history.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sw_wal_log_is_visible_table_column() in wp-content/plugins/winterlock/application/views/winteractivitylog/index.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/winterlock/application/views/wal_history/index.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function menu_page_url() in wp-content/plugins/winterlock/application/views/general/footer.php:79
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/winterlock/application/views/wal_cloudintegration/index.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/winterlock/application/views/wal_controlsecurity/index.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/winterlock/application/views/wal_logalerts/index.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/winterlock/application/views/wal_cloudintegration/cloud_edit.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/winterlock/application/views/wal_reports/index.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/winterlock/vendor/Winter_MVC/init.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Donate link: Please fix this invalid url: "paypal.me/winterit"
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (System Log View Page), #2 (Log details and tracking history example), #3 (Report configuration), #4 (Cloud configuration)
The official readme.txt might help

winterlock/winterlock.php 85% from 13 tests

"Activity Log WinterLock" version 1.2.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 164 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis 97% from 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
There were no executable files found in this plugin78,051 lines of code in 231 files:
LanguageFilesBlank linesComment linesLines of code
PHP18112,21920,20748,861
JavaScript149951,19710,038
CSS28262539,835
SVG4088,421
PO File1199458452
XML100244
Markdown1140191
HTML1209

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
The following items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity63.79
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.39
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes85
▷ Abstract classes22.35%
▷ Concrete classes8397.65%
▷ Final classes00.00%
Methods1,593
▷ Static methods22514.12%
▷ Public methods1,17773.89%
▷ Protected methods231.44%
▷ Private methods39324.67%
Functions225
▷ Named functions22198.22%
▷ Anonymous functions41.78%
Constants152
▷ Global constants10468.42%
▷ Class constants4831.58%
▷ Public constants48100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
9 PNG files occupy 0.14MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/details_open.png0.69KB0.80KB0.00%
admin/resources/details_open.png0.69KB0.80KB0.00%
admin/img/icon-256x256.png9.94KB5.04KB▼ 49.34%
admin/resources/details_close.png0.67KB0.79KB0.00%
admin/img/plugins/banner-activitytime.png111.00KB34.53KB▼ 68.90%