89% universal-google-analytics

Code Review | Universal Google Analytics (GA3 and GA4)

WordPress plugin Universal Google Analytics (GA3 and GA4) scored89%from 54 tests.

About plugin

  • Plugin page: universal-google-...
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.0.3
  • WordPress version: 6.3.1
  • First release: Jun 18, 2016
  • Latest release: Oct 23, 2022
  • Number of updates: 27
  • Update frequency: every 89.1 days
  • Top authors: nimonogi (81.48%)mohsenr1 (22.22%)

Code review

54 tests

User reviews

2 reviews

Install metrics

600+ active /6,104 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼7.33ms] Passed 4 tests

A check of server-side resources used by Universal Google Analytics (GA3 and GA4)
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.70 ▲0.09
Dashboard /wp-admin3.32 ▲0.0152.22 ▼1.82
Posts /wp-admin/edit.php3.37 ▲0.0147.93 ▼2.60
Add New Post /wp-admin/post-new.php5.90 ▲0.0185.40 ▼21.80
Media Library /wp-admin/upload.php3.24 ▲0.0133.75 ▼3.09
Universal Google Analytics /wp-admin/options-general.php?page=universal-google-analytics-settings3.2132.75

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Universal Google Analytics (GA3 and GA4): an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲6713.38 ▼0.9220.87 ▲18.6143.79 ▼0.53
Dashboard /wp-admin2,210 ▲225.90 ▲0.02112.98 ▲2.9643.38 ▼0.52
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.0037.66 ▼0.7635.87 ▲2.81
Add New Post /wp-admin/post-new.php1,536 ▲323.13 ▼0.10621.80 ▼23.7760.10 ▲12.13
Media Library /wp-admin/upload.php1,392 ▲14.20 ▼0.0999.29 ▼7.3442.46 ▼1.75
Universal Google Analytics /wp-admin/options-general.php?page=universal-google-analytics-settings9852.1723.7829.85

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests Passed 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)
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 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
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 30 tag instead of maximum 10
  • Screenshots: Add images for these screenshots: #1 (Plugin Settings 1 screenshot-1.png), #2 (Plugin Settings 2 screenshot-2.png)
The official readme.txt might help

universal-google-analytics/universal-google-analytics.php Passed 13 tests

The entry point to "Universal Google Analytics (GA3 and GA4)" version 1.4 is a PHP file that has certain tags in its header comment area
89 characters long description:
Adds your Google Analytics (GA3 or GA4) tracking code and ID to the footer of your theme.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin368 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP26920327
SVG10141

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
2 compressed PNG files occupy 0.07MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png27.26KB25.72KB▼ 5.65%
screenshot-1.png40.80KB38.61KB▼ 5.38%