10% sws-hotjar

Code Review | Hotjar for WordPress

WordPress plugin Hotjar for WordPress scored10%from 54 tests.

About plugin

  • Plugin page: sws-hotjar
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.9.2
  • WordPress version: 6.3.1
  • First release: Jan 25, 2018
  • Latest release: Jan 26, 2018
  • Number of updates: 8
  • Update frequency: every 105.6 days
  • Top authors: stoute (100%)

Code review

54 tests

User reviews

1 review

Install metrics

500+ active /6,014 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Parse error in wp-content/plugins/sws-hotjar/sws_hotjar.php+121
    syntax error, unexpected end of file

Server metrics [RAM: ▲0.00MB] [CPU: ▼8.17ms] Passed 4 tests

An overview of server-side resources used by Hotjar for WordPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.28 ▼6.92
Dashboard /wp-admin3.31 ▲0.0049.61 ▼3.42
Posts /wp-admin/edit.php3.36 ▲0.0054.06 ▼0.62
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.87 ▼21.73
Media Library /wp-admin/upload.php3.23 ▲0.0039.44 ▲1.18

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Hotjar for WordPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▲0.161.70 ▼0.2544.71 ▼0.20
Dashboard /wp-admin2,195 ▲185.59 ▼0.0492.55 ▼10.0037.76 ▼4.67
Posts /wp-admin/edit.php2,100 ▼01.98 ▼0.0543.40 ▲3.8637.64 ▲0.75
Add New Post /wp-admin/post-new.php1,528 ▲323.02 ▲0.13666.52 ▲30.7154.14 ▲1.31
Media Library /wp-admin/upload.php1,400 ▼34.12 ▼0.16109.41 ▲7.5945.16 ▲2.71

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Parse error
      syntax error, unexpected end of file in wp-content/plugins/sws-hotjar/sws_hotjar.php on line 121

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === sws-hotjar === )
The official readme.txt might help

sws-hotjar/sws_hotjar.php 85% from 13 tests

The main PHP file in "Hotjar for WordPress" ver. 1.2.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("sws-hotjar.php" instead of "sws_hotjar.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin82 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2301180
Markdown1002

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.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
5 PNG files occupy 0.30MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/screenshot-5.png24.28KB8.63KB▼ 64.48%
images/screenshot-2.png28.87KB11.07KB▼ 61.66%
images/screenshot-1.png203.53KB74.18KB▼ 63.55%
images/screenshot-3.png21.47KB7.64KB▼ 64.39%
images/screenshot-4.png24.55KB8.91KB▼ 63.71%