79% advance-wc-analytics

Code Review | WooCommerce Google Analytics Integration By Advanced WC Analytics

WordPress plugin WooCommerce Google Analytics Integration By Advanced WC Analytics scored79%from 54 tests.

About plugin

  • Plugin page: advance-wc-analytics
  • Plugin version: 3.4.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7.0-6.4
  • WordPress version: 6.3.1
  • First release: May 9, 2020
  • Latest release: Nov 20, 2023
  • Number of updates: 58
  • Update frequency: every 22.2 days
  • Top authors: passionatebrains (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

600+ active /6,955 total downloads

Benchmarks

Plugin footprint 65% 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 gracefully, with no errors

Server metrics [RAM: ▲5.02MB] [CPU: ▲17.94ms] 75% from 4 tests

Analyzing server-side resources used by WooCommerce Google Analytics Integration By Advanced WC Analytics
It is recommended to improve the following
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.02MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.93 ▲5.4760.39 ▲16.34
Dashboard /wp-admin8.95 ▲5.6176.27 ▲16.03
Posts /wp-admin/edit.php8.95 ▲5.6085.51 ▲36.44
Add New Post /wp-admin/post-new.php9.28 ▲3.40108.85 ▲14.10
Media Library /wp-admin/upload.php8.95 ▲5.7264.31 ▲25.30
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius8.9560.73

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 219 new files
Database: no new tables, 9 new options
New WordPress options
fs_debug_mode
widget_recent-comments
fs_active_plugins
widget_theysaidso_widget
theysaidso_admin_options
fs_accounts
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for WooCommerce Google Analytics Integration By Advanced WC Analytics
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,860 ▲9814.71 ▼0.001.88 ▲0.1528.97 ▼14.89
Dashboard /wp-admin2,237 ▲575.57 ▼0.0997.05 ▼6.3346.03 ▲2.47
Posts /wp-admin/edit.php2,149 ▲492.17 ▲0.1443.05 ▲0.2739.82 ▲2.37
Add New Post /wp-admin/post-new.php1,551 ▲2523.21 ▲0.32619.41 ▼46.0853.52 ▲2.60
Media Library /wp-admin/upload.php1,445 ▲454.22 ▼0.0196.89 ▼23.2146.12 ▼1.46
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,1011.6626.8630.52

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/advance-wc-analytics/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • Zombie WordPress options detected upon uninstall: 9 options
    • db_upgraded
    • fs_active_plugins
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • fs_debug_mode
    • can_compress_scripts
    • widget_recent-posts
    • fs_accounts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% 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
5 plugin tags: analytics, e-commerce, enhanced e-commerce, woocommerce, google analytics

advance-wc-analytics/advance-wc-analytics.php 85% from 13 tests

The main PHP script in "WooCommerce Google Analytics Integration By Advanced WC Analytics" version 3.4.1 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 158 characters long)
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.0" instead of "3.7.0")

Code Analysis 97% from 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 plugin38,417 lines of code in 163 files:
LanguageFilesBlank linesComment linesLines of code
PHP1368,33617,58337,627
JavaScript1134153360
CSS15012216
Markdown1680214

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
These items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity81.35
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.60
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes61
▷ Abstract classes34.92%
▷ Concrete classes5895.08%
▷ Final classes00.00%
Methods1,410
▷ Static methods20214.33%
▷ Public methods97869.36%
▷ Protected methods312.20%
▷ Private methods40128.44%
Functions103
▷ Named functions10198.06%
▷ Anonymous functions21.94%
Constants153
▷ Global constants10568.63%
▷ Class constants4831.37%
▷ Public constants48100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
14 PNG files occupy 0.21MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assests/images/icon-5.png16.53KB7.78KB▼ 52.94%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assests/images/icon-1.png3.88KB1.95KB▼ 49.82%
assests/images/WoocommerceAnalytics.png26.15KB13.31KB▼ 49.11%
assests/images/icon-2.png1.47KB0.72KB▼ 50.93%