84% lara-google-analytics

Code Review | Lara's Google Analytics (GA4)

WordPress plugin Lara's Google Analytics (GA4) scored84%from 54 tests.

About plugin

  • Plugin page: lara-google-analy...
  • Plugin version: 4.0.3
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-6.5.0
  • WordPress version: 6.3.1
  • First release: Apr 26, 2016
  • Latest release: Nov 15, 2023
  • Number of updates: 112
  • Update frequency: every 24.6 days
  • Top authors: amribrahim (100%)

Code review

54 tests

User reviews

121 reviews

Install metrics

10,000+ active /336,376 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.86ms] Passed 4 tests

Analyzing server-side resources used by Lara's Google Analytics (GA4)
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0140.22 ▲0.02
Dashboard /wp-admin3.34 ▲0.0448.52 ▲0.21
Posts /wp-admin/edit.php3.38 ▲0.0346.83 ▼0.37
Add New Post /wp-admin/post-new.php5.91 ▲0.0383.64 ▼15.28
Media Library /wp-admin/upload.php3.26 ▲0.0335.25 ▲2.28

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 106 new files
Database: 1 new table, 7 new options
New tables
wp_lrgawidget_global_settings
New WordPress options
widget_recent-posts
widget_theysaidso_widget
lrgalite-global_options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Lara's Google Analytics (GA4): an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,574 ▲1,81214.79 ▲0.441.76 ▲0.1940.66 ▼2.30
Dashboard /wp-admin3,970 ▲1,7966.14 ▲0.40133.60 ▲41.46100.09 ▲52.20
Posts /wp-admin/edit.php2,100 ▼01.94 ▼0.0540.46 ▲1.9635.78 ▲0.09
Add New Post /wp-admin/post-new.php1,526 ▼1423.33 ▼2.05588.36 ▼123.4758.32 ▼8.93
Media Library /wp-admin/upload.php1,400 ▲64.29 ▲0.0997.28 ▼1.1040.90 ▼0.08

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Please take a closer look at the following
  • 18× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/lara-google-analytics/core/system/wordpress/admin.actions.php
    • > /wp-content/plugins/lara-google-analytics/core/lrgawidget.handler.php
    • > /wp-content/plugins/lara-google-analytics/core/plugins/earnings/lrga_earnings_sales.php
    • > /wp-content/plugins/lara-google-analytics/core/storage.class.php
    • > /wp-content/plugins/lara-google-analytics/core/review.notice.php
    • > /wp-content/plugins/lara-google-analytics/core/output.class.php
    • > /wp-content/plugins/lara-google-analytics/core/system/wordpress/system.bootstrap.class.php
    • > /wp-content/plugins/lara-google-analytics/core/system/wordpress/plugin.updater.class.php
    • > /wp-content/plugins/lara-google-analytics/core/boot.php
    • > /wp-content/plugins/lara-google-analytics/core/system/wordpress/plugin.actions.class.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: google analytics widget, google analytics plugin, analytics, google analytics, google analytics dashboard

lara-google-analytics/lara-google-analytics.php 92% from 13 tests

"Lara's Google Analytics (GA4)" version 4.0.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 153 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin33,453 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
CSS839817218,575
SVG40129,587
PHP184911492,959
JavaScript134091142,331
HTML1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity20.43
▷ Minimum class complexity2.00
▷ Maximum class complexity116.00
Average method complexity3.05
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods133
▷ Static methods4433.08%
▷ Public methods7657.14%
▷ Protected methods129.02%
▷ Private methods4533.83%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants23
▷ Global constants1669.57%
▷ Class constants730.43%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
15 PNG files occupy 0.31MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
dist/img/flags.png78.01KB25.86KB▼ 66.85%
dist/img/lrwidget_logo.png10.88KB4.29KB▼ 60.53%
dist/plugins/colorbox/images/overlay.png0.11KB0.15KB0.00%
dist/img/xtraorbit_logo.png27.78KB12.13KB▼ 56.34%
dist/plugins/minicolors/jquery.minicolors.png67.02KB34.31KB▼ 48.80%