66% wp-google-analytics-events

Code Review | WP Google Analytics Events - No-Code Custom Event Tracking for Google Analytics

WordPress plugin WP Google Analytics Events - No-Code Custom Event Tracking for Google Analytics scored66%from 54 tests.

About plugin

  • Plugin page: wp-google-analyti...
  • Plugin version: 2.8.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2
  • WordPress version: 6.3.1
  • First release: Jun 5, 2013
  • Latest release: Jul 2, 2023
  • Number of updates: 69
  • Update frequency: every 53.3 days
  • Top authors: yuvalo (100%)

Code review

54 tests

User reviews

33 reviews

Install metrics

10,000+ active /309,306 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.34MB] [CPU: ▼2.87ms] Passed 4 tests

This is a short check of server-side resources used by WP Google Analytics Events - No-Code Custom Event Tracking for Google Analytics
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2139.83 ▼3.46
Dashboard /wp-admin3.73 ▲0.4247.52 ▼4.09
Posts /wp-admin/edit.php3.78 ▲0.4246.58 ▲1.11
Add New Post /wp-admin/post-new.php6.24 ▲0.3689.56 ▼5.05
Media Library /wp-admin/upload.php3.59 ▲0.3639.36 ▲7.76
Scroll Tracking /wp-admin/admin.php?page=wp-google-analytics-events-scroll3.6141.25
General Settings /wp-admin/admin.php?page=wp-google-analytics-events3.5632.14
Upgrade Now /wp-admin/admin.php?page=wp-google-analytics-events-upgrade3.5332.28
Getting Started Guide /wp-admin/admin.php?page=wp-google-analytics-events-getstarted3.5635.40
What's New /wp-admin/admin.php?page=wp-google-analytics-events-whatsnew3.5630.63
Click Tracking /wp-admin/admin.php?page=wp-google-analytics-events-click3.6134.89

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 75 new files
Database: no new tables, 9 new options
New WordPress options
ga_events_activation_date
widget_theysaidso_widget
ga_events_options
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
GA_EVENTS_version

Browser metrics Passed 4 tests

An overview of browser requirements for WP Google Analytics Events - No-Code Custom Event Tracking for Google Analytics
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,975 ▲24013.73 ▼0.848.71 ▲6.7242.31 ▼0.21
Dashboard /wp-admin2,300 ▲1125.84 ▼0.0099.50 ▼12.0289.56 ▲43.56
Posts /wp-admin/edit.php2,182 ▲932.15 ▲0.1234.53 ▼1.8538.20 ▲3.56
Add New Post /wp-admin/post-new.php1,667 ▲15322.77 ▲5.09680.33 ▼2.4744.56 ▼10.13
Media Library /wp-admin/upload.php1,479 ▲914.26 ▲0.10100.00 ▼9.6381.44 ▲37.14
Scroll Tracking /wp-admin/admin.php?page=wp-google-analytics-events-scroll1,45312.93175.0251.32
General Settings /wp-admin/admin.php?page=wp-google-analytics-events1,29015.37175.2663.61
Upgrade Now /wp-admin/admin.php?page=wp-google-analytics-events-upgrade6857.28108.8426.37
Getting Started Guide /wp-admin/admin.php?page=wp-google-analytics-events-getstarted79010.52114.4539.06
What's New /wp-admin/admin.php?page=wp-google-analytics-events-whatsnew82210.51107.5333.86
Click Tracking /wp-admin/admin.php?page=wp-google-analytics-events-click1,44610.97129.7744.50

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_recent-posts
    • GA_EVENTS_version
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • ga_events_activation_date
    • theysaidso_admin_options
    • ga_events_options

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=wp-google-analytics-events-upgrade
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'ga_events_settings_page' not found or invalid function name

SRP 0% 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
Please take a closer look at the following
  • 6× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-google-analytics-events/ga-scroll-event.php
    • > /wp-content/plugins/wp-google-analytics-events/templates/getting-started-guide-section.php
    • > /wp-content/plugins/wp-google-analytics-events/templates/whats-new-section-content.php
    • > /wp-content/plugins/wp-google-analytics-events/include/Settings.php
    • > /wp-content/plugins/wp-google-analytics-events/include/Activation.php
    • > /wp-content/plugins/wp-google-analytics-events/main-plugin-file-sketch.php
  • 14× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/wp-google-analytics-events/include/TrackingTable.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/wp-google-analytics-events/templates/scroll-tracking-modals.php:52
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-google-analytics-events/include/TrackingTable.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-google-analytics-events/include/saved-snippets.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/wp-google-analytics-events/templates/click-tracking-modals.php:52
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-google-analytics-events/include/TrackingTable.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'GAE_PLUGIN_PATHinclude/TrackingTable.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-google-analytics-events/templates/scroll-elements-input-table.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/wp-google-analytics-events/templates/reports.php:3
    • > PHP Fatal error
      require_once(): Failed opening required 'GAE_PLUGIN_PATHinclude/TrackingTable.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-google-analytics-events/templates/click-elements-input-table.php on line 3
    • > PHP Warning
      Use of undefined constant GAE_PLUGIN_PATH - assumed 'GAE_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-google-analytics-events/templates/click-elements-input-table.php on line 3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-google-analytics-events-click
    • > Console-api (warning) in unknown
    https://cdn.tailwindcss.com/ 61:1708 "cdn.tailwindcss.com should not be used in production. To use Tailwind CSS in production, install it as a PostCSS plugin or use the Tailwind CLI: https://tailwindcss.com/docs/installation"
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-google-analytics-events-click
    • > Console-api (warning) in unknown
    /wp-content/plugins/wp-google-analytics-events/js/dist/admin-scripts-libs.js?ver=1 4049:17 "jQuery.Deferred exception: Cannot set properties of null (setting 'innerHTML')" "TypeError: Cannot set properties of null (setting 'innerHTML')\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/wp-google-analytics-events/js/dist/admin-scripts.min.js?ver=1:6:21)\n at mightThrow (/wp-content/plugins/wp-google-analytics-events/js/dist/admin-scripts-libs.js?ver=1:3766:29)\n at process (/wp-content/plugins/wp-google-analytics-events/js/dist/admin-scripts-libs.js?ver=1:3834:12)" undefined
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-google-analytics-events-click
    • > Javascript (severe) in unknown
    /wp-content/plugins/wp-google-analytics-events/js/dist/admin-scripts-libs.js?ver=1 4058:2 Uncaught TypeError: Cannot set properties of null (setting 'innerHTML')

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention: The official readme.txt might help

wp-google-analytics-events/ga-scroll-event.php 92% from 13 tests

"WP Google Analytics Events - No-Code Custom Event Tracking for Google Analytics" version 2.8.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-google-analytics-events.php" instead of "ga-scroll-event.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin20,495 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript224,7124,23916,723
PHP195252802,890
CSS414836850
SVG12031
JSON1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity26.82
▷ Minimum class complexity1.00
▷ Maximum class complexity79.00
Average method complexity3.96
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods98
▷ Static methods2626.53%
▷ Public methods9495.92%
▷ Protected methods11.02%
▷ Private methods33.06%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
25 PNG files occupy 0.86MB with 0.32MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/bg_icon_support.png2.35KB1.26KB▼ 46.49%
click-tracking-page.png139.81KB44.43KB▼ 68.22%
css/third-party/images/ui-icons_777620_256x240.png4.51KB4.18KB▼ 7.28%
images/wpflow-logo-banner.png35.67KB12.03KB▼ 66.28%
images/ga-help.png0.46KB0.45KB0.21%