84% flexlab-google-analytics-for-woocommerce

Code Review | Flex Lab | Google Analytics for WooCommerce (GA4)

WordPress plugin Flex Lab | Google Analytics for WooCommerce (GA4) scored84%from 54 tests.

About plugin

  • Plugin page: flexlab-google-an...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9.3-6.1
  • WordPress version: 6.3.1
  • First release: Nov 16, 2022
  • Latest release: Nov 16, 2022
  • Number of updates: 12
  • Update frequency: every 0.7 days
  • Top authors: flexlab (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /181 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.11MB] [CPU: ▲0.08ms] Passed 4 tests

Analyzing server-side resources used by Flex Lab | Google Analytics for WooCommerce (GA4)
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1041.06 ▲1.44
Dashboard /wp-admin3.42 ▲0.1148.47 ▼1.49
Posts /wp-admin/edit.php3.53 ▲0.1749.58 ▲4.51
Add New Post /wp-admin/post-new.php6.00 ▲0.1195.05 ▼3.52
Media Library /wp-admin/upload.php3.34 ▲0.1137.16 ▲3.91

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
woocommerce_google_analytics__api_secret
woocommerce_google_analytics__use_google_tag
widget_recent-comments
can_compress_scripts
woocommerce_google_analytics__measurement_id
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Flex Lab | Google Analytics for WooCommerce (GA4)
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7014.79 ▲0.211.76 ▲0.0543.55 ▼1.31
Dashboard /wp-admin2,222 ▲374.88 ▼0.94105.99 ▲7.3538.42 ▲0.34
Posts /wp-admin/edit.php2,105 ▲132.05 ▲0.0736.22 ▼0.7433.90 ▲0.67
Add New Post /wp-admin/post-new.php1,550 ▲3123.50 ▲0.38643.77 ▼0.4151.16 ▼14.45
Media Library /wp-admin/upload.php1,404 ▲194.25 ▲0.0595.85 ▲4.4340.56 ▲0.82

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Trait 'Flexlab_Google_Analytics_For_WooCommerce\\Traits\\Forbidden' not found in wp-content/plugins/flexlab-google-analytics-for-woocommerce/includes/class-woocommerce.php on line 14
    • > PHP Fatal error
      Trait 'Flexlab_Google_Analytics_For_WooCommerce\\Traits\\Forbidden' not found in wp-content/plugins/flexlab-google-analytics-for-woocommerce/includes/admin/class-options.php on line 13
    • > PHP Fatal error
      Trait 'Flexlab_Google_Analytics_For_WooCommerce\\Traits\\Forbidden' not found in wp-content/plugins/flexlab-google-analytics-for-woocommerce/includes/class-google-analytics.php on line 17
    • > PHP Fatal error
      Trait 'Flexlab_Google_Analytics_For_WooCommerce\\Traits\\Forbidden' not found in wp-content/plugins/flexlab-google-analytics-for-woocommerce/includes/admin/class-settings.php on line 13
    • > PHP Fatal error
      Trait 'Flexlab_Google_Analytics_For_WooCommerce\\Traits\\Forbidden' not found in wp-content/plugins/flexlab-google-analytics-for-woocommerce/includes/class-plugin.php on line 15

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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 require attention:
  • Contributors: The plugin contributors field is not present
You can look at the official readme.txt

flexlab-google-analytics-for-woocommerce/flexlab-google-analytics-for-woocommerce.php 92% from 13 tests

The principal PHP file in "Flex Lab | Google Analytics for WooCommerce (GA4)" v. 1.0.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Domain Path: The domain path folder does not exist ("/languages/")

Code Analysis Passed 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
No dangerous file extensions were detected717 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP10201543717

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity8.38
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity1.79
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces3
Interfaces0
Traits2
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods75
▷ Static methods1925.33%
▷ Public methods3242.67%
▷ Protected methods00.00%
▷ Private methods4357.33%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin