77% woo-google-analytics-enhanced-ecommerce

Code Review | WooCommerce Google Analytics Enhanced Ecommerce

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

About plugin

  • Plugin page: woo-google-analyt...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.8
  • WordPress version: 6.3.1
  • First release: Nov 26, 2017
  • Latest release: Nov 26, 2017
  • Number of updates: 4
  • Update frequency: every 1.5 days
  • Top authors: universalwebservices (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,118 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.06MB] [CPU: ▼1.83ms] Passed 4 tests

An overview of server-side resources used by WooCommerce Google Analytics Enhanced Ecommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0744.25 ▲2.45
Dashboard /wp-admin3.36 ▲0.0652.26 ▼4.70
Posts /wp-admin/edit.php3.41 ▲0.0553.77 ▲3.09
Add New Post /wp-admin/post-new.php5.96 ▲0.0791.77 ▼8.16
Media Library /wp-admin/upload.php3.28 ▲0.0640.88 ▲6.19
WooCommerce Google Analytics Enhanced Ecommerce /wp-admin/options-general.php?page=wc-ga-enhanced-ecommerce3.2536.51

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 17 new files
Database: no new tables, 7 new options
New WordPress options
wc_ga_ee_activation_date
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Google Analytics Enhanced Ecommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,911 ▲15013.82 ▼0.719.07 ▲7.4642.17 ▼0.48
Dashboard /wp-admin2,201 ▲275.52 ▼0.0285.80 ▼2.9040.69 ▼3.62
Posts /wp-admin/edit.php2,109 ▲91.98 ▼0.0540.70 ▲5.0235.99 ▼7.22
Add New Post /wp-admin/post-new.php1,531 ▼623.31 ▲5.11695.72 ▲5.9656.76 ▼12.46
Media Library /wp-admin/upload.php1,403 ▲64.18 ▼0.04106.95 ▲2.6446.22 ▲4.34
WooCommerce Google Analytics Enhanced Ecommerce /wp-admin/options-general.php?page=wc-ga-enhanced-ecommerce8602.1825.8028.47

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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 detected upon uninstall: 7 options
    • theysaidso_admin_options
    • wc_ga_ee_activation_date
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/woo-google-analytics-enhanced-ecommerce/woocommerce-google-analytics-enhanced-ecommerce.php
  • 9× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-google-analytics-enhanced-ecommerce/admin/settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-google-analytics-enhanced-ecommerce/ajax/cart.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-google-analytics-enhanced-ecommerce/admin/rating.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-google-analytics-enhanced-ecommerce/tracking/cart.php:83
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-google-analytics-enhanced-ecommerce/tracking/impression.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-google-analytics-enhanced-ecommerce/tracking/purchase.php:82
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-google-analytics-enhanced-ecommerce/tracking/product-view.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-google-analytics-enhanced-ecommerce/tracking/checkout.php:78
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-google-analytics-enhanced-ecommerce/tracking/ga-setup.php:30

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)
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention: The official readme.txt is a good inspiration

woo-google-analytics-enhanced-ecommerce/woocommerce-google-analytics-enhanced-ecommerce.php 85% from 13 tests

The main PHP file in "WooCommerce Google Analytics Enhanced Ecommerce" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woo-google-analytics-enhanced-ecommerce.php" instead of "woocommerce-google-analytics-enhanced-ecommerce.php")
  • 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 Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin642 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP1117028476
JavaScript25811166

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions21
▷ Named functions21100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
src/tracking-id-location.png65.08KB31.22KB▼ 52.03%