84% easy-hotjar

Code Review | Easy Hotjar WordPress

WordPress plugin Easy Hotjar WordPress scored84%from 54 tests.

About plugin

  • Plugin page: easy-hotjar
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.5.1
  • WordPress version: 6.3.1
  • First release: May 7, 2016
  • Latest release: May 12, 2016
  • Number of updates: 4
  • Update frequency: every 0.8 days
  • Top authors: jokioki (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /11,239 total downloads

Benchmarks

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: ▲0.00MB] [CPU: ▼10.86ms] Passed 4 tests

This is a short check of server-side resources used by Easy Hotjar WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.41 ▼0.0526.67 ▼15.43
Dashboard /wp-admin3.34 ▼0.0149.61 ▼15.11
Posts /wp-admin/edit.php3.45 ▲0.0948.70 ▲2.12
Add New Post /wp-admin/post-new.php5.92 ▲0.0389.60 ▼12.12
Media Library /wp-admin/upload.php3.26 ▲0.0337.22 ▼0.79

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Easy Hotjar WordPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲5213.36 ▼0.931.74 ▼0.1843.72 ▲0.69
Dashboard /wp-admin2,222 ▲344.86 ▼0.03101.60 ▼4.8441.91 ▼1.44
Posts /wp-admin/edit.php2,105 ▲162.03 ▲0.0138.36 ▲3.0236.51 ▼2.14
Add New Post /wp-admin/post-new.php1,548 ▲2923.10 ▲0.02689.38 ▲29.1058.33 ▼8.31
Media Library /wp-admin/upload.php1,404 ▲164.21 ▲0.0795.84 ▼20.0848.39 ▲2.19

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/easy-hotjar/admin/partials/easy-hotjar-wordpress.php:86

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
1 plugin tags: hotjar wordpress plugin javascript social

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

Analyzing the main PHP file in "Easy Hotjar WordPress" version 1.0
57 characters long description:
Get Hotjar up and running on your WordPress with 2 clicks

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin362 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP563190298
CSS20464

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.18
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods17
▷ Static methods15.88%
▷ Public methods1482.35%
▷ Protected methods00.00%
▷ Private methods317.65%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ 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
5 PNG files occupy 0.08MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/hotjar2.png15.03KB6.15KB▼ 59.11%
admin/img/header-logo.png1.17KB1.16KB▼ 1.25%
admin/img/hotjar1.png24.99KB15.87KB▼ 36.51%
admin/img/easyplugins.png26.03KB10.99KB▼ 57.77%
admin/img/hotjar3.png10.28KB4.73KB▼ 53.99%