78% ga-in

Code Review | GAinWP Google Analytics Integration for WordPress

WordPress plugin GAinWP Google Analytics Integration for WordPress scored78%from 54 tests.

About plugin

  • Plugin page: ga-in
  • Plugin version: 5.4.6
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.5
  • WordPress version: 6.3.1
  • First release: Jun 14, 2018
  • Latest release: Sep 10, 2020
  • Number of updates: 29
  • Update frequency: every 28.2 days
  • Top authors: tomdude (100%)

Code review

54 tests

User reviews

125 reviews

Install metrics

20,000+ active /114,406 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
Install script ran successfully

Server metrics [RAM: ▲0.79MB] [CPU: ▼3.53ms] Passed 4 tests

Analyzing server-side resources used by GAinWP Google Analytics Integration for WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.95 ▲0.4945.59 ▲4.08
Dashboard /wp-admin4.24 ▲0.9353.69 ▲2.21
Posts /wp-admin/edit.php4.24 ▲0.8853.63 ▲1.95
Add New Post /wp-admin/post-new.php6.72 ▲0.8387.67 ▼22.36
Media Library /wp-admin/upload.php4.24 ▲1.0145.07 ▲9.32
Reporting Settings /wp-admin/admin.php?page=gainwp_report_settings4.2439.49
Tracking Settings /wp-admin/admin.php?page=gainwp_tracking_settings4.2440.64
Errors & Debug /wp-admin/admin.php?page=gainwp_errors_debugging4.2437.25
General Settings /wp-admin/admin.php?page=gainwp_settings6.6144.81

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 133 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
gainwp_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_gainwp-frontwidget-report

Browser metrics Passed 4 tests

A check of browser resources used by GAinWP Google Analytics Integration for WordPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,947 ▲20115.57 ▲1.401.76 ▲0.0142.27 ▼0.68
Dashboard /wp-admin2,360 ▲1787.44 ▲1.45130.07 ▲18.9138.52 ▼5.13
Posts /wp-admin/edit.php2,193 ▲1044.20 ▲2.1450.38 ▲7.8232.85 ▼2.05
Add New Post /wp-admin/post-new.php1,549 ▲1123.22 ▲0.12673.61 ▼0.2557.89 ▲3.10
Media Library /wp-admin/upload.php1,433 ▲454.22 ▼0.01104.20 ▲1.6346.62 ▲1.30
Reporting Settings /wp-admin/admin.php?page=gainwp_report_settings1,2932.1825.3138.70
Tracking Settings /wp-admin/admin.php?page=gainwp_tracking_settings3,0552.1235.7735.48
Errors & Debug /wp-admin/admin.php?page=gainwp_errors_debugging1,1082.0831.4235.60
General Settings /wp-admin/admin.php?page=gainwp_settings1,1031.9431.8633.88

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_gainwp-frontwidget-report
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% 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
Please take a closer look at the following
  • 7× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/ga-in/front/views/analytics-amp-clientidapi.php
    • > /wp-content/plugins/ga-in/front/views/optimize-code.php
    • > /wp-content/plugins/ga-in/front/views/analytics-amp-code.php
    • > /wp-content/plugins/ga-in/front/views/analytics-code.php
    • > /wp-content/plugins/ga-in/front/views/tagmanager-amp-code.php
    • > /wp-content/plugins/ga-in/front/views/tagmanager-code.php
    • > /wp-content/plugins/ga-in/front/views/analytics-optout-code.php
  • 28× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/ga-in/front/views/tagmanager-code.php on line 19
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/ga-in/front/views/analytics-optout-code.php on line 11
    • > PHP Warning
      Use of undefined constant GAINWP_CURRENT_VERSION - assumed 'GAINWP_CURRENT_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/ga-in/front/views/analytics-code.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/ga-in/admin/views/access-code.php:8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ga-in/front/views/analytics-amp-code.php on line 10
    • > PHP Fatal error
      Uncaught Error: Class 'Deconfin_Service' not found in wp-content/plugins/ga-in/tools/src/Deconfin/Service/Analytics.php:29
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/ga-in/front/views/analytics-amp-code.php on line 10
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/ga-in/front/views/analytics-code.php on line 16
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ga-in/front/views/analytics-code.php on line 9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ga-in/front/views/analytics-optout-code.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
8 plugin tags: google analytics code, google analytics dashboard, analytics, google analytics plugin, google analytics widget...

ga-in/gainwp.php 92% from 13 tests

The main PHP file in "GAinWP Google Analytics Integration for WordPress" ver. 5.4.6 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ga-in.php" instead of "gainwp.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected18,685 lines of code in 95 files:
LanguageFilesBlank linesComment linesLines of code
PHP751,7924,76418,228
JavaScript12100449
CSS8048

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity8.35
▷ Minimum class complexity1.00
▷ Maximum class complexity210.00
Average method complexity1.81
▷ Minimum method complexity1.00
▷ Maximum method complexity76.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes188
▷ Abstract classes63.19%
▷ Concrete classes18296.81%
▷ Final classes126.59%
Methods1,728
▷ Static methods482.78%
▷ Public methods1,63694.68%
▷ Protected methods241.39%
▷ Private methods683.94%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants58
▷ Global constants610.34%
▷ Class constants5289.66%
▷ Public constants52100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
34 compressed PNG files occupy 0.11MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
realtime/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
realtime/jquery/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
realtime/jquery/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
realtime/jquery/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
admin/images/star.png1.47KB1.39KB▼ 5.31%