78% advanced-hotjar

Code Review | Advanced Hotjar

WordPress plugin Advanced Hotjar scored 78% from 54 tests.

About plugin

  • Plugin page: advanced-hotjar
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.4.1
  • WordPress version: 5.9.2
  • First release: May 1, 2020
  • Latest release: May 1, 2020
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: jeromepaulos (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active / 427 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼1.50MB] [CPU: ▼336.00ms] Passed 4 tests

An overview of server-side resources used by Advanced Hotjar
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.94 ▼0.5715.92 ▼33.54
Dashboard /wp-admin2.86 ▼0.5413.61 ▼21.34
Posts /wp-admin/edit.php2.86 ▼0.7814.02 ▼22.73
Add New Post /wp-admin/post-new.php2.86 ▼4.1114.03 ▼1,266.37
Media Library /wp-admin/upload.php2.86 ▼0.4313.15 ▼10.41
Hotjar /wp-admin/options-general.php?page=advanced_hotjar2.8614.54

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Advanced Hotjar
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,768 ▲1416.20 ▲0.256.57 ▼0.052.34 ▼0.30
Dashboard /wp-admin2,893 ▲326.08 ▼0.03114.12 ▼22.42153.56 ▼13.02
Posts /wp-admin/edit.php2,696 ▲23.24 ▲0.0062.02 ▲1.05137.13 ▼2.22
Add New Post /wp-admin/post-new.php1,664 ▲417.24 ▲1.19424.44 ▼6.68157.53 ▲3.65
Media Library /wp-admin/upload.php1,703 ▲25.47 ▼0.06139.18 ▲1.54184.93 ▼0.15
Hotjar /wp-admin/options-general.php?page=advanced_hotjar1,0762.4256.11124.91

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/advanced-hotjar/advanced-hotjar.php+129
    Trying to access array offset on value of type bool

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=advanced_hotjar
    • > Notice in wp-content/plugins/advanced-hotjar/advanced-hotjar.php+131
    Trying to access array offset on value of type bool

SRP 50% 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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/advanced-hotjar/advanced-hotjar.php:123

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)
Everything seems fine, but this is not an exhaustive test


Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Requires php: Version format is invalid
You can look at the official readme.txt

advanced-hotjar/advanced-hotjar.php Passed 13 tests

Analyzing the main PHP file in "Advanced Hotjar" version 1.0.0
49 characters long description:
Add Hotjar to your site, with a few more options.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected150 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity2.60
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions2100.00%
▷ Anonymous functions00.00%
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin