89% woocommerce-google-analytics-integration

Code Review | WooCommerce Google Analytics Integration

WordPress plugin WooCommerce Google Analytics Integration scored89%from 54 tests.

About plugin

  • Plugin page: woocommerce-googl...
  • Plugin version: 1.8.10
  • PHP version: 7.4.16
  • WordPress compatibility: 6.8-6.4
  • WordPress version: 6.3.1
  • First release: Nov 25, 2013
  • Latest release: Nov 28, 2023
  • Number of updates: 108
  • Update frequency: every 35.6 days
  • Top authors: automattic (27.78%)bor0 (18.52%)cshultz88 (8.33%)mikkamp (8.33%)mppellicer (7.41%)

Code review

54 tests

User reviews

95 reviews

Install metrics

200,000+ active /5,804,311 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼8.92ms] Passed 4 tests

A check of server-side resources used by WooCommerce Google Analytics Integration
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0234.87 ▼9.83
Dashboard /wp-admin3.31 ▼0.0345.00 ▼19.13
Posts /wp-admin/edit.php3.37 ▲0.0148.81 ▼0.52
Add New Post /wp-admin/post-new.php5.90 ▲0.0189.53 ▼6.18
Media Library /wp-admin/upload.php3.24 ▲0.0132.63 ▲2.31

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Google Analytics Integration
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲2214.72 ▲0.511.82 ▼0.2038.39 ▼8.98
Dashboard /wp-admin2,202 ▲255.58 ▼0.0493.78 ▼1.7944.76 ▲0.17
Posts /wp-admin/edit.php2,107 ▲72.00 ▼0.0239.65 ▼1.0236.66 ▲1.67
Add New Post /wp-admin/post-new.php1,530 ▲423.24 ▼0.20623.06 ▼27.3847.95 ▼1.78
Media Library /wp-admin/upload.php1,404 ▲44.24 ▲0.0794.87 ▼1.2641.67 ▼0.83

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
2 plugin tags: google analytics, woocommerce

woocommerce-google-analytics-integration/woocommerce-google-analytics-integration.php 77% from 13 tests

The entry point to "WooCommerce Google Analytics Integration" version 1.8.10 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Domain Path: Prefix the domain path with a forward slash character ("/languages/")
  • Requires at least: Required version must match the one declared in readme.txt ("3.9" instead of "6.8")
  • Domain Path: The domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin1,409 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP93347051,406
JavaScript3003

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity28.00
▷ Minimum class complexity1.00
▷ Maximum class complexity62.00
Average method complexity2.72
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes116.67%
▷ Concrete classes583.33%
▷ Final classes00.00%
Methods105
▷ Static methods3331.43%
▷ Public methods8984.76%
▷ Protected methods1514.29%
▷ Private methods10.95%
Functions3
▷ Named functions00.00%
▷ Anonymous functions3100.00%
Constants4
▷ Global constants250.00%
▷ Class constants250.00%
▷ Public constants150.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin