78% oc-hotjar

Code Review | HotJar

WordPress plugin HotJar scored78%from 54 tests.

About plugin

  • Plugin page: oc-hotjar
  • Plugin version: 0.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.1
  • WordPress version: 6.3.1
  • First release: Dec 20, 2017
  • Latest release: Dec 20, 2017
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: owencutajar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /4,742 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼8.41ms] Passed 4 tests

Server-side resources used by HotJar
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.12 ▼3.18
Dashboard /wp-admin3.32 ▼0.0250.31 ▼16.13
Posts /wp-admin/edit.php3.37 ▲0.0251.60 ▼2.00
Add New Post /wp-admin/post-new.php5.90 ▲0.0295.12 ▼12.34
Media Library /wp-admin/upload.php3.25 ▲0.0234.43 ▼1.93
HotJar /wp-admin/options-general.php?page=hotjar3.2433.33

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

HotJar: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5813.21 ▼0.971.83 ▼0.3942.31 ▼2.39
Dashboard /wp-admin2,225 ▲194.82 ▼0.09109.65 ▼8.9741.58 ▼1.69
Posts /wp-admin/edit.php2,104 ▲12.00 ▲0.0139.69 ▼0.1536.71 ▲4.55
Add New Post /wp-admin/post-new.php1,557 ▲2618.32 ▼4.68604.91 ▼90.7752.70 ▼10.89
Media Library /wp-admin/upload.php1,404 ▲104.24 ▼0.0199.35 ▲0.1543.31 ▲1.39
HotJar /wp-admin/options-general.php?page=hotjar7081.146.8821.59

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=hotjar
    • > Error in wp-admin/includes/template.php+1801
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/oc-hotjar/templates/settings.php on line 14 and exactly 2 expected in wp-admin/includes/template.php:1801
    Stack trace:
    #0 wp-content/plugins/oc-hotjar/templates/settings.php(14): do_settings_fields()
    #1 wp-content/plugins/oc-hotjar/settings.php(112): include('/var/www/wordpr...')
    #2 wp-includes/class-wp-hook.php(310): WP_HotJar_Settings->plugin_settings_page()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #7 {main}
    thrown

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
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/oc-hotjar/oc-hotjar.php:107
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/oc-hotjar/templates/settings.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Please add an image for screenshot #1 (To Be Supplied)
You can look at the official readme.txt

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

The main file in "HotJar" v. 0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
62 characters long description:
A simple way to get HotJar integrated into your WordPress site

Code Analysis Passed 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
No dangerous file extensions were detected141 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP33869141

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity2.50
▷ Minimum class complexity2.00
▷ Maximum class complexity3.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods325.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/hotjar-logo.png4.15KB3.31KB▼ 20.24%