73% goal-tracker-ga

Code Review | Goal Tracker - Custom Event Tracking for GA4

WordPress plugin Goal Tracker - Custom Event Tracking for GA4 scored73%from 54 tests.

About plugin

  • Plugin page: goal-tracker-ga
  • Plugin version: 1.0.16
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.3.2
  • WordPress version: 6.3.1
  • First release: Sep 15, 2022
  • Latest release: Nov 8, 2023
  • Number of updates: 25
  • Update frequency: every 16.8 days
  • Top authors: yuvalo (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

2,000+ active /10,469 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲5.41MB] [CPU: ▲20.17ms] 75% from 4 tests

An overview of server-side resources used by Goal Tracker - Custom Event Tracking for GA4
It is recommended to improve the following
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.41MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.22 ▲5.7562.24 ▲24.34
Dashboard /wp-admin9.24 ▲5.9368.89 ▲18.19
Posts /wp-admin/edit.php9.24 ▲5.8881.96 ▲34.66
Add New Post /wp-admin/post-new.php9.97 ▲4.08108.43 ▲7.99
Media Library /wp-admin/upload.php9.24 ▲6.0166.15 ▲30.15
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius9.2460.05

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 336 new files
Database: no new tables, 11 new options
New WordPress options
fs_accounts
fs_active_plugins
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
fs_debug_mode
wp_goal_tracker_ga_options
gtga_activation_timestamp
...

Browser metrics Passed 4 tests

Goal Tracker - Custom Event Tracking for GA4: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,953 ▲19113.62 ▼0.6615.21 ▲13.2632.49 ▼11.63
Dashboard /wp-admin2,246 ▲685.62 ▼0.0085.52 ▼14.4643.63 ▲3.45
Posts /wp-admin/edit.php2,152 ▲521.99 ▼0.0136.07 ▼1.2735.18 ▼0.73
Add New Post /wp-admin/post-new.php1,544 ▲1823.55 ▲0.45665.24 ▼20.8164.58 ▲8.43
Media Library /wp-admin/upload.php1,448 ▲454.17 ▼0.0496.88 ▼5.9743.91 ▼2.34
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,1031.6724.4528.50

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/goal-tracker-ga/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 11 options
    • fs_accounts
    • wp_goal_tracker_ga_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • gtga_activation_timestamp
    • fs_debug_mode
    • fs_active_plugins
    • widget_recent-posts
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/goal-tracker-ga/admin/partials/wp-goal-tracker-display.php
    • > /wp-content/plugins/goal-tracker-ga/public/partials/wp-goal-tracker-ga-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

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
4 plugin tags: ga4, analytics, wordpress, events

goal-tracker-ga/goal-tracker-ga.php 92% from 13 tests

Analyzing the main PHP file in "Goal Tracker - Custom Event Tracking for GA4" version 1.0.16
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin44,712 lines of code in 260 files:
LanguageFilesBlank linesComment linesLines of code
PHP1318,22818,27534,227
TypeScript503811424,242
JavaScript392653163,257
CSS163151162,375
SVG18210489
XML20064
JSON40058

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity77.76
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.49
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes58
▷ Abstract classes23.45%
▷ Concrete classes5696.55%
▷ Final classes00.00%
Methods1,326
▷ Static methods20315.31%
▷ Public methods91969.31%
▷ Protected methods171.28%
▷ Private methods39029.41%
Functions133
▷ Named functions12190.98%
▷ Anonymous functions129.02%
Constants149
▷ Global constants10268.46%
▷ Class constants4731.54%
▷ Public constants47100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
20 PNG files occupy 0.76MB with 0.39MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
common/ui/src/assets/images/help-measurement-id.png57.44KB17.25KB▼ 69.98%
public/images/icon-256x256.png9.25KB3.02KB▼ 67.36%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
common/ui/src/assets/images/search-400.png3.38KB3.21KB▼ 5.31%
apps/basic/build/images/help-measurement-id.2f22bbe3.png57.44KB17.25KB▼ 69.98%