84% gravity-forms-google-analytics-event-tracking

Code Review | Event Tracking for Gravity Forms

WordPress plugin Event Tracking for Gravity Forms scored84%from 54 tests.

About plugin

  • Plugin page: gravity-forms-goo...
  • Plugin version: 2.4.14
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.2
  • WordPress version: 6.3.1
  • First release: Dec 1, 2014
  • Latest release: Mar 18, 2023
  • Number of updates: 141
  • Update frequency: every 21.5 days
  • Top authors: ronalfy (69.5%)nmarks (30.5%)rocketgenius (1.42%)

Code review

54 tests

User reviews

37 reviews

Install metrics

30,000+ active /554,067 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼7.04ms] Passed 4 tests

Analyzing server-side resources used by Event Tracking for Gravity Forms
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0343.76 ▲4.32
Dashboard /wp-admin3.34 ▼0.0144.22 ▼13.63
Posts /wp-admin/edit.php3.39 ▲0.0344.86 ▼2.67
Add New Post /wp-admin/post-new.php5.92 ▲0.0390.69 ▼11.14
Media Library /wp-admin/upload.php3.26 ▲0.0334.42 ▼0.70

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Event Tracking for Gravity Forms
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.22 ▼1.361.93 ▲0.0948.93 ▲7.05
Dashboard /wp-admin2,209 ▲214.87 ▼1.03101.96 ▲1.3739.10 ▼5.61
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0440.90 ▲0.4334.57 ▼1.16
Add New Post /wp-admin/post-new.php1,514 ▼1617.65 ▼0.38659.13 ▼20.6251.98 ▼18.13
Media Library /wp-admin/upload.php1,388 ▼04.20 ▼0.0194.28 ▼8.5542.28 ▼4.40

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

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
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'GFForms' not found in wp-content/plugins/gravity-forms-google-analytics-event-tracking/includes/GFGAET_Pagination_Settings.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'GFForms' not found in wp-content/plugins/gravity-forms-google-analytics-event-tracking/includes/GFGAET_Partial_Entries.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'GFForms' not found in wp-content/plugins/gravity-forms-google-analytics-event-tracking/includes/GFGAET_UA.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'GFForms' not found in wp-content/plugins/gravity-forms-google-analytics-event-tracking/includes/GFGAET_Submission_Feeds.php:12

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

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: event tracking, matomo, piwik, google tag manager, gravity forms...

gravity-forms-google-analytics-event-tracking/gravity-forms-event-tracking.php 92% from 13 tests

The main PHP script in "Event Tracking for Gravity Forms" version 2.4.14 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("gravity-forms-google-analytics-event-tracking.php" instead of "gravity-forms-event-tracking.php")

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
There were no executable files found in this plugin2,016 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP93229671,861
SVG30165
CSS11156
JavaScript20034

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity25.00
▷ Minimum class complexity2.00
▷ Maximum class complexity94.00
Average method complexity3.04
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods94
▷ Static methods1819.15%
▷ Public methods7680.85%
▷ Protected methods00.00%
▷ Private methods1819.15%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.13MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/analytics.png9.84KB5.20KB▼ 47.20%
img/gravity-forms-ga-addon-horizontal.png54.49KB20.72KB▼ 61.97%
img/google-brands.png11.66KB6.43KB▼ 44.84%
img/gravity-forms-logo-horizontal.png5.09KB2.64KB▼ 48.24%
img/gtm.png51.81KB19.59KB▼ 62.18%