77% hotspots

Code Review | Hotspots Analytics

WordPress plugin Hotspots Analytics scored 77% from 54 tests.

About plugin

  • Plugin page: hotspots
  • Plugin version: 4.0.12
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7
  • WordPress version: 5.8.1
  • First release: Jan 10, 2013
  • Latest release: Dec 6, 2016
  • Number of updates: 227
  • Update frequency: every 6.3 days
  • Top authors: dpowney (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

1,000+ active / 39,747 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.79MB] [CPU: ▼133.53ms] Passed 4 tests

An overview of server-side resources used by Hotspots Analytics
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.7951.01 ▲15.38
Dashboard /wp-admin3.86 ▲0.8050.94 ▲2.00
Posts /wp-admin/edit.php3.91 ▲0.8051.64 ▲12.66
Add New Post /wp-admin/post-new.php6.22 ▲0.7894.32 ▼556.60
Media Library /wp-admin/upload.php3.80 ▲0.8041.37 ▲7.84
Reports /wp-admin/admin.php?page=ha_reports_page3.7737.95
Heatmaps /wp-admin/admin.php?page=ha_heatmaps_page3.7842.03
Settings /wp-admin/admin.php?page=ha_settings_page3.7734.25
Users /wp-admin/admin.php?page=ha_users_page3.7537.76

Server storage [IO: ▲0.47MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 38 new files
Database: 4 new tables, 6 new options
New tables
wp_ha_user_event
wp_ha_custom_event
wp_ha_user_environment
wp_ha_user
New WordPress options
ha_database_settings_key
plugin_version
ha_url_filters_settings
ha_schedule_settings_key
ha_general_settings
ha_heat_map_settings_key

Browser metrics Passed 4 tests

An overview of browser requirements for Hotspots Analytics
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,947 ▲37617.60 ▲2.1719.73 ▲4.5749.54 ▼4.51
Dashboard /wp-admin3,072 ▲1416.75 ▲0.77155.09 ▲0.80106.77 ▼3.79
Posts /wp-admin/edit.php2,840 ▲1012.84 ▲0.1283.87 ▲20.27103.52 ▲14.05
Add New Post /wp-admin/post-new.php1,683 ▲6822.29 ▲1.18307.17 ▲0.51118.67 ▲12.56
Media Library /wp-admin/upload.php1,905 ▲985.56 ▲0.53149.24 ▼5.09113.07 ▼7.23
Reports /wp-admin/admin.php?page=ha_reports_page1,4442.9494.3094.93
Heatmaps /wp-admin/admin.php?page=ha_heatmaps_page1,5392.7067.5381.17
Settings /wp-admin/admin.php?page=ha_settings_page1,2832.8173.6099.78
Users /wp-admin/admin.php?page=ha_users_page1,5802.8374.2095.72

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=ha_users_page
    • > Notice in wp-content/plugins/hotspots/php/tables/users-table.php+145
    Undefined index: id

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
Almost there! Just fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/hotspots/php/uaparser/json/JSON.php
    • > /wp-content/plugins/hotspots/php/uaparser/json/jsonwrapper.php
  • 28× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/hotspots/php/tables/heatmaps-table.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/hotspots/php/tables/summary-table.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/hotspots/php/tables/heatmaps-table.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/hotspots/php/tables/heatmaps-table.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/hotspots/php/tables/custom-events-table.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/hotspots/php/tables/heatmaps-table.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/hotspots/php/tables/summary-table.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/hotspots/php/tables/heatmaps-table.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/hotspots/php/tables/user-activity-table.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/hotspots/php/tables/summary-table.php on line 4

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ha_users_page
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.8.1 1:31592 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/hotspots/js/admin.js?ver=5.8.1:9:45)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.8.1:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.8.1:2:30340)" undefined
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ha_users_page
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.8.1 1:31702 Uncaught TypeError: jQuery(...).live is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Tags: There are too many tags (19 tag instead of maximum 10)
  • Screenshots: Add a description for screenshot #13 in hotspots/assets to your readme.txt
The official readme.txt is a good inspiration

hotspots/hotspots.php Passed 13 tests

"Hotspots Analytics" version 4.0.12's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
118 characters long description:
The most advanced analytics plugin for WordPress websites including heatmaps, user activity and custom event tracking.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin8,057 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP238771,0654,022
JavaScript109278163,947
CSS218087
JSON1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity30.95
▷ Minimum class complexity1.00
▷ Maximum class complexity159.00
Average method complexity4.43
▷ Minimum method complexity1.00
▷ Maximum method complexity56.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes18
▷ Abstract classes00.00%
▷ Concrete classes18100.00%
▷ Final classes00.00%
Methods169
▷ Static methods6337.28%
▷ Public methods15088.76%
▷ Protected methods10.59%
▷ Private methods1810.65%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin