62% visitor-info

Code Review | WPVisitorInfo - Show Visitor Information & Conditional Data Based On That Information

WordPress plugin WPVisitorInfo - Show Visitor Information & Conditional Data Based On That Information scored 62% from 54 tests.

About plugin

  • Plugin page: visitor-info
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.8
  • WordPress version: 5.9.2
  • First release: Sep 13, 2021
  • Latest release: Sep 14, 2021
  • Number of updates: 4
  • Update frequency: every 0.8 days
  • Top authors: webmuehle (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 99 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲4.01MB] [CPU: ▼342.60ms] Passed 4 tests

An overview of server-side resources used by WPVisitorInfo - Show Visitor Information & Conditional Data Based On That Information
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /8.38 ▲4.8724.80 ▼30.08
Dashboard /wp-admin8.40 ▲4.9930.83 ▼3.60
Posts /wp-admin/edit.php8.40 ▲4.7630.47 ▼14.11
Add New Post /wp-admin/post-new.php8.40 ▲1.4324.85 ▼1,320.70
Media Library /wp-admin/upload.php8.40 ▲5.1022.75 ▼5.49
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius8.4023.70
Wordpress Visitor Info /wp-admin/admin.php?page=wpvisitorinfo8.4025.26

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 169 new files
Database: no new tables, 4 new options
New WordPress options
fs_debug_mode
fs_active_plugins
fs_accounts
fs_gdpr

Browser metrics Passed 4 tests

WPVisitorInfo - Show Visitor Information & Conditional Data Based On That Information: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,230 ▼51215.56 ▼0.150.36 ▼5.5429.48 ▲27.04
Dashboard /wp-admin2,939 ▲816.13 ▼0.04128.77 ▼20.43183.46 ▲12.77
Posts /wp-admin/edit.php2,738 ▲473.24 ▲0.0264.55 ▼0.03161.16 ▲12.44
Add New Post /wp-admin/post-new.php1,740 ▼1822.34 ▲0.81438.22 ▼15.64222.20 ▲28.74
Media Library /wp-admin/upload.php1,749 ▲545.64 ▲0.12123.25 ▼15.39200.94 ▼42.00
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius1,4182.7453.96121.84
Wordpress Visitor Info /wp-admin/admin.php?page=wpvisitorinfo1,5462.7857.61179.01

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5768
    wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the checkout-script handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin does not fully uninstall, leaving 4 options in the database
    • fs_gdpr
    • fs_accounts
    • fs_active_plugins
    • fs_debug_mode

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpvisitorinfo
    • > User notice in wp-includes/functions.php+5768
    wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the checkout-script handle. Please see Debugging in WordPress for more information. (This message was added in version 3.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 fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/visitor-info/freemius/templates/ajax-loader.php
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/visitor-info/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/visitor-info/freemius/templates/account/partials/addon.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/visitor-info/freemius/templates/account/partials/addon.php:9
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/visitor-info/freemius/templates/account/partials/addon.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/visitor-info/freemius/templates/partials/network-activation.php:6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/visitor-info/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/visitor-info/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/visitor-info/freemius/templates/account/partials/addon.php on line 6

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

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
2 plugin tags: visitor data, visitor info

visitor-info/wpvisitorinfo.php 92% from 13 tests

The principal PHP file in "WPVisitorInfo - Show Visitor Information & Conditional Data Based On That Information" v. 1.0.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("visitor-info.php" instead of "wpvisitorinfo.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected31,208 lines of code in 125 files:
LanguageFilesBlank linesComment linesLines of code
PHP1087,33316,10530,758
Markdown1680214
JavaScript43459195
JSON10027
CSS110014

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 2,907)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity90.20
▷ Minimum class complexity1.00
▷ Maximum class complexity2,907.00
Average method complexity4.65
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes45
▷ Abstract classes24.44%
▷ Concrete classes4395.56%
▷ Final classes00.00%
Methods1,132
▷ Static methods17315.28%
▷ Public methods79269.96%
▷ Protected methods151.33%
▷ Private methods32528.71%
Functions98
▷ Named functions98100.00%
▷ Anonymous functions00.00%
Constants123
▷ Global constants9879.67%
▷ Class constants2520.33%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
slogo.PNG8.29KB4.91KB▼ 40.79%
logo.png16.89KB6.49KB▼ 61.56%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/wpvisitorinfo.png9.16KB5.26KB▼ 42.58%