79% advance-wc-analytics

Code Review | Advanced WC Analytics - Google Analytics Dashboard for WooCommerce

WordPress plugin Advanced WC Analytics - Google Analytics Dashboard for WooCommerce scored 79% from 54 tests.

About plugin

  • Plugin page: advance-wc-analytics
  • Plugin version: 3.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7.0-5.9
  • WordPress version: 5.8.1
  • First release: May 9, 2020
  • Latest release: Mar 3, 2022
  • Number of updates: 42
  • Update frequency: every 15.8 days
  • Top authors: passionatebrains (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

200+ active / 2,204 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: ▲4.70MB] [CPU: ▼120.34ms] Passed 4 tests

This is a short check of server-side resources used by Advanced WC Analytics - Google Analytics Dashboard for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /8.29 ▲5.4542.61 ▲20.59
Dashboard /wp-admin8.31 ▲5.2454.56 ▲18.42
Posts /wp-admin/edit.php8.31 ▲5.2051.45 ▲22.28
Add New Post /wp-admin/post-new.php8.48 ▲3.0490.72 ▼538.41
Media Library /wp-admin/upload.php8.31 ▲5.3041.33 ▲18.03
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius8.3139.20

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 204 new files
Database: no new tables, 4 new options
New WordPress options
fs_gdpr
fs_accounts
fs_debug_mode
fs_active_plugins

Browser metrics Passed 4 tests

A check of browser resources used by Advanced WC Analytics - Google Analytics Dashboard for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,728 ▲12715.90 ▲0.254.95 ▼0.6568.78 ▼7.33
Dashboard /wp-admin2,995 ▲996.12 ▼0.02114.00 ▼15.75183.91 ▲15.97
Posts /wp-admin/edit.php2,804 ▲673.38 ▲0.1467.98 ▲4.00162.85 ▲22.58
Add New Post /wp-admin/post-new.php3,769 ▼3818.98 ▲0.17417.29 ▼22.68160.36 ▼14.43
Media Library /wp-admin/upload.php1,811 ▲595.52 ▼0.00152.66 ▲9.08200.25 ▲13.46
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,4732.8256.40113.10

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/advance-wc-analytics/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • Zombie WordPress options detected upon uninstall: 4 options
    • fs_active_plugins
    • fs_debug_mode
    • fs_gdpr
    • fs_accounts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP Passed 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
Congratulations! This plugin passed the SRP test

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 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 16 tag instead of maximum 10
The official readme.txt is a good inspiration

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

The main PHP script in "Advanced WC Analytics - Google Analytics Dashboard for WooCommerce" version 3.0.1 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Requires at least: Required version does not match 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 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected35,411 lines of code in 150 files:
LanguageFilesBlank linesComment linesLines of code
PHP1257,46516,30034,646
JavaScript1034153319
Markdown1680214
CSS13012205
JSON10027

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity82.05
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity4.65
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes55
▷ Abstract classes35.45%
▷ Concrete classes5294.55%
▷ Final classes00.00%
Methods1,252
▷ Static methods17614.06%
▷ Public methods88170.37%
▷ Protected methods292.32%
▷ Private methods34227.32%
Functions95
▷ Named functions9498.95%
▷ Anonymous functions11.05%
Constants131
▷ Global constants10580.15%
▷ Class constants2619.85%
▷ Public constants26100.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
14 PNG files occupy 0.17MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assests/images/icon-2.png1.47KB0.72KB▼ 50.93%
assests/images/icon-7.png3.13KB1.53KB▼ 51.25%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assests/images/icon-4.png3.53KB1.75KB▼ 50.37%
assests/images/icon-8.png10.32KB5.48KB▼ 46.86%