84% crazyegg-heatmap-tracking

Code Review | Crazy Egg

WordPress plugin Crazy Egg scored84%from 54 tests.

About plugin

  • Plugin page: crazyegg-heatmap-...
  • Plugin version: 2.11
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.2-6.4
  • WordPress version: 6.3.1
  • First release: Sep 15, 2011
  • Latest release: Nov 7, 2023
  • Number of updates: 58
  • Update frequency: every 76.5 days
  • Top authors: crazyegg (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

10,000+ active /213,772 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Crazy Egg
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0141.63 ▲1.45
Dashboard /wp-admin3.33 ▼0.0551.45 ▼45.24
Posts /wp-admin/edit.php3.38 ▲0.0249.99 ▼1.36
Add New Post /wp-admin/post-new.php5.91 ▲0.0290.67 ▲4.50
Media Library /wp-admin/upload.php3.25 ▲0.0237.04 ▲3.80

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Crazy Egg
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲6814.15 ▼0.231.95 ▲0.1340.63 ▼8.70
Dashboard /wp-admin2,210 ▲335.67 ▲0.0290.08 ▼0.6572.84 ▲32.29
Posts /wp-admin/edit.php2,118 ▲181.99 ▲0.0539.91 ▼1.9836.20 ▼2.42
Add New Post /wp-admin/post-new.php1,553 ▲1223.30 ▲0.39687.79 ▲5.9447.69 ▼12.10
Media Library /wp-admin/upload.php1,418 ▲154.22 ▼0.01106.92 ▼1.2566.08 ▲22.09

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/crazyegg-heatmap-tracking/views/options.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/crazyegg-heatmap-tracking/crazyegg-heatmap-tracking.php:83

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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
You can look at the official readme.txt

crazyegg-heatmap-tracking/crazyegg-heatmap-tracking.php Passed 13 tests

The primary PHP file in "Crazy Egg" version 2.11 is used by WordPress to initiate all plugin functionality
76 characters long description:
The easiest way to add the Crazy Egg tracking script to your WordPress blog!

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin85 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP214985

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.06
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

PNG files should be compressed to save space and minimize bandwidth usage
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/icon.png1.76KB0.69KB▼ 60.82%