58% ga-backend-tracking

Code Review | Cookieless Backend Server Tracking for Google Analytics - WordPress Plugin

WordPress plugin Cookieless Backend Server Tracking for Google Analytics - WordPress Plugin scored58%from 54 tests.

About plugin

  • Plugin page: ga-backend-tracking
  • Plugin version: 2.4.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Nov 18, 2018
  • Latest release: Mar 26, 2023
  • Number of updates: 58
  • Update frequency: every 27.5 days
  • Top authors: nikelschubert (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /2,415 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.35MB] [CPU: ▲2.25ms] Passed 4 tests

Analyzing server-side resources used by Cookieless Backend Server Tracking for Google Analytics - WordPress Plugin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2542.61 ▼1.24
Dashboard /wp-admin3.74 ▲0.4053.24 ▼6.79
Posts /wp-admin/edit.php3.79 ▲0.4457.65 ▲10.18
Add New Post /wp-admin/post-new.php6.26 ▲0.37102.49 ▲6.84
Media Library /wp-admin/upload.php3.60 ▲0.3746.31 ▲12.46
GA Backend Tracking /wp-admin/options-general.php?page=nsc_gabt_settings3.6038.92

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Cookieless Backend Server Tracking for Google Analytics - WordPress Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.34 ▼0.041.83 ▲0.1742.91 ▼0.11
Dashboard /wp-admin2,199 ▲225.60 ▼0.0681.74 ▼4.5141.40 ▲1.66
Posts /wp-admin/edit.php2,104 ▲41.97 ▼0.0640.06 ▲3.3235.50 ▲1.48
Add New Post /wp-admin/post-new.php1,529 ▼223.57 ▲0.44650.08 ▲29.4068.98 ▲13.64
Media Library /wp-admin/upload.php1,407 ▲44.20 ▲0.0097.07 ▲2.3342.77 ▼2.02
GA Backend Tracking /wp-admin/options-general.php?page=nsc_gabt_settings8442.0023.6522.90

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/ga-backend-tracking/uninstall.php+7
    Constant NSC_GABT_PLUGINPATH already defined
  • The plugin did not uninstall correctly, leaving 16 files (0.13MB) in the plugin directory
    • (new file) LICENCE
    • (new file) botregexp.txt
    • (new file) class/class_nsc_gabt_extension_blacklist.php
    • (new file) admin/js/admin.js
    • (new file) class/class_nsc_gabt_backend.php
    • (new file) admin/tpl/admin.php
    • (new file) class/class_nsc_gabt_collect_data_order.php
    • (new file) class/class_nsc_gabt_cid_manager.php
    • (new file) class/class-de-nikelschubert-nsc_gabt.php
    • (new file) class/class_nsc_gabt_collect_data.php
    • ...
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/ga-backend-tracking/uninstall.php
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/ga-backend-tracking/admin/tpl/admin.php:22
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/ga-backend-tracking/admin/tpl/admin.php on line 9
    • > PHP Notice
      Trying to get property 'active_tab_index' of non-object in wp-content/plugins/ga-backend-tracking/admin/tpl/admin.php on line 16
    • > PHP Notice
      Trying to get property 'setting_page_fields' of non-object in wp-content/plugins/ga-backend-tracking/admin/tpl/admin.php on line 9
    • > PHP Notice
      Trying to get property 'setting_page_fields' of non-object in wp-content/plugins/ga-backend-tracking/admin/tpl/admin.php on line 16
    • > PHP Notice
      Trying to get property 'tabs' of non-object in wp-content/plugins/ga-backend-tracking/admin/tpl/admin.php on line 9
    • > PHP Notice
      Undefined variable: objSettings in wp-content/plugins/ga-backend-tracking/admin/tpl/admin.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'de_nikelschubert_nsc_gabt' not found in wp-content/plugins/ga-backend-tracking/class/class_nsc_gabt_frontend.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'de_nikelschubert_nsc_gabt' not found in wp-content/plugins/ga-backend-tracking/class/class_nsc_gabt_backend.php:3
    • > PHP Notice
      Undefined variable: objSettings in wp-content/plugins/ga-backend-tracking/admin/tpl/admin.php on line 16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Contributors: The plugin contributors field is missing
You can look at the official readme.txt

ga-backend-tracking/nsc_google_analytics_backend-tracking.php 92% from 13 tests

The main file in "Cookieless Backend Server Tracking for Google Analytics - WordPress Plugin" v. 2.4.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ga-backend-tracking.php" instead of "nsc_google_analytics_backend-tracking.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
No dangerous file extensions were detected1,874 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP11234531,409
JSON100386
JavaScript111879

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity24.11
▷ Minimum class complexity11.00
▷ Maximum class complexity46.00
Average method complexity3.14
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods97
▷ Static methods00.00%
▷ Public methods6465.98%
▷ Protected methods44.12%
▷ Private methods2929.90%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin