82% woo-ecommerce-tracking-for-google-and-facebook

Code Review | Enhanced Ecommerce Google Analytics for WooCommerce

WordPress plugin Enhanced Ecommerce Google Analytics for WooCommerce scored82%from 54 tests.

About plugin

  • Plugin page: woo-ecommerce-tra...
  • Plugin version: 3.7.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.3.2
  • WordPress version: 6.3.1
  • First release: Oct 29, 2015
  • Latest release: Oct 16, 2023
  • Number of updates: 207
  • Update frequency: every 14.1 days
  • Top authors: dots (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

3,000+ active /66,318 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼10.19ms] Passed 4 tests

Server-side resources used by Enhanced Ecommerce Google Analytics for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0037.84 ▲1.18
Dashboard /wp-admin3.31 ▼0.0447.48 ▼14.41
Posts /wp-admin/edit.php3.36 ▲0.0045.80 ▼10.24
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.88 ▼16.44
Media Library /wp-admin/upload.php3.24 ▲0.0035.94 ▲0.34

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 260 new files
Database: no new tables, 9 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
fs_accounts
can_compress_scripts
fs_active_plugins
fs_debug_mode
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Enhanced Ecommerce Google Analytics for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.17 ▼0.381.81 ▼0.0946.11 ▲6.76
Dashboard /wp-admin2,198 ▲245.64 ▲0.1095.22 ▲7.4441.76 ▲3.09
Posts /wp-admin/edit.php2,100 ▼01.99 ▼0.0332.47 ▼8.9633.68 ▼5.27
Add New Post /wp-admin/post-new.php1,531 ▲523.21 ▼0.40690.74 ▼8.9556.06 ▼6.81
Media Library /wp-admin/upload.php1,400 ▼04.20 ▼0.0497.93 ▼11.3741.90 ▼4.72

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
  • Zombie WordPress options were found after uninstall: 9 options
    • fs_active_plugins
    • theysaidso_admin_options
    • fs_debug_mode
    • can_compress_scripts
    • fs_accounts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/woo-ecommerce-tracking-for-google-and-facebook/admin/partials/advance-ecommerce-tracking-admin-display.php
    • > /wp-content/plugins/woo-ecommerce-tracking-for-google-and-facebook/public/partials/advance-ecommerce-tracking-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Donate link: Invalid URI ("")
The official readme.txt might help

woo-ecommerce-tracking-for-google-and-facebook/advance-ecommerce-tracking.php 77% from 13 tests

"Enhanced Ecommerce Google Analytics for WooCommerce" version 3.7.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woo-ecommerce-tracking-for-google-and-facebook.php" instead of "advance-ecommerce-tracking.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Requires at least: Required version does not match the one declared in readme.txt ("5.0" instead of "5.3")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin41,133 lines of code in 167 files:
LanguageFilesBlank linesComment linesLines of code
PHP1378,38918,44836,747
CSS21139672,229
PO File1255297889
SVG300692
JavaScript477104560
XML13016

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,088)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity84.88
▷ Minimum class complexity1.00
▷ Maximum class complexity3,088.00
Average method complexity4.61
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes56
▷ Abstract classes23.57%
▷ Concrete classes5496.43%
▷ Final classes00.00%
Methods1,329
▷ Static methods20215.20%
▷ Public methods93170.05%
▷ Protected methods171.28%
▷ Private methods38128.67%
Functions134
▷ Named functions13399.25%
▷ Anonymous functions10.75%
Constants155
▷ Global constants10869.68%
▷ Class constants4730.32%
▷ Public constants47100.00%

Plugin size 0% from 2 tests

Image compression 0% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
36 PNG files occupy 3.00MB with 1.95MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/eet.png169.78KB78.92KB▼ 53.52%
admin/images/selector.png73.45KB36.14KB▼ 50.80%
(invalid) admin/images/pro-features-img/feature-box-five-img.png98.39KB0.00KB▼ 100.00%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
admin/images/ec_step4.png99.49KB27.24KB▼ 72.62%