84% advanced-google-universal-analytics

Code Review | Advanced Google Universal Analytics

WordPress plugin Advanced Google Universal Analytics scored84%from 54 tests.

About plugin

  • Plugin page: advanced-google-u...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.2
  • WordPress version: 6.3.1
  • First release: May 22, 2014
  • Latest release: Apr 28, 2023
  • Number of updates: 23
  • Update frequency: every 141.9 days
  • Top authors: stefanoai (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /7,191 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.23ms] Passed 4 tests

An overview of server-side resources used by Advanced Google Universal Analytics
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0344.92 ▲6.44
Dashboard /wp-admin3.33 ▲0.0349.01 ▼7.45
Posts /wp-admin/edit.php3.38 ▲0.0349.69 ▲0.90
Add New Post /wp-admin/post-new.php5.91 ▲0.0287.76 ▼11.53
Media Library /wp-admin/upload.php3.25 ▲0.0340.52 ▲1.17
Advanced Google Universal Analytics /wp-admin/options-general.php?page=AI-AdvancedGoogleUniversalAnalytics3.2236.77

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Advanced Google Universal Analytics
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.35 ▼0.001.80 ▲0.1643.13 ▲0.73
Dashboard /wp-admin2,196 ▲155.59 ▼0.0795.91 ▼8.5446.31 ▲0.68
Posts /wp-admin/edit.php2,104 ▲72.01 ▼0.0237.84 ▲2.3435.86 ▲0.70
Add New Post /wp-admin/post-new.php1,529 ▲223.48 ▲0.57676.02 ▲25.2653.38 ▼2.33
Media Library /wp-admin/upload.php1,404 ▲104.08 ▼0.14115.36 ▲14.0549.30 ▲7.09
Advanced Google Universal Analytics /wp-admin/options-general.php?page=AI-AdvancedGoogleUniversalAnalytics1,0662.4143.2743.68

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

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

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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-google-universal-analytics/AdvancedGoogleUniversalAnalytics.php:16

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 on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
10 plugin tags: google analytics, google universal analytics, no track people, analytics, analytics two code tracking...

advanced-google-universal-analytics/AdvancedGoogleUniversalAnalytics.php 85% from 13 tests

The entry point to "Advanced Google Universal Analytics" version 1.0.3 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("advanced-google-universal-analytics.php" instead of "AdvancedGoogleUniversalAnalytics.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 442 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected509 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP11619427
PO File2242482

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity48.00
▷ Minimum class complexity48.00
▷ Maximum class complexity48.00
Average method complexity7.71
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin