68% advanced-hotjar

Code Review | Advanced Hotjar

WordPress plugin Advanced Hotjar scored68%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: 6.3.1
  • 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

40+ active /669 total downloads


Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼1.24MB] [CPU: ▼41.38ms] Passed 4 tests

This is a short check of server-side resources used by Advanced Hotjar
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.73 ▼0.7314.43 ▼21.82
Dashboard /wp-admin2.77 ▼0.5416.17 ▼35.22
Posts /wp-admin/edit.php2.77 ▼0.5916.69 ▼30.38
Add New Post /wp-admin/post-new.php2.77 ▼3.1215.80 ▼78.08
Media Library /wp-admin/upload.php2.77 ▼0.4617.34 ▼18.49
Hotjar /wp-admin/options-general.php?page=advanced_hotjar2.7715.55

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

Advanced Hotjar: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4713.28 ▼1.111.94 ▼0.0144.43 ▲0.35
Dashboard /wp-admin2,210 ▲185.92 ▲0.96107.94 ▼7.3339.96 ▼5.17
Posts /wp-admin/edit.php2,093 ▲42.02 ▼0.0138.71 ▲2.5836.57 ▲3.77
Add New Post /wp-admin/post-new.php1,414 ▼11917.86 ▼5.21607.53 ▼46.2968.85 ▼2.75
Media Library /wp-admin/upload.php1,392 ▲44.18 ▼0.0194.51 ▼6.1441.49 ▲0.40
Hotjar /wp-admin/options-general.php?page=advanced_hotjar8612.0622.5925.54

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/advanced-hotjar/advanced-hotjar.php+129
    Trying to access array offset on value of type bool
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > 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)
No browser errors were detected


Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Requires php: Version format is invalid
Please take inspiration from this readme.txt

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

The primary PHP file in "Advanced Hotjar" version 1.0.0 is used by WordPress to initiate all plugin functionality
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
There were no executable files found in this plugin150 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin