78% gtm-ecommerce-woo

Code Review | GTM for WooCommerce FREE

WordPress plugin GTM for WooCommerce FREE scored78%from 54 tests.

About plugin

  • Plugin page: gtm-ecommerce-woo
  • Plugin version: 1.10.28
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Nov 26, 2020
  • Latest release: Nov 10, 2023
  • Number of updates: 77
  • Update frequency: every 14.0 days
  • Top authors: handcraftbyte (75.32%)tagconcierge (25.97%)

Code review

54 tests

User reviews

7 reviews

Install metrics

3,000+ active /60,229 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼5.77ms] Passed 4 tests

An overview of server-side resources used by GTM for WooCommerce FREE
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0543.35 ▲4.48
Dashboard /wp-admin3.40 ▲0.0645.32 ▼20.19
Posts /wp-admin/edit.php3.52 ▲0.1651.94 ▲2.32
Add New Post /wp-admin/post-new.php5.98 ▲0.1087.48 ▼9.67
Media Library /wp-admin/upload.php3.32 ▲0.1038.54 ▲7.41
Google Tag Manager /wp-admin/options-general.php?page=gtm-ecommerce-woo3.3231.14

Server storage [IO: ▲0.11MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 31 new files
Database: no new tables, 11 new options
New WordPress options
theysaidso_admin_options
gtm_ecommerce_woo_event_add_to_cart
widget_recent-comments
gtm_ecommerce_woo_event_purchase
gtm_ecommerce_woo_previous_uuids
gtm_ecommerce_woo_earliest_active_at
gtm_ecommerce_woo_uuid
widget_theysaidso_widget
widget_recent-posts
db_upgraded
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for GTM for WooCommerce FREE
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲4914.14 ▼0.211.76 ▼0.0743.53 ▲0.18
Dashboard /wp-admin2,202 ▲245.62 ▼0.1083.69 ▼32.5039.82 ▼3.87
Posts /wp-admin/edit.php2,104 ▲41.96 ▼0.0739.21 ▲3.1534.53 ▼2.54
Add New Post /wp-admin/post-new.php1,529 ▼023.11 ▲0.01641.53 ▼24.1047.31 ▼3.67
Media Library /wp-admin/upload.php1,401 ▲14.22 ▲0.01101.24 ▲2.6040.11 ▼0.46
Google Tag Manager /wp-admin/options-general.php?page=gtm-ecommerce-woo1,1341.9127.2240.06

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 11 options
    • widget_recent-comments
    • gtm_ecommerce_woo_previous_uuids
    • widget_recent-posts
    • widget_theysaidso_widget
    • gtm_ecommerce_woo_event_add_to_cart
    • gtm_ecommerce_woo_event_purchase
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • gtm_ecommerce_woo_uuid
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=gtm-ecommerce-woo
    • > Notice in wp-content/plugins/gtm-ecommerce-woo/src/Service/SettingsService.php+345
    Undefined index: disabled
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=gtm-ecommerce-woo
    • > Notice in wp-content/plugins/gtm-ecommerce-woo/src/Service/SettingsService.php+348
    Undefined index: title

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
Please take a closer look at the following
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function GtmEcommerceWoo\\get_file_data() in wp-content/plugins/gtm-ecommerce-woo/gtm-ecommerce-woo.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'GtmEcommerceWoo\\Lib\\EventStrategy\\AbstractEventStrategy' not found in wp-content/plugins/gtm-ecommerce-woo/src/EventStrategy/AddToCartStrategy.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'GtmEcommerceWoo\\Lib\\EventStrategy\\AbstractEventStrategy' not found in wp-content/plugins/gtm-ecommerce-woo/src/EventStrategy/PurchaseStrategy.php:7

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
6 plugin tags: google analytics, facebook pixel, microsoft uet, ecommerce events, google tag manager...

gtm-ecommerce-woo/gtm-ecommerce-woo.php 85% from 13 tests

This is the main PHP file of "GTM for WooCommerce FREE" version 1.10.28, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Requires at least: The required version number must match the one declared in readme.txt ("5.1.0" instead of "4.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected2,110 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP254275341,944
JavaScript32725161
JSON1005

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity11.16
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces8
Interfaces0
Traits0
Classes19
▷ Abstract classes15.26%
▷ Concrete classes1894.74%
▷ Final classes00.00%
Methods141
▷ Static methods1812.77%
▷ Public methods13797.16%
▷ Protected methods21.42%
▷ Private methods21.42%
Functions12
▷ Named functions18.33%
▷ Anonymous functions1191.67%
Constants6
▷ Global constants00.00%
▷ Class constants6100.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin