90% ga-google-analytics

Code Review | GA Google Analytics – Connect Google Analytics to WordPress

WordPress plugin GA Google Analytics – Connect Google Analytics to WordPress scored90%from 54 tests.

About plugin

  • Plugin page: ga-google-analytics
  • Plugin version: 20231101...
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Nov 13, 2012
  • Latest release: Nov 1, 2023
  • Number of updates: 73
  • Update frequency: every 54.9 days
  • Top authors: specialk (100%)

Code review

54 tests

User reviews

150 reviews

Install metrics

600,000+ active /6,726,438 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.12MB] [CPU: ▼2.82ms] Passed 4 tests

Server-side resources used by GA Google Analytics – Connect Google Analytics to WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1442.25 ▲0.90
Dashboard /wp-admin3.44 ▲0.0958.44 ▼5.47
Posts /wp-admin/edit.php3.55 ▲0.1947.55 ▲2.17
Add New Post /wp-admin/post-new.php6.02 ▲0.1387.94 ▼7.53
Media Library /wp-admin/upload.php3.36 ▲0.1337.36 ▲0.82
Google Analytics /wp-admin/options-general.php?page=ga-google-analytics3.4432.28

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for GA Google Analytics – Connect Google Analytics to WordPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.37 ▼0.361.68 ▼0.0043.71 ▼1.72
Dashboard /wp-admin2,196 ▲185.56 ▼0.1590.66 ▼23.2837.78 ▼7.20
Posts /wp-admin/edit.php2,107 ▲72.14 ▲0.0935.27 ▲0.5932.92 ▼4.21
Add New Post /wp-admin/post-new.php1,529 ▲323.75 ▲0.13673.05 ▼26.4552.51 ▲0.14
Media Library /wp-admin/upload.php1,404 ▲44.14 ▼0.0191.94 ▼16.5141.32 ▼8.03
Google Analytics /wp-admin/options-general.php?page=ga-google-analytics1,3591.8627.7642.43

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
Everything seems fine, however this is by no means an exhaustive 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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
7 plugin tags: google, tracking, analytics, statistics, google analytics...

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

This is the main PHP file of "GA Google Analytics – Connect Google Analytics to WordPress" version 20231101..., providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Version: Use only periods and digits for the version number (ex. "1.0.3" instead of "20231101...")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin874 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP545854806
CSS113149
JavaScript110119

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity77.00
▷ Minimum class complexity77.00
▷ Maximum class complexity77.00
Average method complexity3.53
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods30
▷ Static methods00.00%
▷ Public methods30100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.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
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/ga-icon-160x160.png11.98KB5.24KB▼ 56.27%